WmsDocOrderHeaderMapper.xml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.ams.order.mapper.WmsDocOrderHeaderMapper">
  6. <resultMap type="WmsDocOrderHeader" id="WmsDocOrderHeaderResult">
  7. <result property="orderNo" column="order_no" />
  8. <result property="customerId" column="customer_id" />
  9. <result property="orderStatus" column="order_status" />
  10. <result property="orderType" column="order_type" />
  11. <result property="soReference1" column="so_reference1" />
  12. <result property="soReference2" column="so_reference2" />
  13. <result property="soReference3" column="so_reference3" />
  14. <result property="priority" column="priority" />
  15. <result property="consigneeId" column="consignee_id" />
  16. <result property="consigneeName" column="consignee_name" />
  17. <result property="cusCountry" column="cus_country" />
  18. <result property="cusProvince" column="cus_province" />
  19. <result property="cusCity" column="cus_city" />
  20. <result property="cusDistrict" column="cus_district" />
  21. <result property="cusAddress" column="cus_address" />
  22. <result property="cusContact" column="cus_contact" />
  23. <result property="cusPostcode" column="cus_postcode" />
  24. <result property="cusEmail" column="cus_email" />
  25. <result property="carrierId" column="carrier_id" />
  26. <result property="shipmentTime" column="shipment_time" />
  27. <result property="carrierName" column="carrier_name" />
  28. <result property="deliveryNo" column="delivery_no" />
  29. <result property="ediSendFlag" column="edi_send_flag" />
  30. <result property="remark" column="remark" />
  31. <result property="warehouseId" column="warehouse_id" />
  32. <result property="userdefine1" column="userdefine1" />
  33. <result property="userdefine2" column="userdefine2" />
  34. <result property="userdefine3" column="userdefine3" />
  35. <result property="userdefine4" column="userdefine4" />
  36. <result property="userdefine5" column="userdefine5" />
  37. <result property="userdefine6" column="userdefine6" />
  38. <result property="createTime" column="create_time" />
  39. <result property="createBy" column="create_by" />
  40. <result property="updateTime" column="update_time" />
  41. <result property="updateBy" column="update_by" />
  42. <result property="hEdi01" column="h_edi_01" />
  43. <result property="hEdi02" column="h_edi_02" />
  44. <result property="hEdi03" column="h_edi_03" />
  45. <result property="hEdi04" column="h_edi_04" />
  46. <result property="hEdi05" column="h_edi_05" />
  47. <result property="hEdi06" column="h_edi_06" />
  48. <result property="hEdi07" column="h_edi_07" />
  49. <result property="hEdi08" column="h_edi_08" />
  50. <result property="hEdi09" column="h_edi_09" />
  51. <result property="hEdi10" column="h_edi_10" />
  52. <result property="hEdi11" column="h_edi_11" />
  53. <result property="hEdi12" column="h_edi_12" />
  54. <result property="hEdi13" column="h_edi_13" />
  55. <result property="hEdi14" column="h_edi_14" />
  56. <result property="hEdi15" column="h_edi_15" />
  57. </resultMap>
  58. <resultMap id="WmsDocOrderHeaderWmsDocOrderDetailsResult" type="WmsDocOrderHeader" extends="WmsDocOrderHeaderResult">
  59. <collection property="wmsDocOrderDetailsList" notNullColumn="sub_order_no" javaType="java.util.List" resultMap="WmsDocOrderDetailsResult" />
  60. </resultMap>
  61. <resultMap type="WmsDocOrderDetails" id="WmsDocOrderDetailsResult">
  62. <result property="orderNo" column="sub_order_no" />
  63. <result property="orderLineNo" column="sub_order_line_no" />
  64. <result property="customerId" column="sub_customer_id" />
  65. <result property="sku" column="sub_sku" />
  66. <result property="lineStatus" column="sub_line_status" />
  67. <result property="qtyOrdered" column="sub_qty_ordered" />
  68. <result property="qtyOrderedEach" column="sub_qty_ordered_each" />
  69. <result property="qtySoftAllocated" column="sub_qty_soft_allocated" />
  70. <result property="qtySoftallocatedEach" column="sub_qty_softallocated_each" />
  71. <result property="qtyAllocated" column="sub_qty_allocated" />
  72. <result property="qtyAllocatedEach" column="sub_qty_allocated_each" />
  73. <result property="qtyPicked" column="sub_qty_picked" />
  74. <result property="qtyPickedEach" column="sub_qty_picked_each" />
  75. <result property="qtyPacked" column="sub_qty_packed" />
  76. <result property="qtyPackedEach" column="sub_qty_packed_each" />
  77. <result property="qtyShipped" column="sub_qty_shipped" />
  78. <result property="qtyShippedEach" column="sub_qty_shipped_each" />
  79. <result property="uom" column="sub_uom" />
  80. <result property="lotatt01" column="sub_lotatt01" />
  81. <result property="lotatt02" column="sub_lotatt02" />
  82. <result property="lotatt03" column="sub_lotatt03" />
  83. <result property="lotatt04" column="sub_lotatt04" />
  84. <result property="lotatt05" column="sub_lotatt05" />
  85. <result property="lotatt06" column="sub_lotatt06" />
  86. <result property="lotatt07" column="sub_lotatt07" />
  87. <result property="lotatt08" column="sub_lotatt08" />
  88. <result property="lotatt09" column="sub_lotatt09" />
  89. <result property="lotatt10" column="sub_lotatt10" />
  90. <result property="lotatt11" column="sub_lotatt11" />
  91. <result property="lotatt12" column="sub_lotatt12" />
  92. <result property="lotatt13" column="sub_lotatt13" />
  93. <result property="lotatt14" column="sub_lotatt14" />
  94. <result property="lotatt15" column="sub_lotatt15" />
  95. <result property="lotatt16" column="sub_lotatt16" />
  96. <result property="lotatt17" column="sub_lotatt17" />
  97. <result property="lotatt18" column="sub_lotatt18" />
  98. <result property="packId" column="sub_pack_id" />
  99. <result property="pickZone" column="sub_pick_zone" />
  100. <result property="location" column="sub_location" />
  101. <result property="lotnum" column="sub_lotnum" />
  102. <result property="remark" column="sub_remark" />
  103. <result property="createTime" column="sub_create_time" />
  104. <result property="createBy" column="sub_create_by" />
  105. <result property="updateTime" column="sub_update_time" />
  106. <result property="updateBy" column="sub_update_by" />
  107. <result property="netWeight" column="sub_net_weight" />
  108. <result property="grossWeight" column="sub_gross_weight" />
  109. <result property="cubic" column="sub_cubic" />
  110. <result property="dEdi01" column="sub_d_edi_01" />
  111. <result property="dEdi02" column="sub_d_edi_02" />
  112. <result property="dEdi03" column="sub_d_edi_03" />
  113. <result property="dEdi04" column="sub_d_edi_04" />
  114. <result property="dEdi05" column="sub_d_edi_05" />
  115. <result property="dEdi06" column="sub_d_edi_06" />
  116. <result property="dEdi07" column="sub_d_edi_07" />
  117. <result property="dEdi08" column="sub_d_edi_08" />
  118. <result property="dEdi09" column="sub_d_edi_09" />
  119. <result property="dEdi10" column="sub_d_edi_10" />
  120. <result property="dEdi11" column="sub_d_edi_11" />
  121. <result property="dEdi12" column="sub_d_edi_12" />
  122. <result property="dEdi13" column="sub_d_edi_13" />
  123. <result property="dEdi14" column="sub_d_edi_14" />
  124. <result property="dEdi15" column="sub_d_edi_15" />
  125. <result property="dEdi16" column="sub_d_edi_16" />
  126. <result property="dEdi17" column="sub_d_edi_17" />
  127. <result property="dEdi18" column="sub_d_edi_18" />
  128. <result property="dEdi19" column="sub_d_edi_19" />
  129. <result property="dEdi20" column="sub_d_edi_20" />
  130. <result property="traceId" column="sub_trace_id" />
  131. <result property="softAllocationRule" column="sub_soft_allocation_rule" />
  132. <result property="allocationRule" column="sub_allocation_rule" />
  133. <result property="userdefine1" column="sub_userdefine1" />
  134. <result property="userdefine2" column="sub_userdefine2" />
  135. <result property="userdefine3" column="sub_userdefine3" />
  136. <result property="userdefine4" column="sub_userdefine4" />
  137. <result property="userdefine5" column="sub_userdefine5" />
  138. </resultMap>
  139. <resultMap type="com.ruoyi.ams.order.vo.CheckOutVO" id="CheckOutVOResult">
  140. <result property="orderNo" column="order_no" />
  141. <result property="palletNo" column="palletNo" />
  142. <result property="locationNo" column="location_no" />
  143. </resultMap>
  144. <sql id="selectWmsDocOrderHeaderVo">
  145. select order_no, customer_id, order_status, order_type, so_reference1, so_reference2, so_reference3, priority, consignee_id, consignee_name, cus_country, cus_province, cus_city, cus_district, cus_address, cus_contact, cus_postcode, cus_email, carrier_id, shipment_time, carrier_name, delivery_no, edi_send_flag, remark, warehouse_id, userdefine1, userdefine2, userdefine3, userdefine4, userdefine5, userdefine6, create_time, create_by, update_time, update_by, h_edi_01, h_edi_02, h_edi_03, h_edi_04, h_edi_05, h_edi_06, h_edi_07, h_edi_08, h_edi_09, h_edi_10, h_edi_11, h_edi_12, h_edi_13, h_edi_14, h_edi_15 from wms_doc_order_header
  146. </sql>
  147. <select id="selectWmsDocOrderHeaderList" parameterType="WmsDocOrderHeader" resultMap="WmsDocOrderHeaderResult">
  148. <include refid="selectWmsDocOrderHeaderVo"/>
  149. <where>
  150. <if test="orderNo != null and orderNo != ''"> and order_no like concat('%', #{orderNo}, '%')</if>
  151. <if test="consigneeName != null and consigneeName != ''"> and consignee_name like concat('%', #{consigneeName}, '%')</if>
  152. <if test="carrierName != null and carrierName != ''"> and carrier_name like concat('%', #{carrierName}, '%')</if>
  153. <if test="soReference1 != null and soReference1 != ''"> and so_reference1 like concat('%', #{soReference1}, '%')</if>
  154. </where>
  155. order by create_time desc
  156. </select>
  157. <select id="selectWmsDocOrderHeaderByOrderNo" parameterType="String" resultMap="WmsDocOrderHeaderWmsDocOrderDetailsResult">
  158. select a.order_no, a.customer_id, a.order_status, a.order_type, a.so_reference1, a.so_reference2, a.so_reference3, a.priority, a.consignee_id, a.consignee_name, a.cus_country, a.cus_province, a.cus_city, a.cus_district, a.cus_address, a.cus_contact, a.cus_postcode, a.cus_email, a.carrier_id, a.shipment_time, a.carrier_name, a.delivery_no, a.edi_send_flag, a.remark, a.warehouse_id, a.userdefine1, a.userdefine2, a.userdefine3, a.userdefine4, a.userdefine5, a.userdefine6, a.create_time, a.create_by, a.update_time, a.update_by, a.h_edi_01, a.h_edi_02, a.h_edi_03, a.h_edi_04, a.h_edi_05, a.h_edi_06, a.h_edi_07, a.h_edi_08, a.h_edi_09, a.h_edi_10, a.h_edi_11, a.h_edi_12, a.h_edi_13, a.h_edi_14, a.h_edi_15,
  159. b.order_no as sub_order_no, b.order_line_no as sub_order_line_no, b.customer_id as sub_customer_id, b.sku as sub_sku, b.line_status as sub_line_status, b.qty_ordered as sub_qty_ordered, b.qty_ordered_each as sub_qty_ordered_each, b.qty_soft_allocated as sub_qty_soft_allocated, b.qty_softallocated_each as sub_qty_softallocated_each, b.qty_allocated as sub_qty_allocated, b.qty_allocated_each as sub_qty_allocated_each, b.qty_picked as sub_qty_picked, b.qty_picked_each as sub_qty_picked_each, b.qty_packed as sub_qty_packed, b.qty_packed_each as sub_qty_packed_each, b.qty_shipped as sub_qty_shipped, b.qty_shipped_each as sub_qty_shipped_each, b.uom as sub_uom, b.lotatt01 as sub_lotatt01, b.lotatt02 as sub_lotatt02, b.lotatt03 as sub_lotatt03, b.lotatt04 as sub_lotatt04, b.lotatt05 as sub_lotatt05, b.lotatt06 as sub_lotatt06, b.lotatt07 as sub_lotatt07, b.lotatt08 as sub_lotatt08, b.lotatt09 as sub_lotatt09, b.lotatt10 as sub_lotatt10, b.lotatt11 as sub_lotatt11, b.lotatt12 as sub_lotatt12, b.lotatt13 as sub_lotatt13, b.lotatt14 as sub_lotatt14, b.lotatt15 as sub_lotatt15, b.lotatt16 as sub_lotatt16, b.lotatt17 as sub_lotatt17, b.lotatt18 as sub_lotatt18, b.pack_id as sub_pack_id, b.pick_zone as sub_pick_zone, b.location as sub_location, b.lotnum as sub_lotnum, b.remark as sub_remark, b.create_time as sub_create_time, b.create_by as sub_create_by, b.update_time as sub_update_time, b.update_by as sub_update_by, b.net_weight as sub_net_weight, b.gross_weight as sub_gross_weight, b.cubic as sub_cubic, b.d_edi_01 as sub_d_edi_01, b.d_edi_02 as sub_d_edi_02, b.d_edi_03 as sub_d_edi_03, b.d_edi_04 as sub_d_edi_04, b.d_edi_05 as sub_d_edi_05, b.d_edi_06 as sub_d_edi_06, b.d_edi_07 as sub_d_edi_07, b.d_edi_08 as sub_d_edi_08, b.d_edi_09 as sub_d_edi_09, b.d_edi_10 as sub_d_edi_10, b.d_edi_11 as sub_d_edi_11, b.d_edi_12 as sub_d_edi_12, b.d_edi_13 as sub_d_edi_13, b.d_edi_14 as sub_d_edi_14, b.d_edi_15 as sub_d_edi_15, b.d_edi_16 as sub_d_edi_16, b.d_edi_17 as sub_d_edi_17, b.d_edi_18 as sub_d_edi_18, b.d_edi_19 as sub_d_edi_19, b.d_edi_20 as sub_d_edi_20, b.trace_id as sub_trace_id, b.soft_allocation_rule as sub_soft_allocation_rule, b.allocation_rule as sub_allocation_rule, b.userdefine1 as sub_userdefine1, b.userdefine2 as sub_userdefine2, b.userdefine3 as sub_userdefine3, b.userdefine4 as sub_userdefine4, b.userdefine5 as sub_userdefine5
  160. from wms_doc_order_header a
  161. left join wms_doc_order_details b on b.order_no = a.order_no
  162. where a.order_no = #{orderNo}
  163. </select>
  164. <select id="selectWmsDocOrderHeaderByErpNo" parameterType="String" resultMap="WmsDocOrderHeaderResult">
  165. select *
  166. from wms_doc_order_header
  167. where so_reference1= #{erpNo}
  168. order by create_time desc
  169. limit 1
  170. </select>
  171. <insert id="insertWmsDocOrderHeader" parameterType="WmsDocOrderHeader">
  172. insert into wms_doc_order_header
  173. <trim prefix="(" suffix=")" suffixOverrides=",">
  174. <if test="orderNo != null">order_no,</if>
  175. <if test="customerId != null and customerId != ''">customer_id,</if>
  176. <if test="orderStatus != null and orderStatus != ''">order_status,</if>
  177. <if test="orderType != null">order_type,</if>
  178. <if test="soReference1 != null">so_reference1,</if>
  179. <if test="soReference2 != null">so_reference2,</if>
  180. <if test="soReference3 != null">so_reference3,</if>
  181. <if test="priority != null">priority,</if>
  182. <if test="consigneeId != null">consignee_id,</if>
  183. <if test="consigneeName != null">consignee_name,</if>
  184. <if test="cusCountry != null">cus_country,</if>
  185. <if test="cusProvince != null">cus_province,</if>
  186. <if test="cusCity != null">cus_city,</if>
  187. <if test="cusDistrict != null">cus_district,</if>
  188. <if test="cusAddress != null">cus_address,</if>
  189. <if test="cusContact != null">cus_contact,</if>
  190. <if test="cusPostcode != null">cus_postcode,</if>
  191. <if test="cusEmail != null">cus_email,</if>
  192. <if test="carrierId != null">carrier_id,</if>
  193. <if test="shipmentTime != null">shipment_time,</if>
  194. <if test="carrierName != null">carrier_name,</if>
  195. <if test="deliveryNo != null">delivery_no,</if>
  196. <if test="ediSendFlag != null">edi_send_flag,</if>
  197. <if test="remark != null">remark,</if>
  198. <if test="warehouseId != null">warehouse_id,</if>
  199. <if test="userdefine1 != null">userdefine1,</if>
  200. <if test="userdefine2 != null">userdefine2,</if>
  201. <if test="userdefine3 != null">userdefine3,</if>
  202. <if test="userdefine4 != null">userdefine4,</if>
  203. <if test="userdefine5 != null">userdefine5,</if>
  204. <if test="userdefine6 != null">userdefine6,</if>
  205. <if test="createTime != null">create_time,</if>
  206. <if test="createBy != null">create_by,</if>
  207. <if test="updateTime != null">update_time,</if>
  208. <if test="updateBy != null">update_by,</if>
  209. <if test="hEdi01 != null">h_edi_01,</if>
  210. <if test="hEdi02 != null">h_edi_02,</if>
  211. <if test="hEdi03 != null">h_edi_03,</if>
  212. <if test="hEdi04 != null">h_edi_04,</if>
  213. <if test="hEdi05 != null">h_edi_05,</if>
  214. <if test="hEdi06 != null">h_edi_06,</if>
  215. <if test="hEdi07 != null">h_edi_07,</if>
  216. <if test="hEdi08 != null">h_edi_08,</if>
  217. <if test="hEdi09 != null">h_edi_09,</if>
  218. <if test="hEdi10 != null">h_edi_10,</if>
  219. <if test="hEdi11 != null">h_edi_11,</if>
  220. <if test="hEdi12 != null">h_edi_12,</if>
  221. <if test="hEdi13 != null">h_edi_13,</if>
  222. <if test="hEdi14 != null">h_edi_14,</if>
  223. <if test="hEdi15 != null">h_edi_15,</if>
  224. </trim>
  225. <trim prefix="values (" suffix=")" suffixOverrides=",">
  226. <if test="orderNo != null">#{orderNo},</if>
  227. <if test="customerId != null and customerId != ''">#{customerId},</if>
  228. <if test="orderStatus != null and orderStatus != ''">#{orderStatus},</if>
  229. <if test="orderType != null">#{orderType},</if>
  230. <if test="soReference1 != null">#{soReference1},</if>
  231. <if test="soReference2 != null">#{soReference2},</if>
  232. <if test="soReference3 != null">#{soReference3},</if>
  233. <if test="priority != null">#{priority},</if>
  234. <if test="consigneeId != null">#{consigneeId},</if>
  235. <if test="consigneeName != null">#{consigneeName},</if>
  236. <if test="cusCountry != null">#{cusCountry},</if>
  237. <if test="cusProvince != null">#{cusProvince},</if>
  238. <if test="cusCity != null">#{cusCity},</if>
  239. <if test="cusDistrict != null">#{cusDistrict},</if>
  240. <if test="cusAddress != null">#{cusAddress},</if>
  241. <if test="cusContact != null">#{cusContact},</if>
  242. <if test="cusPostcode != null">#{cusPostcode},</if>
  243. <if test="cusEmail != null">#{cusEmail},</if>
  244. <if test="carrierId != null">#{carrierId},</if>
  245. <if test="shipmentTime != null">#{shipmentTime},</if>
  246. <if test="carrierName != null">#{carrierName},</if>
  247. <if test="deliveryNo != null">#{deliveryNo},</if>
  248. <if test="ediSendFlag != null">#{ediSendFlag},</if>
  249. <if test="remark != null">#{remark},</if>
  250. <if test="warehouseId != null">#{warehouseId},</if>
  251. <if test="userdefine1 != null">#{userdefine1},</if>
  252. <if test="userdefine2 != null">#{userdefine2},</if>
  253. <if test="userdefine3 != null">#{userdefine3},</if>
  254. <if test="userdefine4 != null">#{userdefine4},</if>
  255. <if test="userdefine5 != null">#{userdefine5},</if>
  256. <if test="userdefine6 != null">#{userdefine6},</if>
  257. <if test="createTime != null">#{createTime},</if>
  258. <if test="createBy != null">#{createBy},</if>
  259. <if test="updateTime != null">#{updateTime},</if>
  260. <if test="updateBy != null">#{updateBy},</if>
  261. <if test="hEdi01 != null">#{hEdi01},</if>
  262. <if test="hEdi02 != null">#{hEdi02},</if>
  263. <if test="hEdi03 != null">#{hEdi03},</if>
  264. <if test="hEdi04 != null">#{hEdi04},</if>
  265. <if test="hEdi05 != null">#{hEdi05},</if>
  266. <if test="hEdi06 != null">#{hEdi06},</if>
  267. <if test="hEdi07 != null">#{hEdi07},</if>
  268. <if test="hEdi08 != null">#{hEdi08},</if>
  269. <if test="hEdi09 != null">#{hEdi09},</if>
  270. <if test="hEdi10 != null">#{hEdi10},</if>
  271. <if test="hEdi11 != null">#{hEdi11},</if>
  272. <if test="hEdi12 != null">#{hEdi12},</if>
  273. <if test="hEdi13 != null">#{hEdi13},</if>
  274. <if test="hEdi14 != null">#{hEdi14},</if>
  275. <if test="hEdi15 != null">#{hEdi15},</if>
  276. </trim>
  277. </insert>
  278. <update id="updateWmsDocOrderHeader" parameterType="WmsDocOrderHeader">
  279. update wms_doc_order_header
  280. <trim prefix="SET" suffixOverrides=",">
  281. <if test="customerId != null and customerId != ''">customer_id = #{customerId},</if>
  282. <if test="orderStatus != null and orderStatus != ''">order_status = #{orderStatus},</if>
  283. <if test="orderType != null">order_type = #{orderType},</if>
  284. <if test="soReference1 != null">so_reference1 = #{soReference1},</if>
  285. <if test="soReference2 != null">so_reference2 = #{soReference2},</if>
  286. <if test="soReference3 != null">so_reference3 = #{soReference3},</if>
  287. <if test="priority != null">priority = #{priority},</if>
  288. <if test="consigneeId != null">consignee_id = #{consigneeId},</if>
  289. <if test="consigneeName != null">consignee_name = #{consigneeName},</if>
  290. <if test="cusCountry != null">cus_country = #{cusCountry},</if>
  291. <if test="cusProvince != null">cus_province = #{cusProvince},</if>
  292. <if test="cusCity != null">cus_city = #{cusCity},</if>
  293. <if test="cusDistrict != null">cus_district = #{cusDistrict},</if>
  294. <if test="cusAddress != null">cus_address = #{cusAddress},</if>
  295. <if test="cusContact != null">cus_contact = #{cusContact},</if>
  296. <if test="cusPostcode != null">cus_postcode = #{cusPostcode},</if>
  297. <if test="cusEmail != null">cus_email = #{cusEmail},</if>
  298. <if test="carrierId != null">carrier_id = #{carrierId},</if>
  299. <if test="shipmentTime != null">shipment_time = #{shipmentTime},</if>
  300. <if test="carrierName != null">carrier_name = #{carrierName},</if>
  301. <if test="deliveryNo != null">delivery_no = #{deliveryNo},</if>
  302. <if test="ediSendFlag != null">edi_send_flag = #{ediSendFlag},</if>
  303. <if test="remark != null">remark = #{remark},</if>
  304. <if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
  305. <if test="userdefine1 != null">userdefine1 = #{userdefine1},</if>
  306. <if test="userdefine2 != null">userdefine2 = #{userdefine2},</if>
  307. <if test="userdefine3 != null">userdefine3 = #{userdefine3},</if>
  308. <if test="userdefine4 != null">userdefine4 = #{userdefine4},</if>
  309. <if test="userdefine5 != null">userdefine5 = #{userdefine5},</if>
  310. <if test="userdefine6 != null">userdefine6 = #{userdefine6},</if>
  311. <if test="createTime != null">create_time = #{createTime},</if>
  312. <if test="createBy != null">create_by = #{createBy},</if>
  313. <if test="updateTime != null">update_time = #{updateTime},</if>
  314. <if test="updateBy != null">update_by = #{updateBy},</if>
  315. <if test="hEdi01 != null">h_edi_01 = #{hEdi01},</if>
  316. <if test="hEdi02 != null">h_edi_02 = #{hEdi02},</if>
  317. <if test="hEdi03 != null">h_edi_03 = #{hEdi03},</if>
  318. <if test="hEdi04 != null">h_edi_04 = #{hEdi04},</if>
  319. <if test="hEdi05 != null">h_edi_05 = #{hEdi05},</if>
  320. <if test="hEdi06 != null">h_edi_06 = #{hEdi06},</if>
  321. <if test="hEdi07 != null">h_edi_07 = #{hEdi07},</if>
  322. <if test="hEdi08 != null">h_edi_08 = #{hEdi08},</if>
  323. <if test="hEdi09 != null">h_edi_09 = #{hEdi09},</if>
  324. <if test="hEdi10 != null">h_edi_10 = #{hEdi10},</if>
  325. <if test="hEdi11 != null">h_edi_11 = #{hEdi11},</if>
  326. <if test="hEdi12 != null">h_edi_12 = #{hEdi12},</if>
  327. <if test="hEdi13 != null">h_edi_13 = #{hEdi13},</if>
  328. <if test="hEdi14 != null">h_edi_14 = #{hEdi14},</if>
  329. <if test="hEdi15 != null">h_edi_15 = #{hEdi15},</if>
  330. </trim>
  331. where order_no = #{orderNo}
  332. </update>
  333. <delete id="deleteWmsDocOrderHeaderByOrderNo" parameterType="String">
  334. delete from wms_doc_order_header where order_no = #{orderNo}
  335. </delete>
  336. <delete id="deleteWmsDocOrderHeaderByOrderNos" parameterType="String">
  337. delete from wms_doc_order_header where order_no in
  338. <foreach item="orderNo" collection="array" open="(" separator="," close=")">
  339. #{orderNo}
  340. </foreach>
  341. </delete>
  342. <delete id="deleteWmsDocOrderDetailsByOrderNos" parameterType="String">
  343. delete from wms_doc_order_details where order_no in
  344. <foreach item="orderNo" collection="array" open="(" separator="," close=")">
  345. #{orderNo}
  346. </foreach>
  347. </delete>
  348. <delete id="deleteWmsDocOrderDetailsByOrderNo" parameterType="String">
  349. delete from wms_doc_order_details where order_no = #{orderNo}
  350. </delete>
  351. <insert id="batchWmsDocOrderDetails">
  352. insert into wms_doc_order_details( order_no, order_line_no, customer_id, sku, line_status, qty_ordered, qty_ordered_each, qty_soft_allocated, qty_softallocated_each, qty_allocated, qty_allocated_each, qty_picked, qty_picked_each, qty_packed, qty_packed_each, qty_shipped, qty_shipped_each, uom, lotatt01, lotatt02, lotatt03, lotatt04, lotatt05, lotatt06, lotatt07, lotatt08, lotatt09, lotatt10, lotatt11, lotatt12, lotatt13, lotatt14, lotatt15, lotatt16, lotatt17, lotatt18, pack_id, pick_zone, location, lotnum, remark, create_time, create_by, update_time, update_by, net_weight, gross_weight, cubic, d_edi_01, d_edi_02, d_edi_03, d_edi_04, d_edi_05, d_edi_06, d_edi_07, d_edi_08, d_edi_09, d_edi_10, d_edi_11, d_edi_12, d_edi_13, d_edi_14, d_edi_15, d_edi_16, d_edi_17, d_edi_18, d_edi_19, d_edi_20, trace_id, soft_allocation_rule, allocation_rule, userdefine1, userdefine2, userdefine3, userdefine4, userdefine5) values
  353. <foreach item="item" index="index" collection="list" separator=",">
  354. ( #{item.orderNo}, #{item.orderLineNo}, #{item.customerId}, #{item.sku}, #{item.lineStatus}, #{item.qtyOrdered}, #{item.qtyOrderedEach}, #{item.qtySoftAllocated}, #{item.qtySoftallocatedEach}, #{item.qtyAllocated}, #{item.qtyAllocatedEach}, #{item.qtyPicked}, #{item.qtyPickedEach}, #{item.qtyPacked}, #{item.qtyPackedEach}, #{item.qtyShipped}, #{item.qtyShippedEach}, #{item.uom}, #{item.lotatt01}, #{item.lotatt02}, #{item.lotatt03}, #{item.lotatt04}, #{item.lotatt05}, #{item.lotatt06}, #{item.lotatt07}, #{item.lotatt08}, #{item.lotatt09}, #{item.lotatt10}, #{item.lotatt11}, #{item.lotatt12}, #{item.lotatt13}, #{item.lotatt14}, #{item.lotatt15}, #{item.lotatt16}, #{item.lotatt17}, #{item.lotatt18}, #{item.packId}, #{item.pickZone}, #{item.location}, #{item.lotnum}, #{item.remark}, #{item.createTime}, #{item.createBy}, #{item.updateTime}, #{item.updateBy}, #{item.netWeight}, #{item.grossWeight}, #{item.cubic}, #{item.dEdi01}, #{item.dEdi02}, #{item.dEdi03}, #{item.dEdi04}, #{item.dEdi05}, #{item.dEdi06}, #{item.dEdi07}, #{item.dEdi08}, #{item.dEdi09}, #{item.dEdi10}, #{item.dEdi11}, #{item.dEdi12}, #{item.dEdi13}, #{item.dEdi14}, #{item.dEdi15}, #{item.dEdi16}, #{item.dEdi17}, #{item.dEdi18}, #{item.dEdi19}, #{item.dEdi20}, #{item.traceId}, #{item.softAllocationRule}, #{item.allocationRule}, #{item.userdefine1}, #{item.userdefine2}, #{item.userdefine3}, #{item.userdefine4}, #{item.userdefine5})
  355. </foreach>
  356. </insert>
  357. <select id="selectLineNo" parameterType="String" resultType="long">
  358. select ifnull(max(order_line_no),0) from wms_doc_order_details where order_no = #{orderNo}
  359. </select>
  360. <select id="selectCheckOutList" parameterType="java.util.List" resultMap="CheckOutVOResult">
  361. select
  362. de.order_no,b.location_no,att.lotatt07 palletNo
  363. from wms_doc_order_details de
  364. left join base_sku sk on de.sku = sk.sku
  365. left join act_allocation_details act on de.order_no = act.order_no and de.order_line_no = act.line_no
  366. right join inv_lot_loc_id lotinv on lotinv.sku = de.sku and lotinv.lotnum = act.lotnum and lotinv.location_id = act.location_id
  367. left join inv_lot_att att on act.lotnum = att.lotnum
  368. left join base_location_info b on b.id = act.location_id
  369. where de.order_no in
  370. <foreach item="orderNo" collection="list" open="(" separator="," close=")">
  371. #{orderNo}
  372. </foreach>
  373. and act.`status` = '20' and b.stock_status = '00' and b.is_empty = 'N'
  374. group by de.order_no,b.location_no,att.lotatt07
  375. </select>
  376. </mapper>