UserTransferLogMapper.xml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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.UserTransferLogMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserTransferLog">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Fri Apr 23 09:38:20 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="pid" jdbcType="VARCHAR" property="pid" />
  14. <result column="take_aid" jdbcType="VARCHAR" property="takeAid" />
  15. <result column="type" jdbcType="INTEGER" property="type" />
  16. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  17. <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  18. </resultMap>
  19. <sql id="Base_Column_List">
  20. <!--
  21. WARNING - @mbg.generated
  22. This element is automatically generated by MyBatis Generator, do not modify.
  23. This element was generated on Fri Apr 23 09:38:20 CST 2021.
  24. -->
  25. id, `uid`, aid, pid, take_aid, `type`, create_time, remarks
  26. </sql>
  27. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  28. <!--
  29. WARNING - @mbg.generated
  30. This element is automatically generated by MyBatis Generator, do not modify.
  31. This element was generated on Fri Apr 23 09:38:20 CST 2021.
  32. -->
  33. select
  34. <include refid="Base_Column_List" />
  35. from user_transfer_log
  36. where id = #{id,jdbcType=INTEGER}
  37. </select>
  38. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  39. <!--
  40. WARNING - @mbg.generated
  41. This element is automatically generated by MyBatis Generator, do not modify.
  42. This element was generated on Fri Apr 23 09:38:20 CST 2021.
  43. -->
  44. delete from user_transfer_log
  45. where id = #{id,jdbcType=INTEGER}
  46. </delete>
  47. <insert id="insert" parameterType="com.goafanti.common.model.UserTransferLog">
  48. <!--
  49. WARNING - @mbg.generated
  50. This element is automatically generated by MyBatis Generator, do not modify.
  51. This element was generated on Fri Apr 23 09:38:20 CST 2021.
  52. -->
  53. insert into user_transfer_log (id, `uid`, aid,
  54. pid, take_aid, `type`,
  55. create_time, remarks)
  56. values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
  57. #{pid,jdbcType=VARCHAR}, #{takeAid,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
  58. #{createTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR})
  59. </insert>
  60. <insert id="insertSelective" parameterType="com.goafanti.common.model.UserTransferLog">
  61. <!--
  62. WARNING - @mbg.generated
  63. This element is automatically generated by MyBatis Generator, do not modify.
  64. This element was generated on Fri Apr 23 09:38:20 CST 2021.
  65. -->
  66. insert into user_transfer_log
  67. <trim prefix="(" suffix=")" suffixOverrides=",">
  68. <if test="id != null">
  69. id,
  70. </if>
  71. <if test="uid != null">
  72. `uid`,
  73. </if>
  74. <if test="aid != null">
  75. aid,
  76. </if>
  77. <if test="pid != null">
  78. pid,
  79. </if>
  80. <if test="takeAid != null">
  81. take_aid,
  82. </if>
  83. <if test="type != null">
  84. `type`,
  85. </if>
  86. <if test="createTime != null">
  87. create_time,
  88. </if>
  89. <if test="remarks != null">
  90. remarks,
  91. </if>
  92. </trim>
  93. <trim prefix="values (" suffix=")" suffixOverrides=",">
  94. <if test="id != null">
  95. #{id,jdbcType=INTEGER},
  96. </if>
  97. <if test="uid != null">
  98. #{uid,jdbcType=VARCHAR},
  99. </if>
  100. <if test="aid != null">
  101. #{aid,jdbcType=VARCHAR},
  102. </if>
  103. <if test="pid != null">
  104. #{pid,jdbcType=VARCHAR},
  105. </if>
  106. <if test="takeAid != null">
  107. #{takeAid,jdbcType=VARCHAR},
  108. </if>
  109. <if test="type != null">
  110. #{type,jdbcType=INTEGER},
  111. </if>
  112. <if test="createTime != null">
  113. #{createTime,jdbcType=TIMESTAMP},
  114. </if>
  115. <if test="remarks != null">
  116. #{remarks,jdbcType=VARCHAR},
  117. </if>
  118. </trim>
  119. </insert>
  120. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserTransferLog">
  121. <!--
  122. WARNING - @mbg.generated
  123. This element is automatically generated by MyBatis Generator, do not modify.
  124. This element was generated on Fri Apr 23 09:38:20 CST 2021.
  125. -->
  126. update user_transfer_log
  127. <set>
  128. <if test="uid != null">
  129. `uid` = #{uid,jdbcType=VARCHAR},
  130. </if>
  131. <if test="aid != null">
  132. aid = #{aid,jdbcType=VARCHAR},
  133. </if>
  134. <if test="pid != null">
  135. pid = #{pid,jdbcType=VARCHAR},
  136. </if>
  137. <if test="takeAid != null">
  138. take_aid = #{takeAid,jdbcType=VARCHAR},
  139. </if>
  140. <if test="type != null">
  141. `type` = #{type,jdbcType=INTEGER},
  142. </if>
  143. <if test="createTime != null">
  144. create_time = #{createTime,jdbcType=TIMESTAMP},
  145. </if>
  146. <if test="remarks != null">
  147. remarks = #{remarks,jdbcType=VARCHAR},
  148. </if>
  149. </set>
  150. where id = #{id,jdbcType=INTEGER}
  151. </update>
  152. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserTransferLog">
  153. <!--
  154. WARNING - @mbg.generated
  155. This element is automatically generated by MyBatis Generator, do not modify.
  156. This element was generated on Fri Apr 23 09:38:20 CST 2021.
  157. -->
  158. update user_transfer_log
  159. set `uid` = #{uid,jdbcType=VARCHAR},
  160. aid = #{aid,jdbcType=VARCHAR},
  161. pid = #{pid,jdbcType=VARCHAR},
  162. take_aid = #{takeAid,jdbcType=VARCHAR},
  163. `type` = #{type,jdbcType=INTEGER},
  164. create_time = #{createTime,jdbcType=TIMESTAMP},
  165. remarks = #{remarks,jdbcType=VARCHAR}
  166. where id = #{id,jdbcType=INTEGER}
  167. </update>
  168. <select id="selectByUidGetList" resultType="com.goafanti.customer.bo.transferListBo">
  169. select a.id,a.type,b.nickname userName,c.name usedAName,d.name newAName,e.bname Pname,
  170. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createDate,remarks
  171. from user_transfer_log a left join user b on a.uid=b.id
  172. left join admin c on a.aid=c.id left join admin d on a.take_aid=d.id
  173. left join business_project e on a.pid=e.id
  174. where uid= #{uid}
  175. order by a.id
  176. </select>
  177. <insert id="insertList">
  178. insert into user_transfer_log ( uid, aid,
  179. pid, take_aid, type, remarks,
  180. create_time)
  181. values
  182. <foreach collection="list" index="" item="item" separator=",">
  183. ( #{item.uid,jdbcType=VARCHAR}, #{item.aid,jdbcType=VARCHAR},
  184. #{item.pid,jdbcType=VARCHAR}, #{item.takeAid,jdbcType=VARCHAR}, #{item.type,jdbcType=INTEGER},
  185. #{item.remarks},#{item.createTime,jdbcType=TIMESTAMP})
  186. </foreach>
  187. </insert>
  188. <insert id="insertBatch">
  189. insert into user_transfer_log ( uid, aid,
  190. type,
  191. create_time)
  192. values
  193. <foreach collection="list" index="" item="item" separator=",">
  194. ( #{item.uid,jdbcType=VARCHAR}, #{item.aid,jdbcType=VARCHAR},
  195. 8,
  196. #{item.createTime,jdbcType=TIMESTAMP})
  197. </foreach>
  198. </insert>
  199. <insert id="insertUserLog">
  200. INSERT INTO user_transfer_log (uid, aid, take_aid, `type`, create_time)
  201. select id,aid, #{transferId},13,#{date} from user where share_type =0 and aid = #{aid}
  202. </insert>
  203. <insert id="insertUserLockLog">
  204. INSERT INTO user_transfer_log (uid, aid, take_aid,pid, `type`, create_time)
  205. select id,aid,#{transferId},business_project_id ,14,#{date}
  206. from user_lock_release where `type` =1 and aid =#{aid}
  207. </insert>
  208. </mapper>