OrderProcessRecordDao.xml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  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. <select id="queryHkOrderTotal" parameterType="java.util.List" resultType="java.lang.Integer">
  284. select
  285. count(*)
  286. from mall_order_process_record
  287. where
  288. <if test="list != null">
  289. order_sn in
  290. <foreach collection="list" item="item" open="(" separator="," close=")">
  291. #{item.orderSn}
  292. </foreach>
  293. </if>
  294. </select>
  295. <update id="updateHkNoticeMsg" parameterType="java.util.List">
  296. update mall_order_process_record
  297. <trim prefix="set" suffixOverrides=",">
  298. <trim prefix="logistics_no =case" suffix="end,">
  299. <foreach collection="list" item="item" index="index">
  300. <if test="item.logisticsNo!=null">
  301. when order_sn=#{item.orderSn}
  302. then #{item.logisticsNo}
  303. </if>
  304. <if test="item.logisticsNo==null">
  305. when order_sn=#{item.orderSn}
  306. then mall_order_process_record.logistics_no
  307. </if>
  308. </foreach>
  309. </trim>
  310. <trim prefix="shipping_code =case" suffix="end,">
  311. <foreach collection="list" item="item" index="index">
  312. <if test="item.shippingCode!=null">
  313. when order_sn=#{item.orderSn}
  314. then #{item.shippingCode}
  315. </if>
  316. <if test="item.shippingCode==null">
  317. when order_sn=#{item.orderSn}
  318. then mall_order_process_record.shipping_code
  319. </if>
  320. </foreach>
  321. </trim>
  322. <trim prefix="shipping_name =case" suffix="end,">
  323. <foreach collection="list" item="item" index="index">
  324. <if test="item.shippingName!=null">
  325. when order_sn=#{item.orderSn}
  326. then #{item.shippingName}
  327. </if>
  328. <if test="item.shippingName==null">
  329. when order_sn=#{item.orderSn}
  330. then mall_order_process_record.shipping_name
  331. </if>
  332. </foreach>
  333. </trim>
  334. <trim prefix="waybill_succ_time =case" suffix="end,">
  335. <foreach collection="list" item="item" index="index">
  336. <if test="item.ewbStartTime!=null">
  337. when order_sn=#{item.orderSn}
  338. then #{item.ewbStartTime}
  339. </if>
  340. <if test="item.ewbStartTime==null">
  341. when order_sn=#{item.orderSn}
  342. then mall_order_process_record.waybill_succ_time
  343. </if>
  344. </foreach>
  345. </trim>
  346. <trim prefix="invt_no =case" suffix="end,">
  347. <foreach collection="list" item="item" index="index">
  348. <if test="item.clearNo!=null">
  349. when order_sn=#{item.orderSn}
  350. then #{item.clearNo}
  351. </if>
  352. <if test="item.clearNo==null">
  353. when order_sn=#{item.orderSn}
  354. then mall_order_process_record.invt_no
  355. </if>
  356. </foreach>
  357. </trim>
  358. <trim prefix="is_customs_send =case" suffix="end,">
  359. <foreach collection="list" item="item" index="index">
  360. <if test="item.clearType!=null">
  361. when order_sn=#{item.orderSn}
  362. then #{item.clearType}
  363. </if>
  364. <if test="item.clearType==null">
  365. when order_sn=#{item.orderSn}
  366. then mall_order_process_record.is_customs_send
  367. </if>
  368. </foreach>
  369. </trim>
  370. <trim prefix="customs_succ_time =case" suffix="end,">
  371. <foreach collection="list" item="item" index="index">
  372. <if test="item.customsSuccTime!=null">
  373. when order_sn=#{item.orderSn}
  374. then #{item.customsSuccTime}
  375. </if>
  376. <if test="item.customsSuccTime==null">
  377. when order_sn=#{item.orderSn}
  378. then mall_order_process_record.customs_succ_time
  379. </if>
  380. </foreach>
  381. </trim>
  382. <trim prefix="customs_msg =case" suffix="end,">
  383. <foreach collection="list" item="item" index="index">
  384. <if test="item.clearMsg!=null">
  385. when order_sn=#{item.orderSn}
  386. then #{item.clearMsg}
  387. </if>
  388. <if test="item.clearMsg==null">
  389. when order_sn=#{item.orderSn}
  390. then mall_order_process_record.customs_msg
  391. </if>
  392. </foreach>
  393. </trim>
  394. </trim>
  395. where order_sn in
  396. <foreach collection="list" item="item" index="index" separator="," open="(" close=")">
  397. #{item.orderSn}
  398. </foreach>
  399. </update>
  400. <!-- <update id="updateHkNoticeMsg" parameterType="java.util.List">-->
  401. <!-- <foreach collection="list" item="item" index="index" open="" close="" separator=";">-->
  402. <!-- update mall_order_process_record-->
  403. <!-- <set>-->
  404. <!-- <if test="item.ewbStartTime != null">`waybill_succ_time` = #{item.ewbStartTime}, </if>-->
  405. <!-- <if test="item.logisticsNo != null">`logistics_no` = #{item.logisticsNo}, </if>-->
  406. <!-- <if test="item.customsSuccTime != null">`customs_succ_time` = #{item.customsSuccTime}, </if>-->
  407. <!-- <if test="item.invtNo != null">`invt_no` = #{item.invtNo}, </if>-->
  408. <!-- <if test="item.clearType != null">`is_customs_send` = #{item.clearType}, </if>-->
  409. <!-- </set>-->
  410. <!-- where order_sn = ${item.orderSn}-->
  411. <!-- </foreach>-->
  412. <!-- </update>-->
  413. <update id="updateHkNoticeMsgMallOrder" parameterType="java.util.List">
  414. update mall_order
  415. <trim prefix="set" suffixOverrides=",">
  416. <trim prefix="shipping_no =case" suffix="end,">
  417. <foreach collection="list" item="item" index="index">
  418. <if test="item.logisticsNo!=null">
  419. when order_sn=#{item.orderSn}
  420. then #{item.logisticsNo}
  421. </if>
  422. <if test="item.logisticsNo==null">
  423. when order_sn=#{item.orderSn}
  424. then mall_order.logistics_no
  425. </if>
  426. </foreach>
  427. </trim>
  428. <trim prefix="shipping_code =case" suffix="end,">
  429. <foreach collection="list" item="item" index="index">
  430. <if test="item.shippingCode!=null">
  431. when order_sn=#{item.orderSn}
  432. then #{item.shippingCode}
  433. </if>
  434. <if test="item.shippingCode==null">
  435. when order_sn=#{item.orderSn}
  436. then mall_order.shipping_code
  437. </if>
  438. </foreach>
  439. </trim>
  440. <trim prefix="shipping_name =case" suffix="end,">
  441. <foreach collection="list" item="item" index="index">
  442. <if test="item.shippingName!=null">
  443. when order_sn=#{item.orderSn}
  444. then #{item.shippingName}
  445. </if>
  446. <if test="item.shippingName==null">
  447. when order_sn=#{item.orderSn}
  448. then mall_order.shipping_name
  449. </if>
  450. </foreach>
  451. </trim>
  452. </trim>
  453. where order_sn in
  454. <foreach collection="list" item="item" index="index" separator="," open="(" close=")">
  455. #{item.orderSn}
  456. </foreach>
  457. </update>
  458. </mapper>