UserChannelMapper.xml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.goafanti.common.dao.UserChannelMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserChannel">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Thu Apr 22 09:06:45 CST 2021.
  9. -->
  10. <id column="id" jdbcType="INTEGER" property="id" />
  11. <result column="uid" jdbcType="VARCHAR" property="uid" />
  12. <result column="aid" jdbcType="VARCHAR" property="aid" />
  13. <result column="status" jdbcType="INTEGER" property="status" />
  14. <result column="distribution_time" jdbcType="TIMESTAMP" property="distributionTime" />
  15. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  16. </resultMap>
  17. <sql id="Base_Column_List">
  18. <!--
  19. WARNING - @mbg.generated
  20. This element is automatically generated by MyBatis Generator, do not modify.
  21. This element was generated on Thu Apr 22 09:06:45 CST 2021.
  22. -->
  23. id, `uid`, aid, `status`, distribution_time, create_time
  24. </sql>
  25. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  26. <!--
  27. WARNING - @mbg.generated
  28. This element is automatically generated by MyBatis Generator, do not modify.
  29. This element was generated on Thu Apr 22 09:06:45 CST 2021.
  30. -->
  31. select
  32. <include refid="Base_Column_List" />
  33. from user_channel
  34. where id = #{id,jdbcType=INTEGER}
  35. </select>
  36. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  37. <!--
  38. WARNING - @mbg.generated
  39. This element is automatically generated by MyBatis Generator, do not modify.
  40. This element was generated on Thu Apr 22 09:06:45 CST 2021.
  41. -->
  42. delete from user_channel
  43. where id = #{id,jdbcType=INTEGER}
  44. </delete>
  45. <insert id="insert" parameterType="com.goafanti.common.model.UserChannel">
  46. <!--
  47. WARNING - @mbg.generated
  48. This element is automatically generated by MyBatis Generator, do not modify.
  49. This element was generated on Thu Apr 22 09:06:45 CST 2021.
  50. -->
  51. insert into user_channel (id, `uid`, aid,
  52. `status`, distribution_time, create_time
  53. )
  54. values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
  55. #{status,jdbcType=INTEGER}, #{distributionTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}
  56. )
  57. </insert>
  58. <insert id="insertSelective" parameterType="com.goafanti.common.model.UserChannel">
  59. <!--
  60. WARNING - @mbg.generated
  61. This element is automatically generated by MyBatis Generator, do not modify.
  62. This element was generated on Thu Apr 22 09:06:45 CST 2021.
  63. -->
  64. insert into user_channel
  65. <trim prefix="(" suffix=")" suffixOverrides=",">
  66. <if test="id != null">
  67. id,
  68. </if>
  69. <if test="uid != null">
  70. `uid`,
  71. </if>
  72. <if test="aid != null">
  73. aid,
  74. </if>
  75. <if test="status != null">
  76. `status`,
  77. </if>
  78. <if test="distributionTime != null">
  79. distribution_time,
  80. </if>
  81. <if test="createTime != null">
  82. create_time,
  83. </if>
  84. </trim>
  85. <trim prefix="values (" suffix=")" suffixOverrides=",">
  86. <if test="id != null">
  87. #{id,jdbcType=INTEGER},
  88. </if>
  89. <if test="uid != null">
  90. #{uid,jdbcType=VARCHAR},
  91. </if>
  92. <if test="aid != null">
  93. #{aid,jdbcType=VARCHAR},
  94. </if>
  95. <if test="status != null">
  96. #{status,jdbcType=INTEGER},
  97. </if>
  98. <if test="distributionTime != null">
  99. #{distributionTime,jdbcType=TIMESTAMP},
  100. </if>
  101. <if test="createTime != null">
  102. #{createTime,jdbcType=TIMESTAMP},
  103. </if>
  104. </trim>
  105. </insert>
  106. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserChannel">
  107. <!--
  108. WARNING - @mbg.generated
  109. This element is automatically generated by MyBatis Generator, do not modify.
  110. This element was generated on Thu Apr 22 09:06:45 CST 2021.
  111. -->
  112. update user_channel
  113. <set>
  114. <if test="uid != null">
  115. `uid` = #{uid,jdbcType=VARCHAR},
  116. </if>
  117. <if test="aid != null">
  118. aid = #{aid,jdbcType=VARCHAR},
  119. </if>
  120. <if test="status != null">
  121. `status` = #{status,jdbcType=INTEGER},
  122. </if>
  123. <if test="distributionTime != null">
  124. distribution_time = #{distributionTime,jdbcType=TIMESTAMP},
  125. </if>
  126. <if test="createTime != null">
  127. create_time = #{createTime,jdbcType=TIMESTAMP},
  128. </if>
  129. </set>
  130. where id = #{id,jdbcType=INTEGER}
  131. </update>
  132. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserChannel">
  133. <!--
  134. WARNING - @mbg.generated
  135. This element is automatically generated by MyBatis Generator, do not modify.
  136. This element was generated on Thu Apr 22 09:06:45 CST 2021.
  137. -->
  138. update user_channel
  139. set `uid` = #{uid,jdbcType=VARCHAR},
  140. aid = #{aid,jdbcType=VARCHAR},
  141. `status` = #{status,jdbcType=INTEGER},
  142. distribution_time = #{distributionTime,jdbcType=TIMESTAMP},
  143. create_time = #{createTime,jdbcType=TIMESTAMP}
  144. where id = #{id,jdbcType=INTEGER}
  145. </update>
  146. <insert id="insertBatch" parameterType="com.goafanti.user.bo.InputUserChannel">
  147. insert into user_channel ( `uid`, aid,
  148. `status`)VALUES
  149. <foreach item="item" index="index" collection="list" separator=",">
  150. (#{item.uid,jdbcType=VARCHAR}, #{item.aid,jdbcType=VARCHAR},#{item.status}
  151. )
  152. </foreach>
  153. </insert>
  154. <select id="selectByAidAndstatusList" resultType="com.goafanti.user.bo.OutUserChannel">
  155. select a.id,a.uid,b.nickname userName,a.aid,a.status,date_format(a.distribution_time,'%Y-%m-%d %H:%i:%S')distributionTimes,
  156. date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimes ,c.contacts ,c.contact_mobile contactMobile,
  157. b.society_tag societyTag ,d1.name province,d2.name city from user_channel a
  158. left join user b on a.uid=b.id left join organization_identity c on a.uid =c.uid
  159. left join district_glossory d1 on c.location_province =d1.id
  160. left join district_glossory d2 on c.location_city =d2.id
  161. where 1=1
  162. <if test="aid !=null">
  163. and a.aid= #{aid}
  164. </if>
  165. <if test="status !=null">
  166. and a.status =#{status}
  167. </if>
  168. <if test="page_sql != null">
  169. ${page_sql}
  170. </if>
  171. </select>
  172. <select id="selectByAidAndstatusCount" resultType="java.lang.Integer">
  173. select count(*) from user_channel a
  174. left join user b on a.uid=b.id left join organization_identity c on a.uid =c.uid
  175. left join district_glossory d1 on c.location_province =d1.id
  176. left join district_glossory d2 on c.location_city =d2.id
  177. where 1=1
  178. <if test="aid !=null">
  179. and a.aid= #{aid}
  180. </if>
  181. <if test="status !=null">
  182. and a.status =#{status}
  183. </if>
  184. </select>
  185. <update id="updateByuids">
  186. update user_channel set status = #{status}
  187. where uid in(
  188. <foreach item="item" index="index" collection="list" separator=",">
  189. #{item}
  190. </foreach>
  191. )
  192. </update>
  193. <delete id="deleteByIds">
  194. delete from user_channel where id in (
  195. <foreach item="item" index="index" collection="list" separator=",">
  196. #{item}
  197. </foreach>
  198. )
  199. </delete>
  200. </mapper>