UserMidMapper.xml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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.UserMidMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserMid">
  5. <id column="id" jdbcType="INTEGER" property="id" />
  6. <result column="uid" jdbcType="VARCHAR" property="uid" />
  7. <result column="aid" jdbcType="VARCHAR" property="aid" />
  8. <result column="last_follow_time" jdbcType="TIMESTAMP" property="lastFollowTime" />
  9. <result column="last_sign_time" jdbcType="TIMESTAMP" property="lastSignTime" />
  10. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  11. <result column="big_customer" jdbcType="INTEGER" property="bigCustomer" />
  12. <result column="update_aid" jdbcType="VARCHAR" property="updateAid" />
  13. <result column="update_name" jdbcType="VARCHAR" property="updateName" />
  14. <result column="date_update_time" jdbcType="TIMESTAMP" property="dateUpdateTime" />
  15. <result column="channel_type" jdbcType="INTEGER" property="channelType" />
  16. </resultMap>
  17. <sql id="Base_Column_List">
  18. id, `uid`, aid, last_follow_time, last_sign_time, create_time, big_customer, update_aid,
  19. update_name, date_update_time, channel_type
  20. </sql>
  21. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  22. select
  23. <include refid="Base_Column_List" />
  24. from user_mid
  25. where id = #{id,jdbcType=INTEGER}
  26. </select>
  27. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  28. delete from user_mid
  29. where id = #{id,jdbcType=INTEGER}
  30. </delete>
  31. <insert id="insert" parameterType="com.goafanti.common.model.UserMid">
  32. insert into user_mid (id, `uid`, aid,
  33. last_follow_time, last_sign_time, create_time,
  34. big_customer, update_aid, update_name,
  35. date_update_time, channel_type)
  36. values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
  37. #{lastFollowTime,jdbcType=TIMESTAMP}, #{lastSignTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
  38. #{bigCustomer,jdbcType=INTEGER}, #{updateAid,jdbcType=VARCHAR}, #{updateName,jdbcType=VARCHAR},
  39. #{dateUpdateTime,jdbcType=TIMESTAMP}, #{channelType,jdbcType=INTEGER})
  40. </insert>
  41. <insert id="insertSelective" parameterType="com.goafanti.common.model.UserMid">
  42. insert into user_mid
  43. <trim prefix="(" suffix=")" suffixOverrides=",">
  44. <if test="id != null">
  45. id,
  46. </if>
  47. <if test="uid != null">
  48. `uid`,
  49. </if>
  50. <if test="aid != null">
  51. aid,
  52. </if>
  53. <if test="lastFollowTime != null">
  54. last_follow_time,
  55. </if>
  56. <if test="lastSignTime != null">
  57. last_sign_time,
  58. </if>
  59. <if test="createTime != null">
  60. create_time,
  61. </if>
  62. <if test="bigCustomer != null">
  63. big_customer,
  64. </if>
  65. <if test="updateAid != null">
  66. update_aid,
  67. </if>
  68. <if test="updateName != null">
  69. update_name,
  70. </if>
  71. <if test="dateUpdateTime != null">
  72. date_update_time,
  73. </if>
  74. <if test="channelType != null">
  75. channel_type,
  76. </if>
  77. </trim>
  78. <trim prefix="values (" suffix=")" suffixOverrides=",">
  79. <if test="id != null">
  80. #{id,jdbcType=INTEGER},
  81. </if>
  82. <if test="uid != null">
  83. #{uid,jdbcType=VARCHAR},
  84. </if>
  85. <if test="aid != null">
  86. #{aid,jdbcType=VARCHAR},
  87. </if>
  88. <if test="lastFollowTime != null">
  89. #{lastFollowTime,jdbcType=TIMESTAMP},
  90. </if>
  91. <if test="lastSignTime != null">
  92. #{lastSignTime,jdbcType=TIMESTAMP},
  93. </if>
  94. <if test="createTime != null">
  95. #{createTime,jdbcType=TIMESTAMP},
  96. </if>
  97. <if test="bigCustomer != null">
  98. #{bigCustomer,jdbcType=INTEGER},
  99. </if>
  100. <if test="updateAid != null">
  101. #{updateAid,jdbcType=VARCHAR},
  102. </if>
  103. <if test="updateName != null">
  104. #{updateName,jdbcType=VARCHAR},
  105. </if>
  106. <if test="dateUpdateTime != null">
  107. #{dateUpdateTime,jdbcType=TIMESTAMP},
  108. </if>
  109. <if test="channelType != null">
  110. #{channelType,jdbcType=INTEGER},
  111. </if>
  112. </trim>
  113. </insert>
  114. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserMid">
  115. update user_mid
  116. <set>
  117. <if test="uid != null">
  118. `uid` = #{uid,jdbcType=VARCHAR},
  119. </if>
  120. <if test="aid != null">
  121. aid = #{aid,jdbcType=VARCHAR},
  122. </if>
  123. <if test="lastFollowTime != null">
  124. last_follow_time = #{lastFollowTime,jdbcType=TIMESTAMP},
  125. </if>
  126. <if test="lastSignTime != null">
  127. last_sign_time = #{lastSignTime,jdbcType=TIMESTAMP},
  128. </if>
  129. <if test="createTime != null">
  130. create_time = #{createTime,jdbcType=TIMESTAMP},
  131. </if>
  132. <if test="bigCustomer != null">
  133. big_customer = #{bigCustomer,jdbcType=INTEGER},
  134. </if>
  135. <if test="updateAid != null">
  136. update_aid = #{updateAid,jdbcType=VARCHAR},
  137. </if>
  138. <if test="updateName != null">
  139. update_name = #{updateName,jdbcType=VARCHAR},
  140. </if>
  141. <if test="dateUpdateTime != null">
  142. date_update_time = #{dateUpdateTime,jdbcType=TIMESTAMP},
  143. </if>
  144. <if test="channelType != null">
  145. channel_type = #{channelType,jdbcType=INTEGER},
  146. </if>
  147. </set>
  148. where id = #{id,jdbcType=INTEGER}
  149. </update>
  150. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserMid">
  151. update user_mid
  152. set `uid` = #{uid,jdbcType=VARCHAR},
  153. aid = #{aid,jdbcType=VARCHAR},
  154. last_follow_time = #{lastFollowTime,jdbcType=TIMESTAMP},
  155. last_sign_time = #{lastSignTime,jdbcType=TIMESTAMP},
  156. create_time = #{createTime,jdbcType=TIMESTAMP},
  157. big_customer = #{bigCustomer,jdbcType=INTEGER},
  158. update_aid = #{updateAid,jdbcType=VARCHAR},
  159. update_name = #{updateName,jdbcType=VARCHAR},
  160. date_update_time = #{dateUpdateTime,jdbcType=TIMESTAMP},
  161. channel_type = #{channelType,jdbcType=INTEGER}
  162. where id = #{id,jdbcType=INTEGER}
  163. </update>
  164. <update id="updateByUid" parameterType="com.goafanti.common.model.UserMid">
  165. update user_mid
  166. <set>
  167. <if test="aid != null">
  168. aid = #{aid,jdbcType=VARCHAR},
  169. </if>
  170. <if test="lastFollowTime != null">
  171. last_follow_time = #{lastFollowTime,jdbcType=TIMESTAMP},
  172. </if>
  173. <if test="lastSignTime != null">
  174. last_sign_time = #{lastSignTime,jdbcType=TIMESTAMP},
  175. </if>
  176. <if test="createTime != null">
  177. create_time = #{createTime,jdbcType=TIMESTAMP},
  178. </if>
  179. <if test="bigCustomer != null">
  180. big_customer = #{bigCustomer,jdbcType=INTEGER},
  181. </if>
  182. <if test="updateAid != null">
  183. update_aid = #{updateAid,jdbcType=VARCHAR},
  184. </if>
  185. <if test="updateName != null">
  186. update_name = #{updateName,jdbcType=VARCHAR},
  187. </if>
  188. <if test="dateUpdateTime != null">
  189. date_update_time = #{dateUpdateTime,jdbcType=TIMESTAMP},
  190. </if>
  191. <if test="channelType != null">
  192. channel_type = #{channelType,jdbcType=INTEGER},
  193. </if>
  194. </set>
  195. where `uid` = #{uid,jdbcType=VARCHAR}
  196. </update>
  197. <update id="updateListByUid" parameterType="com.goafanti.common.model.UserMid">
  198. update user_mid
  199. <set>
  200. <if test="aid != null">
  201. aid = #{aid,jdbcType=VARCHAR},
  202. </if>
  203. <if test="updateFollow ==1">
  204. last_follow_time = null,
  205. </if>
  206. <if test="lastSignTime != null">
  207. last_sign_time = #{lastSignTime,jdbcType=TIMESTAMP},
  208. </if>
  209. <if test="createTime != null">
  210. create_time = #{createTime,jdbcType=TIMESTAMP},
  211. </if>
  212. <if test="bigCustomer != null">
  213. big_customer = #{bigCustomer,jdbcType=INTEGER},
  214. </if>
  215. <if test="updateAid != null">
  216. update_aid = #{updateAid,jdbcType=VARCHAR},
  217. </if>
  218. <if test="updateName != null">
  219. update_name = #{updateName,jdbcType=VARCHAR},
  220. </if>
  221. <if test="dateUpdateTime != null">
  222. date_update_time = #{dateUpdateTime,jdbcType=TIMESTAMP},
  223. </if>
  224. </set>
  225. where `uid` in
  226. <foreach item="item" collection="list" separator="," open="(" close=")" index="">
  227. #{item}
  228. </foreach>
  229. </update>
  230. </mapper>