OrderProcessRecordDao.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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.kmall.admin.dao.OrderProcessRecordDao">
  4. <resultMap type="com.kmall.admin.entity.OrderProcessRecordEntity" id="orderProcessRecordMap">
  5. <result property="id" column="id"/>
  6. <result property="orderSn" column="order_sn"/>
  7. <result property="userId" column="user_id"/>
  8. <result property="orderBizType" column="order_biz_type"/>
  9. <result property="addOrderStartTime" column="add_order_start_time"/>
  10. <result property="addOrderSuccTime" column="add_order_succ_time"/>
  11. <result property="isAddOrderSend" column="is_add_order_send"/>
  12. <result property="payStartTime" column="pay_start_time"/>
  13. <result property="paySuccTime" column="pay_succ_time"/>
  14. <result property="paymentStartTime" column="payment_start_time"/>
  15. <result property="paymentSuccTime" column="payment_succ_time"/>
  16. <result property="isPaymentSend" column="is_payment_send"/>
  17. <result property="eleOrderStartTime" column="ele_order_start_time"/>
  18. <result property="eleOrderSuccTime" column="ele_order_succ_time"/>
  19. <result property="isEleOrderSend" column="is_ele_order_send"/>
  20. <result property="waybillStartTime" column="waybill_start_time"/>
  21. <result property="waybillSuccTime" column="waybill_succ_time"/>
  22. <result property="logisticsNo" column="logistics_no"/>
  23. <result property="customsStartTime" column="customs_start_time"/>
  24. <result property="customsSuccTime" column="customs_succ_time"/>
  25. <result property="invtNo" column="invt_no"/>
  26. <result property="isCustomsSend" column="is_customs_send"/>
  27. <result property="shipmentStartTime" column="shipment_start_time"/>
  28. <result property="shipmentSuccTime" column="shipment_succ_time"/>
  29. <result property="processContent" column="process_content"/>
  30. <result property="tstm" column="tstm"/>
  31. <result property="payTransactionId" column="ali_trade_no"/>
  32. </resultMap>
  33. <select id="queryObject" resultType="com.kmall.admin.entity.OrderProcessRecordEntity">
  34. select
  35. r.`id`,
  36. r.`order_sn`,
  37. r.`user_id`,
  38. r.`order_biz_type`,
  39. `add_order_start_time`,
  40. `add_order_succ_time`,
  41. `is_add_order_send`,
  42. `pay_start_time`,
  43. `pay_succ_time`,
  44. `payment_start_time`,
  45. `payment_succ_time`,
  46. `is_payment_send`,
  47. `ele_order_start_time`,
  48. `ele_order_succ_time`,
  49. `is_ele_order_send`,
  50. `waybill_start_time`,
  51. `waybill_succ_time`,
  52. `logistics_no`,
  53. `customs_start_time`,
  54. `customs_succ_time`,
  55. `invt_no`,
  56. `is_customs_send`,
  57. `shipment_start_time`,
  58. `shipment_succ_time`,
  59. `process_content`,
  60. `customs_send_sms_status`,
  61. r.`tstm`,
  62. o.ali_trade_no
  63. from mall_order_process_record r inner join mall_order o on r.order_sn = o.order_sn
  64. where id = #{id}
  65. </select>
  66. <select id="queryObjectByOrderSn" resultType="com.kmall.admin.entity.OrderProcessRecordEntity">
  67. select
  68. r.`id`,
  69. r.`order_sn`,
  70. r.`user_id`,
  71. r.`order_biz_type`,
  72. `add_order_start_time`,
  73. `add_order_succ_time`,
  74. `is_add_order_send`,
  75. `pay_start_time`,
  76. `pay_succ_time`,
  77. `payment_start_time`,
  78. `payment_succ_time`,
  79. `is_payment_send`,
  80. `ele_order_start_time`,
  81. `ele_order_succ_time`,
  82. `is_ele_order_send`,
  83. `waybill_start_time`,
  84. `waybill_succ_time`,
  85. `logistics_no`,
  86. `customs_start_time`,
  87. `customs_succ_time`,
  88. `invt_no`,
  89. `is_customs_send`,
  90. `shipment_start_time`,
  91. `shipment_succ_time`,
  92. `process_content`,
  93. `customs_send_sms_status`,
  94. r.`tstm`,
  95. o.ali_trade_no as pay_transaction_id
  96. from mall_order_process_record r inner join mall_order o on r.order_sn = o.order_sn
  97. where r.order_sn = #{orderSn}
  98. </select>
  99. <select id="queryList" resultType="com.kmall.admin.entity.OrderProcessRecordEntity">
  100. select
  101. `id`,
  102. `order_sn`,
  103. `user_id`,
  104. `order_biz_type`,
  105. `add_order_start_time`,
  106. `add_order_succ_time`,
  107. `is_add_order_send`,
  108. `pay_start_time`,
  109. `pay_succ_time`,
  110. `payment_start_time`,
  111. `payment_succ_time`,
  112. `is_payment_send`,
  113. `ele_order_start_time`,
  114. `ele_order_succ_time`,
  115. `is_ele_order_send`,
  116. `waybill_start_time`,
  117. `waybill_succ_time`,
  118. `logistics_no`,
  119. `customs_start_time`,
  120. `customs_succ_time`,
  121. `invt_no`,
  122. `is_customs_send`,
  123. `shipment_start_time`,
  124. `shipment_succ_time`,
  125. `process_content`,
  126. `customs_send_sms_status`,
  127. `tstm`
  128. from mall_order_process_record
  129. WHERE 1=1
  130. <if test="name != null and name.trim() != ''">
  131. AND name LIKE concat('%',#{name},'%')
  132. </if>
  133. <choose>
  134. <when test="sidx != null and sidx.trim() != ''">
  135. order by ${sidx} ${order}
  136. </when>
  137. <otherwise>
  138. order by id desc
  139. </otherwise>
  140. </choose>
  141. <if test="offset != null and limit != null">
  142. limit #{offset}, #{limit}
  143. </if>
  144. </select>
  145. <select id="queryTotal" resultType="int">
  146. select count(*) from mall_order_process_record
  147. WHERE 1=1
  148. <if test="name != null and name.trim() != ''">
  149. AND name LIKE concat('%',#{name},'%')
  150. </if>
  151. </select>
  152. <select id="queryListBySendSmsStatus" resultType="com.kmall.admin.entity.OrderProcessRecordEntity">
  153. select
  154. r.`id`,
  155. r.`order_sn`,
  156. r.`user_id`,
  157. r.`order_biz_type`,
  158. `add_order_start_time`,
  159. `add_order_succ_time`,
  160. `is_add_order_send`,
  161. `pay_start_time`,
  162. `pay_succ_time`,
  163. `payment_start_time`,
  164. `payment_succ_time`,
  165. `is_payment_send`,
  166. `ele_order_start_time`,
  167. `ele_order_succ_time`,
  168. `is_ele_order_send`,
  169. `waybill_start_time`,
  170. `waybill_succ_time`,
  171. `logistics_no`,
  172. `customs_start_time`,
  173. `customs_succ_time`,
  174. `invt_no`,
  175. `is_customs_send`,
  176. `shipment_start_time`,
  177. `shipment_succ_time`,
  178. `process_content`,
  179. r.`tstm`,
  180. o.ali_trade_no as pay_transaction_id,
  181. o.pay_mobile as payMobile,
  182. r.customs_send_sms_status as customsSendSmsStatus
  183. from mall_order_process_record r inner join mall_order o on r.order_sn = o.order_sn
  184. where r.is_customs_send='1' and r.customs_send_sms_status=#{customsSendSmsStatus}
  185. </select>
  186. <insert id="save" parameterType="com.kmall.admin.entity.OrderProcessRecordEntity" useGeneratedKeys="true" keyProperty="id">
  187. insert into mall_order_process_record(
  188. `order_sn`,
  189. `user_id`,
  190. `order_biz_type`,
  191. `add_order_start_time`,
  192. `add_order_succ_time`,
  193. `is_add_order_send`,
  194. `pay_start_time`,
  195. `pay_succ_time`,
  196. `payment_start_time`,
  197. `payment_succ_time`,
  198. `is_payment_send`,
  199. `ele_order_start_time`,
  200. `ele_order_succ_time`,
  201. `is_ele_order_send`,
  202. `waybill_start_time`,
  203. `waybill_succ_time`,
  204. `logistics_no`,
  205. `customs_start_time`,
  206. `customs_succ_time`,
  207. `invt_no`,
  208. `is_customs_send`,
  209. `shipment_start_time`,
  210. `shipment_succ_time`,
  211. `process_content`,
  212. `customs_send_sms_status`,
  213. `tstm`)
  214. values(
  215. #{orderSn},
  216. #{userId},
  217. #{orderBizType},
  218. #{addOrderStartTime},
  219. #{addOrderSuccTime},
  220. #{isAddOrderSend},
  221. #{payStartTime},
  222. #{paySuccTime},
  223. #{paymentStartTime},
  224. #{paymentSuccTime},
  225. #{isPaymentSend},
  226. #{eleOrderStartTime},
  227. #{eleOrderSuccTime},
  228. #{isEleOrderSend},
  229. #{waybillStartTime},
  230. #{waybillSuccTime},
  231. #{logisticsNo},
  232. #{customsStartTime},
  233. #{customsSuccTime},
  234. #{invtNo},
  235. #{isCustomsSend},
  236. #{shipmentStartTime},
  237. #{shipmentSuccTime},
  238. #{processContent},
  239. '0',
  240. #{tstm})
  241. </insert>
  242. <update id="update" parameterType="com.kmall.admin.entity.OrderProcessRecordEntity">
  243. update mall_order_process_record
  244. <set>
  245. <if test="orderSn != null">`order_sn` = #{orderSn}, </if>
  246. <if test="userId != null">`user_id` = #{userId}, </if>
  247. <if test="orderBizType != null">`order_biz_type` = #{orderBizType}, </if>
  248. <if test="addOrderStartTime != null">`add_order_start_time` = #{addOrderStartTime}, </if>
  249. <if test="addOrderSuccTime != null">`add_order_succ_time` = #{addOrderSuccTime}, </if>
  250. <if test="isAddOrderSend != null">`is_add_order_send` = #{isAddOrderSend}, </if>
  251. <if test="payStartTime != null">`pay_start_time` = #{payStartTime}, </if>
  252. <if test="paySuccTime != null">`pay_succ_time` = #{paySuccTime}, </if>
  253. <if test="paymentStartTime != null">`payment_start_time` = #{paymentStartTime}, </if>
  254. <if test="paymentSuccTime != null">`payment_succ_time` = #{paymentSuccTime}, </if>
  255. <if test="isPaymentSend != null">`is_payment_send` = #{isPaymentSend}, </if>
  256. <if test="eleOrderStartTime != null">`ele_order_start_time` = #{eleOrderStartTime}, </if>
  257. <if test="eleOrderSuccTime != null">`ele_order_succ_time` = #{eleOrderSuccTime}, </if>
  258. <if test="isEleOrderSend != null">`is_ele_order_send` = #{isEleOrderSend}, </if>
  259. <if test="waybillStartTime != null">`waybill_start_time` = #{waybillStartTime}, </if>
  260. <if test="waybillSuccTime != null">`waybill_succ_time` = #{waybillSuccTime}, </if>
  261. <if test="logisticsNo != null">`logistics_no` = #{logisticsNo}, </if>
  262. <if test="customsStartTime != null">`customs_start_time` = #{customsStartTime}, </if>
  263. <if test="customsSuccTime != null">`customs_succ_time` = #{customsSuccTime}, </if>
  264. <if test="invtNo != null">`invt_no` = #{invtNo}, </if>
  265. <if test="isCustomsSend != null">`is_customs_send` = #{isCustomsSend}, </if>
  266. <if test="shipmentStartTime != null">`shipment_start_time` = #{shipmentStartTime}, </if>
  267. <if test="shipmentSuccTime != null">`shipment_succ_time` = #{shipmentSuccTime}, </if>
  268. <if test="processContent != null">`process_content` = #{processContent}, </if>
  269. <if test="customsSendSmsStatus != null">`customs_send_sms_status` = #{customsSendSmsStatus}, </if>
  270. <if test="tstm != null">`tstm` = #{tstm}</if>
  271. </set>
  272. where id = #{id}
  273. </update>
  274. <delete id="delete">
  275. delete from mall_order_process_record where id = #{value}
  276. </delete>
  277. <delete id="deleteBatch">
  278. delete from mall_order_process_record where id in
  279. <foreach item="id" collection="array" open="(" separator="," close=")">
  280. #{id}
  281. </foreach>
  282. </delete>
  283. <!--批量修改-->
  284. <update id="updateHkNoticeMsg" parameterType="list">
  285. update mall_order_process_record
  286. <trim prefix="set" suffixOverrides=",">
  287. <trim prefix="points_rules_id =case" suffix="end,">
  288. <foreach collection="list" item="item" index="index">
  289. when order_sn=#{item.orderSn}
  290. then
  291. <if test="eleOrderStartTime != null">`ele_order_start_time` = #{item.eleOrderStartTime}, </if>
  292. <if test="eleOrderSuccTime != null">`ele_order_succ_time` = #{item.eleOrderSuccTime}, </if>
  293. <if test="isEleOrderSend != null">`is_ele_order_send` = #{item.isEleOrderSend}, </if>
  294. <if test="waybillStartTime != null">`waybill_start_time` = #{item.waybillStartTime}, </if>
  295. <if test="waybillSuccTime != null">`waybill_succ_time` = #{item.waybillSuccTime}, </if>
  296. <if test="logisticsNo != null">`logistics_no` = #{item.logisticsNo}, </if>
  297. <if test="customsStartTime != null">`customs_start_time` = #{item.customsStartTime}, </if>
  298. <if test="customsSuccTime != null">`customs_succ_time` = #{item.customsSuccTime}, </if>
  299. <if test="invtNo != null">`invt_no` = #{item.invtNo}, </if>
  300. <if test="isCustomsSend != null">`is_customs_send` = #{item.isCustomsSend}, </if>
  301. </foreach>
  302. </trim>
  303. </trim>
  304. where order_sn in
  305. <foreach collection="list" item="item" index="index" separator="," open="(" close=")">
  306. #{item.orderSn}
  307. </foreach>
  308. </update>
  309. <select id="queryHkOrderTotal" parameterType="java.util.List" resultType="java.lang.Integer">
  310. select
  311. count(*)
  312. from mall_order_process_record
  313. where
  314. <if test="list != null">
  315. order_sn in
  316. <foreach collection="list" item="item" open="(" separator="," close=")">
  317. #{item.orderSn}
  318. </foreach>
  319. </if>
  320. </select>
  321. </mapper>