UserServiceMapper.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  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.UserServiceMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.UserService">
  5. <!--
  6. WARNING - @mbg.generated
  7. This element is automatically generated by MyBatis Generator, do not modify.
  8. This element was generated on Tue May 18 15:33:59 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="add_wechat" jdbcType="INTEGER" property="addWechat" />
  14. <result column="wechat" jdbcType="VARCHAR" property="wechat" />
  15. <result column="renewal" jdbcType="INTEGER" property="renewal" />
  16. <result column="renewal_time" jdbcType="TIMESTAMP" property="renewalTime" />
  17. <result column="sign_project" jdbcType="VARCHAR" property="signProject" />
  18. <result column="sign_project_id" jdbcType="VARCHAR" property="signProjectId" />
  19. <result column="new_time" jdbcType="TIMESTAMP" property="newTime" />
  20. <result column="remarks" jdbcType="VARCHAR" property="remarks" />
  21. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  22. </resultMap>
  23. <sql id="Base_Column_List">
  24. <!--
  25. WARNING - @mbg.generated
  26. This element is automatically generated by MyBatis Generator, do not modify.
  27. This element was generated on Tue May 18 15:33:59 CST 2021.
  28. -->
  29. id, `uid`, aid, add_wechat, wechat, renewal, renewal_time, sign_project, sign_project_id,
  30. new_time, remarks, create_time
  31. </sql>
  32. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  33. <!--
  34. WARNING - @mbg.generated
  35. This element is automatically generated by MyBatis Generator, do not modify.
  36. This element was generated on Tue May 18 15:33:59 CST 2021.
  37. -->
  38. select
  39. <include refid="Base_Column_List" />
  40. from user_service
  41. where id = #{id,jdbcType=INTEGER}
  42. </select>
  43. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  44. <!--
  45. WARNING - @mbg.generated
  46. This element is automatically generated by MyBatis Generator, do not modify.
  47. This element was generated on Tue May 18 15:33:59 CST 2021.
  48. -->
  49. delete from user_service
  50. where id = #{id,jdbcType=INTEGER}
  51. </delete>
  52. <insert id="insert" parameterType="com.goafanti.common.model.UserService">
  53. <!--
  54. WARNING - @mbg.generated
  55. This element is automatically generated by MyBatis Generator, do not modify.
  56. This element was generated on Tue May 18 15:33:59 CST 2021.
  57. -->
  58. insert into user_service (id, `uid`, aid,
  59. add_wechat, wechat, renewal,
  60. renewal_time, sign_project, sign_project_id,
  61. new_time, remarks, create_time
  62. )
  63. values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=VARCHAR}, #{aid,jdbcType=VARCHAR},
  64. #{addWechat,jdbcType=INTEGER}, #{wechat,jdbcType=VARCHAR}, #{renewal,jdbcType=INTEGER},
  65. #{renewalTime,jdbcType=TIMESTAMP}, #{signProject,jdbcType=VARCHAR}, #{signProjectId,jdbcType=VARCHAR},
  66. #{newTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
  67. )
  68. </insert>
  69. <insert id="insertSelective" parameterType="com.goafanti.common.model.UserService">
  70. <!--
  71. WARNING - @mbg.generated
  72. This element is automatically generated by MyBatis Generator, do not modify.
  73. This element was generated on Tue May 18 15:33:59 CST 2021.
  74. -->
  75. insert into user_service
  76. <trim prefix="(" suffix=")" suffixOverrides=",">
  77. <if test="id != null">
  78. id,
  79. </if>
  80. <if test="uid != null">
  81. `uid`,
  82. </if>
  83. <if test="aid != null">
  84. aid,
  85. </if>
  86. <if test="addWechat != null">
  87. add_wechat,
  88. </if>
  89. <if test="wechat != null">
  90. wechat,
  91. </if>
  92. <if test="renewal != null">
  93. renewal,
  94. </if>
  95. <if test="renewalTime != null">
  96. renewal_time,
  97. </if>
  98. <if test="signProject != null">
  99. sign_project,
  100. </if>
  101. <if test="signProjectId != null">
  102. sign_project_id,
  103. </if>
  104. <if test="newTime != null">
  105. new_time,
  106. </if>
  107. <if test="remarks != null">
  108. remarks,
  109. </if>
  110. <if test="createTime != null">
  111. create_time,
  112. </if>
  113. </trim>
  114. <trim prefix="values (" suffix=")" suffixOverrides=",">
  115. <if test="id != null">
  116. #{id,jdbcType=INTEGER},
  117. </if>
  118. <if test="uid != null">
  119. #{uid,jdbcType=VARCHAR},
  120. </if>
  121. <if test="aid != null">
  122. #{aid,jdbcType=VARCHAR},
  123. </if>
  124. <if test="addWechat != null">
  125. #{addWechat,jdbcType=INTEGER},
  126. </if>
  127. <if test="wechat != null">
  128. #{wechat,jdbcType=VARCHAR},
  129. </if>
  130. <if test="renewal != null">
  131. #{renewal,jdbcType=INTEGER},
  132. </if>
  133. <if test="renewalTime != null">
  134. #{renewalTime,jdbcType=TIMESTAMP},
  135. </if>
  136. <if test="signProject != null">
  137. #{signProject,jdbcType=VARCHAR},
  138. </if>
  139. <if test="signProjectId != null">
  140. #{signProjectId,jdbcType=VARCHAR},
  141. </if>
  142. <if test="newTime != null">
  143. #{newTime,jdbcType=TIMESTAMP},
  144. </if>
  145. <if test="remarks != null">
  146. #{remarks,jdbcType=VARCHAR},
  147. </if>
  148. <if test="createTime != null">
  149. #{createTime,jdbcType=TIMESTAMP},
  150. </if>
  151. </trim>
  152. </insert>
  153. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.UserService">
  154. <!--
  155. WARNING - @mbg.generated
  156. This element is automatically generated by MyBatis Generator, do not modify.
  157. This element was generated on Tue May 18 15:33:59 CST 2021.
  158. -->
  159. update user_service
  160. <set>
  161. <if test="uid != null">
  162. `uid` = #{uid,jdbcType=VARCHAR},
  163. </if>
  164. <if test="aid != null">
  165. aid = #{aid,jdbcType=VARCHAR},
  166. </if>
  167. <if test="addWechat != null">
  168. add_wechat = #{addWechat,jdbcType=INTEGER},
  169. </if>
  170. <if test="wechat != null">
  171. wechat = #{wechat,jdbcType=VARCHAR},
  172. </if>
  173. <if test="renewal != null">
  174. renewal = #{renewal,jdbcType=INTEGER},
  175. </if>
  176. <if test="renewalTime != null">
  177. renewal_time = #{renewalTime,jdbcType=TIMESTAMP},
  178. </if>
  179. <if test="signProject != null">
  180. sign_project = #{signProject,jdbcType=VARCHAR},
  181. </if>
  182. <if test="signProjectId != null">
  183. sign_project_id = #{signProjectId,jdbcType=VARCHAR},
  184. </if>
  185. <if test="newTime != null">
  186. new_time = #{newTime,jdbcType=TIMESTAMP},
  187. </if>
  188. <if test="remarks != null">
  189. remarks = #{remarks,jdbcType=VARCHAR},
  190. </if>
  191. <if test="createTime != null">
  192. create_time = #{createTime,jdbcType=TIMESTAMP},
  193. </if>
  194. </set>
  195. where id = #{id,jdbcType=INTEGER}
  196. </update>
  197. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.UserService">
  198. <!--
  199. WARNING - @mbg.generated
  200. This element is automatically generated by MyBatis Generator, do not modify.
  201. This element was generated on Tue May 18 15:33:59 CST 2021.
  202. -->
  203. update user_service
  204. set `uid` = #{uid,jdbcType=VARCHAR},
  205. aid = #{aid,jdbcType=VARCHAR},
  206. add_wechat = #{addWechat,jdbcType=INTEGER},
  207. wechat = #{wechat,jdbcType=VARCHAR},
  208. renewal = #{renewal,jdbcType=INTEGER},
  209. renewal_time = #{renewalTime,jdbcType=TIMESTAMP},
  210. sign_project = #{signProject,jdbcType=VARCHAR},
  211. sign_project_id = #{signProjectId,jdbcType=VARCHAR},
  212. new_time = #{newTime,jdbcType=TIMESTAMP},
  213. remarks = #{remarks,jdbcType=VARCHAR},
  214. create_time = #{createTime,jdbcType=TIMESTAMP}
  215. where id = #{id,jdbcType=INTEGER}
  216. </update>
  217. <select id="selectByUid" resultType="java.lang.Integer">
  218. select id from user_service where uid= #{uid}
  219. </select>
  220. <resultMap id="userService" type="com.goafanti.user.bo.OutOrderUserService">
  221. <result property="orderNo" column="orderNo"/>
  222. <result property="contractNo" column="contractNo"/>
  223. <result property="depName" column="depName"/>
  224. <result property="userName" column="userName"/>
  225. <result property="uid" column="uid"/>
  226. <result property="signTimes" column="signTimes"/>
  227. <result property="orderTimes" column="orderTimes"/>
  228. <result property="newTimes" column="newTimes"/>
  229. <result property="adminName" column="adminName"/>
  230. <result property="addWechat" column="addWechat"/>
  231. <result property="wechat" column="wechat"/>
  232. <result property="deleteSign" column="deleteSign"/>
  233. <result property="renewal" column="renewal"/>
  234. <result property="signProject" column="signProject"/>
  235. <result property="remarks" column="remarks"/>
  236. <result property="renewalTimes" column="renewalTimes"/>
  237. <association property="list" column="orderNo" javaType="java.util.ArrayList" select="getTask"/>
  238. </resultMap>
  239. <select id="getTask" resultType="com.goafanti.user.bo.OrderProject">
  240. select id,commodity_name commodityName ,declaration_batch declarationBatch ,
  241. receiver_name receiverName ,certificate_number certificateNumber
  242. from t_order_task where split_status in (0,1) and order_no = #{orderNo}
  243. </select>
  244. <select id="OrderUseServiceList" resultMap="userService">
  245. select a.order_no orderNo,a.contract_no contractNo,b.dep_name depName ,a.buyer_id uid,a.create_time ,b.buyer_name userName,c.new_time ,
  246. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as orderTimes, date_format(c.new_time,'%Y-%m-%d %H:%i:%S') as newTimes,
  247. date_format(c.renewal_time,'%Y-%m-%d') as renewalTimes, date_format(a.sign_time,'%Y-%m-%d') as signTimes,a.delete_sign deleteSign ,
  248. d.name adminName,c.add_wechat addWechat,c.wechat ,c.renewal ,c.renewal_time ,c.sign_project signProject ,c.remarks
  249. from t_order_new a
  250. left join t_order_mid b on a.order_no =b.order_no left join user_service c on a.buyer_id =c.uid
  251. left join admin d on c.aid =d.id
  252. where a.delete_sign in(0,2,3)
  253. <if test="userName != null">
  254. and b.buyer_name like CONCAT('%', #{userName},'%')
  255. </if>
  256. <if test="depId != null">
  257. and a.order_dep = #{depId}
  258. </if>
  259. <if test="addWechat != null">
  260. and c.add_wechat = #{addWechat}
  261. </if>
  262. <if test="renewal != null">
  263. and c.renewal = #{renewal}
  264. </if>
  265. <if test="startFollowTimes != null">
  266. and c.new_time BETWEEN #{startFollowTimes} and #{endFollowTimes}
  267. </if>
  268. <if test="startSignTimes != null">
  269. and a.create_time BETWEEN #{startSignTimes} and #{endSignTimes}
  270. </if>
  271. order by c.new_time,a.create_time
  272. <if test="page_sql != null">
  273. ${page_sql}
  274. </if>
  275. </select>
  276. <select id="OrderUseServiceCount" resultType="java.lang.Integer">
  277. select count(*)
  278. from t_order_new a
  279. left join t_order_mid b on a.order_no =b.order_no left join user_service c on a.buyer_id =c.uid
  280. left join admin d on c.aid =d.id
  281. where a.delete_sign in(0,2,3)
  282. <if test="userName != null">
  283. and b.buyer_name like CONCAT('%', #{userName},'%')
  284. </if>
  285. <if test="depId != null">
  286. and a.order_dep = #{depId}
  287. </if>
  288. <if test="addWechat != null">
  289. and c.add_wechat = #{addWechat}
  290. </if>
  291. <if test="renewal != null">
  292. and c.renewal = #{renewal}
  293. </if>
  294. <if test="startFollowTimes != null">
  295. and c.new_time BETWEEN #{startFollowTimes} and #{endFollowTimes}
  296. </if>
  297. <if test="startSignTimes != null">
  298. and a.create_time BETWEEN #{startSignTimes} and #{endSignTimes}
  299. </if>
  300. </select>
  301. </mapper>