| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284 |
- <?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 Wed Apr 28 13:55:31 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" />
- <result column="remarks" jdbcType="VARCHAR" property="remarks" />
- <result column="recovery" jdbcType="INTEGER" property="recovery" />
- </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 Wed Apr 28 13:55:31 CST 2021.
- -->
- id, `uid`, aid, `status`, distribution_time, create_time, remarks, `recovery`
- </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 Wed Apr 28 13:55:31 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 Wed Apr 28 13:55:31 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 Wed Apr 28 13:55:31 CST 2021.
- -->
- insert into user_channel (id, `uid`, aid,
- `status`, distribution_time, create_time,
- remarks, `recovery`)
- values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
- #{status,jdbcType=INTEGER}, #{distributionTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
- #{remarks,jdbcType=VARCHAR}, #{recovery,jdbcType=INTEGER})
- </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 Wed Apr 28 13:55:31 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>
- <if test="remarks != null">
- remarks,
- </if>
- <if test="recovery != null">
- `recovery`,
- </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>
- <if test="remarks != null">
- #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="recovery != null">
- #{recovery,jdbcType=INTEGER},
- </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 Wed Apr 28 13:55:31 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>
- <if test="remarks != null">
- remarks = #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="recovery != null">
- `recovery` = #{recovery,jdbcType=INTEGER},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByUid" parameterType="com.goafanti.common.model.UserChannel">
-
- update user_channel
- <set>
- <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>
- <if test="remarks != null">
- remarks = #{remarks,jdbcType=VARCHAR},
- </if>
- <if test="recovery != null">
- `recovery` = #{recovery,jdbcType=INTEGER},
- </if>
- </set>
- where uid = #{uid,jdbcType=VARCHAR} and status in (1,2)
- </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 Wed Apr 28 13:55:31 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},
- remarks = #{remarks,jdbcType=VARCHAR},
- `recovery` = #{recovery,jdbcType=INTEGER}
- where id = #{id,jdbcType=INTEGER}
- </update>
-
- <insert id="insertBatch" parameterType="com.goafanti.user.bo.InputUserChannel">
- insert into user_channel ( `uid`, aid,
- `status`,remarks)VALUES
- <foreach collection="list" index="index" item="item" separator=",">
- (#{item.uid,jdbcType=VARCHAR}, #{item.aid,jdbcType=VARCHAR},#{item.status},
- #{item.remarks})
- </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,a.remarks,
- 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
- and a.status in (3,4,5,9)
- <if test="aid !=null">
- and a.aid= #{aid}
- </if>
- order by a.create_time desc
- <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 and a.status in (3,4,5,9)
- <if test="aid !=null">
- and a.aid= #{aid}
- </if>
- </select>
- <update id="updateByuids">
- update user_channel set
- status = #{status}
- <if test="type == 2">
- ,recovery=1
- </if>
- <if test="date !=null">
- ,distribution_time= #{date}
- </if>
- <if test="maid !=null">
- ,maid= #{maid}
- </if>
- where 1=1
- <if test="type == 2">
- and status in (0,1,2)
- </if>
- <if test="type != 2">
- and status in (0,1,2,6)
- </if>
-
- and uid in(
- <foreach collection="list" index="index" item="item" separator=",">
- #{item}
- </foreach>
- )
- </update>
- <delete id="deleteByIds">
- delete from user_channel where id in (
- <foreach collection="list" index="index" item="item" separator=",">
- #{item}
- </foreach>
- )
- </delete>
- <delete id="deleteUser">
- delete user_channel ,user , organization_identity ,organization_contact_book
- from user_channel ,user , organization_identity ,organization_contact_book
- where user_channel.id in (
- <foreach collection="list" index="index" item="item" separator=",">
- #{item}
- </foreach>
- )
- and user_channel.uid =user.id and user.status =1
- and user.id=organization_identity.uid and user.id=organization_contact_book.uid
-
- </delete>
-
- <select id="checkRecovery" resultType="java.lang.String">
- select recovery from user_channel where uid in (
- <foreach collection="list" index="index" item="item" separator=",">
- #{item}
- </foreach>
- )
- </select>
- </mapper>
|