UserServiceMapper.xml 13 KB

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