| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.goafanti.common.dao.UserChannelMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserChannel">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu Apr 22 09:06:45 CST 2021.
- -->
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="uid" jdbcType="VARCHAR" property="uid" />
- <result column="aid" jdbcType="VARCHAR" property="aid" />
- <result column="status" jdbcType="INTEGER" property="status" />
- <result column="distribution_time" jdbcType="TIMESTAMP" property="distributionTime" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- </resultMap>
- <sql id="Base_Column_List">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu Apr 22 09:06:45 CST 2021.
- -->
- id, `uid`, aid, `status`, distribution_time, create_time
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu Apr 22 09:06:45 CST 2021.
- -->
- select
- <include refid="Base_Column_List" />
- from user_channel
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu Apr 22 09:06:45 CST 2021.
- -->
- delete from user_channel
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.goafanti.common.model.UserChannel">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu Apr 22 09:06:45 CST 2021.
- -->
- insert into user_channel (id, `uid`, aid,
- `status`, distribution_time, create_time
- )
- values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
- #{status,jdbcType=INTEGER}, #{distributionTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.goafanti.common.model.UserChannel">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu Apr 22 09:06:45 CST 2021.
- -->
- insert into user_channel
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="id != null">
- id,
- </if>
- <if test="uid != null">
- `uid`,
- </if>
- <if test="aid != null">
- aid,
- </if>
- <if test="status != null">
- `status`,
- </if>
- <if test="distributionTime != null">
- distribution_time,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="id != null">
- #{id,jdbcType=INTEGER},
- </if>
- <if test="uid != null">
- #{uid,jdbcType=VARCHAR},
- </if>
- <if test="aid != null">
- #{aid,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="distributionTime != null">
- #{distributionTime,jdbcType=TIMESTAMP},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserChannel">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu Apr 22 09:06:45 CST 2021.
- -->
- update user_channel
- <set>
- <if test="uid != null">
- `uid` = #{uid,jdbcType=VARCHAR},
- </if>
- <if test="aid != null">
- aid = #{aid,jdbcType=VARCHAR},
- </if>
- <if test="status != null">
- `status` = #{status,jdbcType=INTEGER},
- </if>
- <if test="distributionTime != null">
- distribution_time = #{distributionTime,jdbcType=TIMESTAMP},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserChannel">
- <!--
- WARNING - @mbg.generated
- This element is automatically generated by MyBatis Generator, do not modify.
- This element was generated on Thu Apr 22 09:06:45 CST 2021.
- -->
- update user_channel
- set `uid` = #{uid,jdbcType=VARCHAR},
- aid = #{aid,jdbcType=VARCHAR},
- `status` = #{status,jdbcType=INTEGER},
- distribution_time = #{distributionTime,jdbcType=TIMESTAMP},
- create_time = #{createTime,jdbcType=TIMESTAMP}
- where id = #{id,jdbcType=INTEGER}
- </update>
-
- <insert id="insertBatch" parameterType="com.goafanti.user.bo.InputUserChannel">
- insert into user_channel ( `uid`, aid,
- `status`)VALUES
- <foreach item="item" index="index" collection="list" separator=",">
- (#{item.uid,jdbcType=VARCHAR}, #{item.aid,jdbcType=VARCHAR},#{item.status}
- )
- </foreach>
- </insert>
-
- <select id="selectByAidAndstatusList" resultType="com.goafanti.user.bo.OutUserChannel">
- select a.id,a.uid,b.nickname userName,a.aid,a.status,date_format(a.distribution_time,'%Y-%m-%d %H:%i:%S')distributionTimes,
- date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimes ,c.contacts ,c.contact_mobile contactMobile,
- b.society_tag societyTag ,d1.name province,d2.name city from user_channel a
- left join user b on a.uid=b.id left join organization_identity c on a.uid =c.uid
- left join district_glossory d1 on c.location_province =d1.id
- left join district_glossory d2 on c.location_city =d2.id
- where 1=1
- <if test="aid !=null">
- and a.aid= #{aid}
- </if>
- <if test="status !=null">
- and a.status =#{status}
- </if>
- <if test="page_sql != null">
- ${page_sql}
- </if>
- </select>
-
- <select id="selectByAidAndstatusCount" resultType="java.lang.Integer">
- select count(*) from user_channel a
- left join user b on a.uid=b.id left join organization_identity c on a.uid =c.uid
- left join district_glossory d1 on c.location_province =d1.id
- left join district_glossory d2 on c.location_city =d2.id
- where 1=1
- <if test="aid !=null">
- and a.aid= #{aid}
- </if>
- <if test="status !=null">
- and a.status =#{status}
- </if>
-
- </select>
- <update id="updateByuids">
- update user_channel set status = #{status}
- where uid in(
- <foreach item="item" index="index" collection="list" separator=",">
- #{item}
- </foreach>
- )
- </update>
- <delete id="deleteByIds">
- delete from user_channel where id in (
- <foreach item="item" index="index" collection="list" separator=",">
- #{item}
- </foreach>
- )
- </delete>
- </mapper>
|