O
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

180 lines
5.7 KiB

1 year ago
8 months ago
1 year ago
6 months ago
1 year ago
1 year ago
6 months ago
6 months ago
7 months ago
6 months ago
1 year ago
6 months ago
8 months ago
1 year ago
2 months ago
1 year ago
1 year ago
1 year ago
10 months ago
1 year ago
1 year ago
10 months ago
1 year ago
10 months ago
1 year ago
  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="ecssMapper">
  4. <select id="searchTemplateList" resultType="EcssTemplate">
  5. select * from ecss_template
  6. <where>
  7. buNo=#{buNo}
  8. <if test="name != null and name != ''">
  9. and name like '%'+#{name}+'%'
  10. </if>
  11. <if test="type != null and type != ''">
  12. AND type = #{type}
  13. </if>
  14. <if test="customName != null and customName != ''">
  15. AND customName = #{customName}
  16. </if>
  17. <if test="shippingMode != null and shippingMode != ''">
  18. AND shippingMode like '%'+#{shippingMode}+'%'
  19. </if>
  20. </where>
  21. order by CreateDate desc
  22. </select>
  23. <select id="searchWalMartOrderList" resultType="EcssWalMartOrder">
  24. select * from ecss_walMartOrder
  25. <where>
  26. sku=#{sku} and qty=#{qty}
  27. <if test="so != null and so != ''">
  28. and so like '%'+#{so}+'%'
  29. </if>
  30. </where>
  31. </select>
  32. <select id="searchEcssCoDelNotifyDetail" resultType="java.util.Map">
  33. select
  34. a.*,
  35. #{cmcInvoice} as cmcInvoice,
  36. #{shippingMode} as shippingMode,
  37. #{destination} as destination,
  38. CONVERT(varchar(10), #{readyDate}, 120) AS readyDate,
  39. a.salesOrder as salesOrder,
  40. a.part_description as partDesc,
  41. CASE
  42. WHEN a.modifyFlag = 1
  43. THEN '改单' +
  44. CASE WHEN h.modify_count IS NOT NULL THEN '(' + CAST(h.modify_count AS VARCHAR(10)) + ')' ELSE '' END
  45. ELSE '否'
  46. END AS modifyFlagString
  47. from ecss_CoDelNotifydetail a
  48. LEFT JOIN ecss_CoDelNotifyHeader h
  49. ON a.site = h.site and a.bu_no = h.bu_no
  50. AND a.delNo = h.delNo
  51. <where>
  52. AND a.site = #{site}
  53. AND a.delNo = #{delNo}
  54. </where>
  55. order by a.item_no
  56. </select>
  57. <select id="searchCoDelPalletData" resultType="java.util.Map">
  58. SELECT
  59. t.salesOrder,
  60. t.customerPO,
  61. t.part_no,
  62. t.qty,
  63. CASE WHEN t.rn = 1 THEN t.box_qty ELSE NULL END AS boxQty,
  64. CASE WHEN t.rn = 1 THEN t.allRolls ELSE 0 END AS rolls,
  65. t.pn,
  66. CASE WHEN t.rn = 1 THEN t.grossWeight ELSE NULL END AS grossWeight,
  67. CASE WHEN t.rn = 1 THEN t.netWeight ELSE NULL END AS netWeight,
  68. t.cmcInvoice,
  69. t.shippingMode,
  70. t.destination,
  71. t.cmc_comment,
  72. t.readyDate,
  73. t.modifyFlagString,
  74. t.partDesc,
  75. t.notify_detail_item_no as item_no
  76. FROM (
  77. SELECT
  78. b.notify_detail_item_no,
  79. c.salesOrder AS salesOrder,
  80. c.part_description as partDesc,
  81. b.po_no AS customerPO,
  82. b.part_no,
  83. b.qty,
  84. a.box_qty,
  85. b.rolls,
  86. a.rolls as allRolls,
  87. b.pn,
  88. a.gross_weight AS grossWeight,
  89. a.net_weight AS netWeight,
  90. #{cmcInvoice} AS cmcInvoice,
  91. #{shippingMode} AS shippingMode,
  92. #{destination} AS destination,
  93. c.cmc_comment,
  94. CONVERT(varchar(10), #{readyDate}, 120) AS readyDate,
  95. CASE
  96. WHEN c.modifyFlag = 1 THEN
  97. '改单' +
  98. CASE
  99. WHEN h.modify_count IS NOT NULL THEN '(' + CAST(h.modify_count AS VARCHAR(10)) + ')'
  100. ELSE ''
  101. END
  102. ELSE '否'
  103. END AS modifyFlagString,
  104. ROW_NUMBER() OVER (
  105. PARTITION BY a.site, a.bu_no, a.delNo, a.item_no
  106. ORDER BY b.notify_detail_item_no
  107. ) AS rn
  108. FROM ecss_CoDelBoxList a
  109. LEFT JOIN ecss_CoDelPalletDetail b
  110. ON a.site = b.site
  111. AND a.bu_no = b.bu_no
  112. AND a.delNo = b.delNo
  113. AND a.item_no = b.seq_no
  114. LEFT JOIN ecss_CoDelNotifydetail c
  115. ON b.site = c.site
  116. AND b.bu_no = c.bu_no
  117. AND b.delNo = c.delNo
  118. AND b.notify_detail_item_no = c.item_no
  119. LEFT JOIN ecss_CoDelNotifyHeader h
  120. ON c.site = h.site and c.bu_no = h.bu_no
  121. AND c.delNo = h.delNo
  122. WHERE a.site = #{site}
  123. AND a.bu_no = #{buNo}
  124. AND a.delNo = #{delNo}
  125. AND b.site IS NOT NULL
  126. ) t
  127. </select>
  128. <select id="searchEcssCoDelNotifyDetailList" resultType="java.util.Map">
  129. select a.item_no,a.customerPO,a.part_no,a.part_description,a.currency,
  130. CONVERT(DECIMAL(20, 6), a.qty) as qty,CONVERT(DECIMAL(20, 5), a.tp) as unitPrice,b.hsCode,
  131. a.upc,a.salesOrder as so,a.ttl_amount,a.pn,h.hsCodeDesc,h.hsCodeDescEn,a.cmc_comment,
  132. CASE WHEN a.modifyFlag = 1 THEN '是' ELSE '否' END AS modifyFlag
  133. from ecss_CoDelNotifydetail a
  134. left join part b on a.site=b.site and a.part_no=b.part_no
  135. left join ecss_hsCode h on b.hsCode=h.HsCode and a.site=h.site and b.hsCodeDesc=h.hsCodeDesc and h.brand=b.brand
  136. <where>
  137. And a.site = #{site}
  138. AND a.delNo = #{delNo}
  139. and a.status != '取消发货'
  140. </where>
  141. order by a.item_no
  142. </select>
  143. <select id="getEcssCoDelNotifyDetailData" resultType="java.util.Map">
  144. select b.hsCodeDesc,b.hsCode,h.hsCodeDescEn
  145. from ecss_CoDelNotifyDetail a
  146. left join part b on a.site=b.site and a.part_no=b.part_no
  147. left join ecss_hsCode h on b.hsCode=h.HsCode and a.site=h.site and b.hsCodeDesc=h.hsCodeDesc
  148. where a.site =#{site} and a.delNo=#{delNo}
  149. GROUP BY b.hsCodeDesc,b.hsCode,h.hsCodeDescEn
  150. </select>
  151. <select id="getCustomerInfo" resultType="java.util.Map">
  152. select DISTINCT vcus.ccusname,vcusp.ccontactname,vcusp.cnative
  153. from ecss_custdev_mes_cmc_customer vcus
  154. LEFT JOIN ecss_custdev_mes_cmc_customer_person vcusp on vcus.ccuscode=vcusp.ccuscode
  155. where vcus.ccusname=#{ccusname}
  156. </select>
  157. <select id="getCustomerAdd" resultType="java.util.Map">
  158. select DISTINCT vcus.ccusname,vcusa.cDeliverAdd,vcusa.cDeliverUnit, vcus.country,vcusa.deliverycountry
  159. from ecss_custdev_mes_cmc_customer vcus
  160. left join ecss_custdev_mes_cmc_customer_addr vcusa on vcus.ccuscode=vcusa.ccuscode
  161. where vcus.ccusname=#{ccusname}
  162. </select>
  163. <select id="getCustomerList" resultType="java.util.Map">
  164. select * from ecss_custdev_mes_cmc_customer
  165. <where>
  166. <if test="ccusname != null and ccusname != ''">
  167. and ccusname like '%'+#{ccusname}+'%'
  168. </if>
  169. </where>
  170. </select>
  171. </mapper>