WxOrderBizMapper.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  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.emato.ccnet.wx.dao.mapper.ccnet.WxOrderMapper" >
  4. <select id="getWxOrderByWxOrderId" resultMap="BaseResultMap" parameterType="java.lang.String" >
  5. select
  6. <include refid="Base_Column_List" />
  7. from wx_order
  8. where wx_order_id = #{wxOrderId,jdbcType=VARCHAR}
  9. </select>
  10. <insert id="insertWxOrderBatch" parameterType="java.util.List" >
  11. insert into wx_order
  12. <trim prefix="(" suffix=")" suffixOverrides="," >
  13. wx_order_sn,
  14. merch_order_id,
  15. order_sn,
  16. wx_order_id,
  17. merch_sn,
  18. merch_name,
  19. plat_sn,
  20. plat_name,
  21. third_party_merch_code,
  22. third_party_merch_name,
  23. place_orderl_time,
  24. auto_send,
  25. buyer_reg_no,
  26. buyer_bill_time,
  27. buyer_id_type,
  28. buyer_id_code,
  29. buyer_name,
  30. buyer_tel,
  31. consignee_id_type,
  32. consignee_id_code,
  33. consignee_name,
  34. consignee_mob,
  35. consignee_tel,
  36. consignee_country_code,
  37. consignee_province_code,
  38. consignee_province,
  39. consignee_city_code,
  40. consignee_city,
  41. consignee_district_code,
  42. consignee_district,
  43. consignee_address,
  44. consignee_zip_code,
  45. payer_name,
  46. payer_id_type,
  47. payer_id_code,
  48. payer_mob,
  49. pay_ent_cus_code,
  50. pay_no,
  51. goods_value,
  52. freight,
  53. discount,
  54. tax_total,
  55. actural_paid,
  56. pay_time,
  57. expr_type,
  58. expr_comp_id,
  59. expr_agreement_type,
  60. decl_expr_fee,
  61. batch_numbers,
  62. decl_post_tax,
  63. shop_id,
  64. extra_tag,
  65. currency_code,
  66. ws_flag,
  67. buyer_pay_check,
  68. wx_order_detail,
  69. clec_order_status,
  70. way_order_status,
  71. project_check_status,
  72. play_order_status,
  73. remark,
  74. creater_sn,
  75. create_time,
  76. moder_sn,
  77. mod_time,
  78. tstm,
  79. ex_field,
  80. ex_field2,
  81. ex_field3,
  82. ex_field4,
  83. ex_field5,
  84. </trim>
  85. VALUES
  86. <foreach collection="list" item="item" index="index" separator=",">
  87. <trim prefix="(" suffix=")" suffixOverrides="," >
  88. #{item.wxOrderSn,jdbcType=VARCHAR},
  89. #{item.merchOrderId,jdbcType=VARCHAR},
  90. #{item.orderSn,jdbcType=VARCHAR},
  91. #{item.wxOrderId,jdbcType=VARCHAR},
  92. #{item.merchSn,jdbcType=VARCHAR},
  93. #{item.merchName,jdbcType=VARCHAR},
  94. #{item.platSn,jdbcType=VARCHAR},
  95. #{item.platName,jdbcType=VARCHAR},
  96. #{item.thirdPartyMerchCode,jdbcType=VARCHAR},
  97. #{item.thirdPartyMerchName,jdbcType=VARCHAR},
  98. #{item.placeOrderlTime,jdbcType=TIMESTAMP},
  99. #{item.autoSend,jdbcType=CHAR},
  100. #{item.buyerRegNo,jdbcType=VARCHAR},
  101. #{item.buyerBillTime,jdbcType=TIMESTAMP},
  102. #{item.buyerIdType,jdbcType=VARCHAR},
  103. #{item.buyerIdCode,jdbcType=VARCHAR},
  104. #{item.buyerName,jdbcType=VARCHAR},
  105. #{item.buyerTel,jdbcType=VARCHAR},
  106. #{item.consigneeIdType,jdbcType=VARCHAR},
  107. #{item.consigneeIdCode,jdbcType=VARCHAR},
  108. #{item.consigneeName,jdbcType=VARCHAR},
  109. #{item.consigneeMob,jdbcType=VARCHAR},
  110. #{item.consigneeTel,jdbcType=VARCHAR},
  111. #{item.consigneeCountryCode,jdbcType=VARCHAR},
  112. #{item.consigneeProvinceCode,jdbcType=VARCHAR},
  113. #{item.consigneeProvince,jdbcType=VARCHAR},
  114. #{item.consigneeCityCode,jdbcType=VARCHAR},
  115. #{item.consigneeCity,jdbcType=VARCHAR},
  116. #{item.consigneeDistrictCode,jdbcType=VARCHAR},
  117. #{item.consigneeDistrict,jdbcType=VARCHAR},
  118. #{item.consigneeAddress,jdbcType=VARCHAR},
  119. #{item.consigneeZipCode,jdbcType=VARCHAR},
  120. #{item.payerName,jdbcType=VARCHAR},
  121. #{item.payerIdType,jdbcType=VARCHAR},
  122. #{item.payerIdCode,jdbcType=VARCHAR},
  123. #{item.payerMob,jdbcType=VARCHAR},
  124. #{item.payEntCusCode,jdbcType=VARCHAR},
  125. #{item.payNo,jdbcType=VARCHAR},
  126. #{item.goodsValue,jdbcType=DECIMAL},
  127. #{item.freight,jdbcType=DECIMAL},
  128. #{item.discount,jdbcType=DECIMAL},
  129. #{item.taxTotal,jdbcType=DECIMAL},
  130. #{item.acturalPaid,jdbcType=DECIMAL},
  131. #{item.payTime,jdbcType=TIMESTAMP},
  132. #{item.exprType,jdbcType=CHAR},
  133. #{item.exprCompId,jdbcType=VARCHAR},
  134. #{item.exprAgreementType,jdbcType=CHAR},
  135. #{item.declExprFee,jdbcType=DECIMAL},
  136. #{item.batchNumbers,jdbcType=VARCHAR},
  137. #{item.declPostTax,jdbcType=DECIMAL},
  138. #{item.shopId,jdbcType=VARCHAR},
  139. #{item.extraTag,jdbcType=VARCHAR},
  140. #{item.currencyCode,jdbcType=VARCHAR},
  141. #{item.wsFlag,jdbcType=CHAR},
  142. #{item.buyerPayCheck,jdbcType=CHAR},
  143. #{item.wxOrderDetail,jdbcType=CHAR},
  144. #{item.clecOrderStatus,jdbcType=CHAR},
  145. #{item.wayOrderStatus,jdbcType=CHAR},
  146. #{item.projectCheckStatus,jdbcType=CHAR},
  147. #{item.playOrderStatus,jdbcType=CHAR},
  148. #{item.remark,jdbcType=VARCHAR},
  149. #{item.createrSn,jdbcType=VARCHAR},
  150. #{item.createTime,jdbcType=TIMESTAMP},
  151. #{item.moderSn,jdbcType=VARCHAR},
  152. #{item.modTime,jdbcType=TIMESTAMP},
  153. #{item.tstm,jdbcType=TIMESTAMP},
  154. #{item.exField,jdbcType=VARCHAR},
  155. #{item.exField2,jdbcType=VARCHAR},
  156. #{item.exField3,jdbcType=VARCHAR},
  157. #{item.exField4,jdbcType=VARCHAR},
  158. #{item.exField5,jdbcType=VARCHAR},
  159. </trim>
  160. </foreach>
  161. </insert>
  162. <update id="updateWxOrderBatch" parameterType="java.util.List">
  163. <foreach collection="list" item="item" index="index" open="" close="" separator=";">
  164. update wx_order
  165. <set >
  166. <if test="item.merchOrderId != null" >
  167. merch_order_id = #{item.merchOrderId,jdbcType=VARCHAR},
  168. </if>
  169. <if test="item.orderSn != null" >
  170. order_sn = #{item.orderSn,jdbcType=VARCHAR},
  171. </if>
  172. <if test="item.wxOrderId != null" >
  173. wx_order_id = #{item.wxOrderId,jdbcType=VARCHAR},
  174. </if>
  175. <if test="item.merchSn != null" >
  176. merch_sn = #{item.merchSn,jdbcType=VARCHAR},
  177. </if>
  178. <if test="item.merchName != null" >
  179. merch_name = #{item.merchName,jdbcType=VARCHAR},
  180. </if>
  181. <if test="item.platSn != null" >
  182. plat_sn = #{item.platSn,jdbcType=VARCHAR},
  183. </if>
  184. <if test="item.platName != null" >
  185. plat_name = #{item.platName,jdbcType=VARCHAR},
  186. </if>
  187. <if test="item.thirdPartyMerchCode != null" >
  188. third_party_merch_code = #{item.thirdPartyMerchCode,jdbcType=VARCHAR},
  189. </if>
  190. <if test="item.thirdPartyMerchName != null" >
  191. third_party_merch_name = #{item.thirdPartyMerchName,jdbcType=VARCHAR},
  192. </if>
  193. <if test="item.placeOrderlTime != null" >
  194. place_orderl_time = #{item.placeOrderlTime,jdbcType=TIMESTAMP},
  195. </if>
  196. <if test="item.autoSend != null" >
  197. auto_send = #{item.autoSend,jdbcType=CHAR},
  198. </if>
  199. <if test="item.buyerRegNo != null" >
  200. buyer_reg_no = #{item.buyerRegNo,jdbcType=VARCHAR},
  201. </if>
  202. <if test="item.buyerBillTime != null" >
  203. buyer_bill_time = #{item.buyerBillTime,jdbcType=TIMESTAMP},
  204. </if>
  205. <if test="item.buyerIdType != null" >
  206. buyer_id_type = #{item.buyerIdType,jdbcType=VARCHAR},
  207. </if>
  208. <if test="item.buyerIdCode != null" >
  209. buyer_id_code = #{item.buyerIdCode,jdbcType=VARCHAR},
  210. </if>
  211. <if test="item.buyerName != null" >
  212. buyer_name = #{item.buyerName,jdbcType=VARCHAR},
  213. </if>
  214. <if test="item.buyerTel != null" >
  215. buyer_tel = #{item.buyerTel,jdbcType=VARCHAR},
  216. </if>
  217. <if test="item.consigneeIdType != null" >
  218. consignee_id_type = #{item.consigneeIdType,jdbcType=VARCHAR},
  219. </if>
  220. <if test="item.consigneeIdCode != null" >
  221. consignee_id_code = #{item.consigneeIdCode,jdbcType=VARCHAR},
  222. </if>
  223. <if test="item.consigneeName != null" >
  224. consignee_name = #{item.consigneeName,jdbcType=VARCHAR},
  225. </if>
  226. <if test="item.consigneeMob != null" >
  227. consignee_mob = #{item.consigneeMob,jdbcType=VARCHAR},
  228. </if>
  229. <if test="item.consigneeTel != null" >
  230. consignee_tel = #{item.consigneeTel,jdbcType=VARCHAR},
  231. </if>
  232. <if test="item.consigneeCountryCode != null" >
  233. consignee_country_code = #{item.consigneeCountryCode,jdbcType=VARCHAR},
  234. </if>
  235. <if test="item.consigneeProvinceCode != null" >
  236. consignee_province_code = #{item.consigneeProvinceCode,jdbcType=VARCHAR},
  237. </if>
  238. <if test="item.consigneeProvince != null" >
  239. consignee_province = #{item.consigneeProvince,jdbcType=VARCHAR},
  240. </if>
  241. <if test="item.consigneeCityCode != null" >
  242. consignee_city_code = #{item.consigneeCityCode,jdbcType=VARCHAR},
  243. </if>
  244. <if test="item.consigneeCity != null" >
  245. consignee_city = #{item.consigneeCity,jdbcType=VARCHAR},
  246. </if>
  247. <if test="item.consigneeDistrictCode != null" >
  248. consignee_district_code = #{item.consigneeDistrictCode,jdbcType=VARCHAR},
  249. </if>
  250. <if test="item.consigneeDistrict != null" >
  251. consignee_district = #{item.consigneeDistrict,jdbcType=VARCHAR},
  252. </if>
  253. <if test="item.consigneeAddress != null" >
  254. consignee_address = #{item.consigneeAddress,jdbcType=VARCHAR},
  255. </if>
  256. <if test="item.consigneeZipCode != null" >
  257. consignee_zip_code = #{item.consigneeZipCode,jdbcType=VARCHAR},
  258. </if>
  259. <if test="item.payerName != null" >
  260. payer_name = #{item.payerName,jdbcType=VARCHAR},
  261. </if>
  262. <if test="item.payerIdType != null" >
  263. payer_id_type = #{item.payerIdType,jdbcType=VARCHAR},
  264. </if>
  265. <if test="item.payerIdCode != null" >
  266. payer_id_code = #{item.payerIdCode,jdbcType=VARCHAR},
  267. </if>
  268. <if test="item.payerMob != null" >
  269. payer_mob = #{item.payerMob,jdbcType=VARCHAR},
  270. </if>
  271. <if test="item.payEntCusCode != null" >
  272. pay_ent_cus_code = #{item.payEntCusCode,jdbcType=VARCHAR},
  273. </if>
  274. <if test="item.payNo != null" >
  275. pay_no = #{item.payNo,jdbcType=VARCHAR},
  276. </if>
  277. <if test="item.goodsValue != null" >
  278. goods_value = #{item.goodsValue,jdbcType=DECIMAL},
  279. </if>
  280. <if test="item.freight != null" >
  281. freight = #{item.freight,jdbcType=DECIMAL},
  282. </if>
  283. <if test="item.discount != null" >
  284. discount = #{item.discount,jdbcType=DECIMAL},
  285. </if>
  286. <if test="item.taxTotal != null" >
  287. tax_total = #{item.taxTotal,jdbcType=DECIMAL},
  288. </if>
  289. <if test="item.acturalPaid != null" >
  290. actural_paid = #{item.acturalPaid,jdbcType=DECIMAL},
  291. </if>
  292. <if test="item.payTime != null" >
  293. pay_time = #{item.payTime,jdbcType=TIMESTAMP},
  294. </if>
  295. <if test="item.exprType != null" >
  296. expr_type = #{item.exprType,jdbcType=CHAR},
  297. </if>
  298. <if test="item.exprCompId != null" >
  299. expr_comp_id = #{item.exprCompId,jdbcType=VARCHAR},
  300. </if>
  301. <if test="item.exprAgreementType != null" >
  302. expr_agreement_type = #{item.exprAgreementType,jdbcType=CHAR},
  303. </if>
  304. <if test="item.declExprFee != null" >
  305. decl_expr_fee = #{item.declExprFee,jdbcType=DECIMAL},
  306. </if>
  307. <if test="item.batchNumbers != null" >
  308. batch_numbers = #{item.batchNumbers,jdbcType=VARCHAR},
  309. </if>
  310. <if test="item.declPostTax != null" >
  311. decl_post_tax = #{item.declPostTax,jdbcType=DECIMAL},
  312. </if>
  313. <if test="item.shopId != null" >
  314. shop_id = #{item.shopId,jdbcType=VARCHAR},
  315. </if>
  316. <if test="item.extraTag != null" >
  317. extra_tag = #{item.extraTag,jdbcType=VARCHAR},
  318. </if>
  319. <if test="item.currencyCode != null" >
  320. currency_code = #{item.currencyCode,jdbcType=VARCHAR},
  321. </if>
  322. <if test="item.wsFlag != null" >
  323. ws_flag = #{item.wsFlag,jdbcType=CHAR},
  324. </if>
  325. <if test="item.buyerPayCheck != null" >
  326. buyer_pay_check = #{item.buyerPayCheck,jdbcType=CHAR},
  327. </if>
  328. <if test="item.wxOrderDetail != null" >
  329. wx_order_detail = #{item.wxOrderDetail,jdbcType=CHAR},
  330. </if>
  331. <if test="item.clecOrderStatus != null" >
  332. clec_order_status = #{item.clecOrderStatus,jdbcType=CHAR},
  333. </if>
  334. <if test="item.wayOrderStatus != null" >
  335. way_order_status = #{item.wayOrderStatus,jdbcType=CHAR},
  336. </if>
  337. <if test="item.projectCheckStatus != null" >
  338. project_check_status = #{item.projectCheckStatus,jdbcType=CHAR},
  339. </if>
  340. <if test="item.playOrderStatus != null" >
  341. play_order_status = #{item.playOrderStatus,jdbcType=CHAR},
  342. </if>
  343. <if test="item.remark != null" >
  344. remark = #{item.remark,jdbcType=VARCHAR},
  345. </if>
  346. <if test="item.createrSn != null" >
  347. creater_sn = #{item.createrSn,jdbcType=VARCHAR},
  348. </if>
  349. <if test="item.createTime != null" >
  350. create_time = #{item.createTime,jdbcType=TIMESTAMP},
  351. </if>
  352. <if test="item.moderSn != null" >
  353. moder_sn = #{item.moderSn,jdbcType=VARCHAR},
  354. </if>
  355. <if test="item.modTime != null" >
  356. mod_time = #{item.modTime,jdbcType=TIMESTAMP},
  357. </if>
  358. <if test="item.tstm != null" >
  359. tstm = #{item.tstm,jdbcType=TIMESTAMP},
  360. </if>
  361. <if test="item.exField != null" >
  362. ex_field = #{item.exField,jdbcType=VARCHAR},
  363. </if>
  364. <if test="item.exField2 != null" >
  365. ex_field2 = #{item.exField2,jdbcType=VARCHAR},
  366. </if>
  367. <if test="item.exField3 != null" >
  368. ex_field3 = #{item.exField3,jdbcType=VARCHAR},
  369. </if>
  370. <if test="item.exField4 != null" >
  371. ex_field4 = #{item.exField4,jdbcType=VARCHAR},
  372. </if>
  373. <if test="item.exField5 != null" >
  374. ex_field5 = #{item.exField5,jdbcType=VARCHAR},
  375. </if>
  376. </set>
  377. where wx_order_sn = #{item.wxOrderSn,jdbcType=VARCHAR}
  378. </foreach>
  379. </update>
  380. <select id="getWxOrder" resultMap="BaseResultMap" parameterType="java.lang.String" >
  381. select
  382. <include refid="Base_Column_List" />
  383. from wx_order where 1 = 1
  384. <if test="wxOrderDetail != null">
  385. and wx_order_detail = #{wxOrderDetail,jdbcType=CHAR}
  386. </if>
  387. <if test="clecOrderStatus != null">
  388. and clec_order_status = #{clecOrderStatus,jdbcType=CHAR}
  389. </if>
  390. <if test="wayOrderStatus != null">
  391. and way_order_status = #{wayOrderStatus,jdbcType=CHAR}
  392. </if>
  393. <if test="playOrderStatus != null">
  394. and play_order_status = #{playOrderStatus,jdbcType=CHAR}
  395. </if>
  396. <if test="projectCheckStatus != null">
  397. and project_check_status = #{projectCheckStatus,jdbcType=CHAR}
  398. </if>
  399. <if test="buyerPayCheck != null">
  400. and buyer_pay_check = #{buyerPayCheck,jdbcType=CHAR}
  401. </if>
  402. ORDER BY wx_order_sn limit #{number}
  403. </select>
  404. <update id="updateWxOrderStatusBatch" parameterType="List">
  405. UPDATE wx_order
  406. <trim prefix="set" suffixOverrides=",">
  407. <trim prefix="wx_order_detail =case" suffix="end,">
  408. <foreach collection="list" item="i" index="idx">
  409. <if test="i.wxOrderDetail !=null and i.wxOrderDetail !=''">
  410. when order_sn=#{i.orderSn} then #{i.wxOrderDetail}
  411. </if>
  412. </foreach>
  413. </trim>
  414. <trim prefix="clec_order_status =case" suffix="end,">
  415. <foreach collection="list" item="i" index="idx">
  416. <if test="i.clecOrderStatus !=null and i.clecOrderStatus !=''">
  417. when order_sn=#{i.orderSn} then #{i.clecOrderStatus}
  418. </if>
  419. </foreach>
  420. </trim>
  421. <trim prefix="way_order_status =case" suffix="end,">
  422. <foreach collection="list" item="i" index="idx">
  423. <if test="i.wayOrderStatus !=null and i.wayOrderStatus !=''">
  424. when order_sn=#{i.orderSn} then #{i.wayOrderStatus}
  425. </if>
  426. </foreach>
  427. </trim>
  428. <trim prefix="play_order_status =case" suffix="end,">
  429. <foreach collection="list" item="i" index="idx">
  430. <if test="i.playOrderStatus !=null and i.playOrderStatus !=''">
  431. when order_sn=#{i.orderSn} then #{i.playOrderStatus}
  432. </if>
  433. </foreach>
  434. </trim>
  435. <trim prefix="project_check_status =case" suffix="end,">
  436. <foreach collection="list" item="i" index="idx">
  437. <if test="i.projectCheckStatus !=null and i.projectCheckStatus !=''">
  438. when order_sn=#{i.orderSn} then #{i.projectCheckStatus}
  439. </if>
  440. </foreach>
  441. </trim>
  442. <trim prefix="buyer_payer_check =case" suffix="end,">
  443. <foreach collection="list" item="i" index="idx">
  444. <if test="i.buyerPayerCheck !=null and i.buyerPayerCheck !=''">
  445. when order_sn=#{i.orderSn} then #{i.buyerPayerCheck}
  446. </if>
  447. </foreach>
  448. </trim>
  449. </trim>
  450. <where>
  451. <if test="list != null and list.size()>0">
  452. <foreach collection="list" item="i" index="index" separator="or" >
  453. order_sn=#{i.orderSn}
  454. </foreach>
  455. </if>
  456. </where>
  457. </update>
  458. <update id="updateWxOrderStatus" parameterType="hashMap">
  459. UPDATE wx_order
  460. <set>
  461. <if test="clecOrderStatus !=null and clecOrderStatus !=''">
  462. clec_order_status = #{clecOrderStatus}
  463. </if>
  464. <if test="projectCheckStatus !=null and projectCheckStatus !=''">
  465. project_check_status = #{projectCheckStatus}
  466. </if>
  467. <if test="wayOrderStatus !=null and wayOrderStatus !=''">
  468. way_order_status = #{wayOrderStatus}
  469. </if>
  470. <if test="playOrderStatus !=null and playOrderStatus !=''">
  471. play_order_status = #{playOrderStatus}
  472. </if>
  473. <if test="buyerPayerCheck !=null and buyerPayerCheck !=''">
  474. when buyer_payer_check = #{buyerPayerCheck}
  475. </if>
  476. </set>
  477. <where>
  478. order_sn=#{orderSn}
  479. </where>
  480. </update>
  481. <select id="getWxOrderByOrderSn" resultMap="BaseResultMap" parameterType="java.lang.String" >
  482. select
  483. <include refid="Base_Column_List" />
  484. from wx_order
  485. where order_sn = #{orderSn,jdbcType=VARCHAR}
  486. </select>
  487. <resultMap id="BaseResultMap2" type="com.emato.ccnet.wx.dao.entity.ccnet.WxOrder" >
  488. <id column="wx_order_sn" property="wxOrderSn" jdbcType="VARCHAR" />
  489. <result column="merch_order_id" property="merchOrderId" jdbcType="VARCHAR" />
  490. <result column="order_sn" property="orderSn" jdbcType="VARCHAR" />
  491. <result column="wx_order_id" property="wxOrderId" jdbcType="VARCHAR" />
  492. <result column="merch_sn" property="merchSn" jdbcType="VARCHAR" />
  493. <result column="merch_name" property="merchName" jdbcType="VARCHAR" />
  494. <result column="plat_sn" property="platSn" jdbcType="VARCHAR" />
  495. <result column="plat_name" property="platName" jdbcType="VARCHAR" />
  496. <result column="third_party_merch_code" property="thirdPartyMerchCode" jdbcType="VARCHAR" />
  497. <result column="third_party_merch_name" property="thirdPartyMerchName" jdbcType="VARCHAR" />
  498. <result column="place_orderl_time" property="placeOrderlTime" jdbcType="TIMESTAMP" />
  499. <result column="auto_send" property="autoSend" jdbcType="CHAR" />
  500. <result column="buyer_reg_no" property="buyerRegNo" jdbcType="VARCHAR" />
  501. <result column="buyer_bill_time" property="buyerBillTime" jdbcType="TIMESTAMP" />
  502. <result column="buyer_id_type" property="buyerIdType" jdbcType="VARCHAR" />
  503. <result column="buyer_id_code" property="buyerIdCode" jdbcType="VARCHAR" />
  504. <result column="buyer_name" property="buyerName" jdbcType="VARCHAR" />
  505. <result column="buyer_tel" property="buyerTel" jdbcType="VARCHAR" />
  506. <result column="consignee_id_type" property="consigneeIdType" jdbcType="VARCHAR" />
  507. <result column="consignee_id_code" property="consigneeIdCode" jdbcType="VARCHAR" />
  508. <result column="consignee_name" property="consigneeName" jdbcType="VARCHAR" />
  509. <result column="consignee_mob" property="consigneeMob" jdbcType="VARCHAR" />
  510. <result column="consignee_tel" property="consigneeTel" jdbcType="VARCHAR" />
  511. <result column="consignee_country_code" property="consigneeCountryCode" jdbcType="VARCHAR" />
  512. <result column="consignee_province_code" property="consigneeProvinceCode" jdbcType="VARCHAR" />
  513. <result column="consignee_province" property="consigneeProvince" jdbcType="VARCHAR" />
  514. <result column="consignee_city_code" property="consigneeCityCode" jdbcType="VARCHAR" />
  515. <result column="consignee_city" property="consigneeCity" jdbcType="VARCHAR" />
  516. <result column="consignee_district_code" property="consigneeDistrictCode" jdbcType="VARCHAR" />
  517. <result column="consignee_district" property="consigneeDistrict" jdbcType="VARCHAR" />
  518. <result column="consignee_address" property="consigneeAddress" jdbcType="VARCHAR" />
  519. <result column="consignee_zip_code" property="consigneeZipCode" jdbcType="VARCHAR" />
  520. <result column="payer_name" property="payerName" jdbcType="VARCHAR" />
  521. <result column="payer_id_type" property="payerIdType" jdbcType="VARCHAR" />
  522. <result column="payer_id_code" property="payerIdCode" jdbcType="VARCHAR" />
  523. <result column="payer_mob" property="payerMob" jdbcType="VARCHAR" />
  524. <result column="pay_ent_cus_code" property="payEntCusCode" jdbcType="VARCHAR" />
  525. <result column="pay_no" property="payNo" jdbcType="VARCHAR" />
  526. <result column="goods_value" property="goodsValue" jdbcType="DECIMAL" />
  527. <result column="freight" property="freight" jdbcType="DECIMAL" />
  528. <result column="discount" property="discount" jdbcType="DECIMAL" />
  529. <result column="tax_total" property="taxTotal" jdbcType="DECIMAL" />
  530. <result column="actural_paid" property="acturalPaid" jdbcType="DECIMAL" />
  531. <result column="pay_time" property="payTime" jdbcType="TIMESTAMP" />
  532. <result column="expr_type" property="exprType" jdbcType="CHAR" />
  533. <result column="expr_comp_id" property="exprCompId" jdbcType="VARCHAR" />
  534. <result column="expr_agreement_type" property="exprAgreementType" jdbcType="CHAR" />
  535. <result column="decl_expr_fee" property="declExprFee" jdbcType="DECIMAL" />
  536. <result column="batch_numbers" property="batchNumbers" jdbcType="VARCHAR" />
  537. <result column="decl_post_tax" property="declPostTax" jdbcType="DECIMAL" />
  538. <result column="shop_id" property="shopId" jdbcType="VARCHAR" />
  539. <result column="extra_tag" property="extraTag" jdbcType="VARCHAR" />
  540. <result column="currency_code" property="currencyCode" jdbcType="VARCHAR" />
  541. <result column="ws_flag" property="wsFlag" jdbcType="CHAR" />
  542. <result column="buyer_pay_check" property="buyerPayCheck" jdbcType="CHAR" />
  543. <result column="wx_order_detail" property="wxOrderDetail" jdbcType="CHAR" />
  544. <result column="clec_order_status" property="clecOrderStatus" jdbcType="CHAR" />
  545. <result column="way_order_status" property="wayOrderStatus" jdbcType="CHAR" />
  546. <result column="project_check_status" property="projectCheckStatus" jdbcType="CHAR" />
  547. <result column="play_order_status" property="playOrderStatus" jdbcType="CHAR" />
  548. <result column="remark" property="remark" jdbcType="VARCHAR" />
  549. <result column="creater_sn" property="createrSn" jdbcType="VARCHAR" />
  550. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  551. <result column="moder_sn" property="moderSn" jdbcType="VARCHAR" />
  552. <result column="mod_time" property="modTime" jdbcType="TIMESTAMP" />
  553. <result column="tstm" property="tstm" jdbcType="TIMESTAMP" />
  554. <result column="ex_field" property="exField" jdbcType="VARCHAR" />
  555. <result column="ex_field2" property="exField2" jdbcType="VARCHAR" />
  556. <result column="ex_field3" property="exField3" jdbcType="VARCHAR" />
  557. <result column="ex_field4" property="exField4" jdbcType="VARCHAR" />
  558. <result column="ex_field5" property="exField5" jdbcType="VARCHAR" />
  559. </resultMap>
  560. <select id="getResendWxOrder" resultMap="BaseResultMap2" parameterType="java.lang.String" >
  561. SELECT DISTINCT
  562. '支付单' AS 'name',
  563. oo.wx_order_sn, oo.merch_order_id, oo.order_sn, oo.wx_order_id, oo.merch_sn, oo.merch_name, oo.plat_sn,
  564. oo.plat_name, oo.third_party_merch_code, oo.third_party_merch_name, oo.place_orderl_time, oo.auto_send,
  565. oo.buyer_reg_no, oo.buyer_bill_time, oo.buyer_id_type, oo.buyer_id_code, oo.buyer_name, oo.buyer_tel,
  566. oo.consignee_id_type, oo.consignee_id_code, oo.consignee_name, oo.consignee_mob, oo.consignee_tel,
  567. oo.consignee_country_code, oo.consignee_province_code, oo.consignee_province, oo.consignee_city_code,
  568. oo.consignee_city, oo.consignee_district_code, oo.consignee_district, oo.consignee_address, oo.consignee_zip_code,
  569. oo.payer_name, oo.payer_id_type, oo.payer_id_code, oo.payer_mob, oo.pay_ent_cus_code, oo.pay_no, oo.goods_value,
  570. oo.freight, oo.discount, oo.tax_total, oo.actural_paid, oo.pay_time, oo.expr_type, oo.expr_comp_id, oo.decl_expr_fee,
  571. oo.batch_numbers, oo.decl_post_tax, oo.shop_id, oo.extra_tag, oo.currency_code, oo.ws_flag, oo.buyer_pay_check, oo.wx_order_detail, oo.clec_order_status,oo.expr_agreement_type,
  572. oo.way_order_status, oo.project_check_status, oo.play_order_status, oo.remark, oo.creater_sn, oo.create_time,
  573. oo.moder_sn, oo.mod_time,
  574. ww.wx_cuspay_sn 'sn',
  575. ww.CODE 'failCode',
  576. ww.msg 'failMsg'
  577. FROM
  578. wx_cuspay_resp ww
  579. INNER JOIN wx_pay_doc d ON ww.wx_cuspay_sn = d.wx_cuspay_sn
  580. INNER JOIN wx_order oo ON d.out_trade_no = oo.merch_order_id
  581. WHERE
  582. ( play_order_status = 3 OR project_check_status = 3 )
  583. AND cus_decl_status = 13 UNION ALL
  584. (
  585. SELECT DISTINCT
  586. '运单' AS 'name',
  587. oo.wx_order_sn, oo.merch_order_id, oo.order_sn, oo.wx_order_id, oo.merch_sn, oo.merch_name, oo.plat_sn,
  588. oo.plat_name, oo.third_party_merch_code, oo.third_party_merch_name, oo.place_orderl_time, oo.auto_send,
  589. oo.buyer_reg_no, oo.buyer_bill_time, oo.buyer_id_type, oo.buyer_id_code, oo.buyer_name, oo.buyer_tel,
  590. oo.consignee_id_type, oo.consignee_id_code, oo.consignee_name, oo.consignee_mob, oo.consignee_tel,
  591. oo.consignee_country_code, oo.consignee_province_code, oo.consignee_province, oo.consignee_city_code,
  592. oo.consignee_city, oo.consignee_district_code, oo.consignee_district, oo.consignee_address, oo.consignee_zip_code,
  593. oo.payer_name, oo.payer_id_type, oo.payer_id_code, oo.payer_mob, oo.pay_ent_cus_code, oo.pay_no, oo.goods_value,
  594. oo.freight, oo.discount, oo.tax_total, oo.actural_paid, oo.pay_time, oo.expr_type, oo.expr_comp_id, oo.decl_expr_fee,
  595. oo.batch_numbers, oo.decl_post_tax, oo.shop_id, oo.extra_tag, oo.currency_code, oo.ws_flag, oo.buyer_pay_check, oo.wx_order_detail, oo.clec_order_status,oo.expr_agreement_type,
  596. oo.way_order_status, oo.project_check_status, oo.play_order_status, oo.remark, oo.creater_sn, oo.create_time,
  597. oo.moder_sn, oo.mod_time,
  598. ww.cus_waybill_sn 'sn',
  599. ww.biz_info_code 'failCode',
  600. ww.biz_info_desc 'failMsg'
  601. FROM
  602. cus_waybill_resp ww
  603. INNER JOIN cus_waybill w ON ww.cus_waybill_sn = w.cus_waybill_sn
  604. INNER JOIN wx_order oo ON w.merch_order_id = oo.order_sn
  605. WHERE
  606. way_order_status = 3
  607. ) UNION ALL
  608. (
  609. SELECT DISTINCT
  610. '电子订单' AS 'name',
  611. oo.wx_order_sn, oo.merch_order_id, oo.order_sn, oo.wx_order_id, oo.merch_sn, oo.merch_name, oo.plat_sn,
  612. oo.plat_name, oo.third_party_merch_code, oo.third_party_merch_name, oo.place_orderl_time, oo.auto_send,
  613. oo.buyer_reg_no, oo.buyer_bill_time, oo.buyer_id_type, oo.buyer_id_code, oo.buyer_name, oo.buyer_tel,
  614. oo.consignee_id_type, oo.consignee_id_code, oo.consignee_name, oo.consignee_mob, oo.consignee_tel,
  615. oo.consignee_country_code, oo.consignee_province_code, oo.consignee_province, oo.consignee_city_code,
  616. oo.consignee_city, oo.consignee_district_code, oo.consignee_district, oo.consignee_address, oo.consignee_zip_code,
  617. oo.payer_name, oo.payer_id_type, oo.payer_id_code, oo.payer_mob, oo.pay_ent_cus_code, oo.pay_no, oo.goods_value,
  618. oo.freight, oo.discount, oo.tax_total, oo.actural_paid, oo.pay_time, oo.expr_type, oo.expr_comp_id, oo.decl_expr_fee,
  619. oo.batch_numbers, oo.decl_post_tax, oo.shop_id, oo.extra_tag, oo.currency_code, oo.ws_flag, oo.buyer_pay_check, oo.wx_order_detail, oo.clec_order_status,oo.expr_agreement_type,
  620. oo.way_order_status, oo.project_check_status, oo.play_order_status, oo.remark, oo.creater_sn, oo.create_time,
  621. oo.moder_sn, oo.mod_time,
  622. ww.cus_order_sn 'sn',
  623. ww.cus_resp_code 'failCode',
  624. ww.cus_resp_desc 'failMsg'
  625. FROM
  626. cus_order_resp ww
  627. INNER JOIN cus_order w ON ww.cus_order_sn = w.cus_order_sn
  628. INNER JOIN wx_order oo ON w.merch_order_sn = oo.order_sn
  629. WHERE
  630. clec_order_status = 3
  631. )
  632. </select>
  633. </mapper>