|
|
|
@ -44,15 +44,29 @@ |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="searchCoDelPalletData" resultType="java.util.Map"> |
|
|
|
select c.salesOrder as salesOrder,b.po_no as customerPO,b.part_no,b.qty, |
|
|
|
a.box_qty as boxQty,b.rolls,b.pn,a.gross_weight as grossWeight,a.net_weight as netWeight, |
|
|
|
#{cmcInvoice} as cmcInvoice,#{shippingMode} as shippingMode,#{destination} as destination, |
|
|
|
c.cmc_comment,CONVERT(varchar(10), #{readyDate}, 120) AS readyDate, |
|
|
|
CASE WHEN c.modifyFlag = 1 THEN '是' ELSE '否' END AS modifyFlagString |
|
|
|
from ecss_CoDelBoxList a |
|
|
|
left join ecss_CoDelPalletDetail b on a.site=b.site and a.bu_no=b.bu_no and a.delNo=b.delNo and a.item_no=b.seq_no |
|
|
|
left join ecss_CoDelNotifydetail c on b.site=c.site and b.bu_no=c.bu_no and b.delNo=c.delNo and b.notify_detail_item_no=c.item_no |
|
|
|
where a.site=#{site} and a.bu_no=#{buNo} and a.delNo=#{delNo} and b.site is not null |
|
|
|
SELECT t.salesOrder, t.customerPO, t.part_no, t.qty, |
|
|
|
CASE WHEN t.rn = 1 THEN t.box_qty ELSE NULL END AS boxQty, |
|
|
|
t.rolls, t.pn, |
|
|
|
CASE WHEN t.rn = 1 THEN t.grossWeight ELSE NULL END AS grossWeight, |
|
|
|
CASE WHEN t.rn = 1 THEN t.netWeight ELSE NULL END AS netWeight, |
|
|
|
t.cmcInvoice, t.shippingMode, t.destination, |
|
|
|
t.cmc_comment, t.readyDate, t.modifyFlagString |
|
|
|
FROM ( |
|
|
|
SELECT c.salesOrder AS salesOrder, b.po_no AS customerPO, b.part_no, b.qty, |
|
|
|
a.box_qty, b.rolls, b.pn, |
|
|
|
a.gross_weight AS grossWeight, a.net_weight AS netWeight, |
|
|
|
#{cmcInvoice} AS cmcInvoice, #{shippingMode} AS shippingMode, #{destination} AS destination, |
|
|
|
c.cmc_comment, CONVERT(varchar(10), #{readyDate}, 120) AS readyDate, |
|
|
|
CASE WHEN c.modifyFlag = 1 THEN '是' ELSE '否' END AS modifyFlagString, |
|
|
|
ROW_NUMBER() OVER ( |
|
|
|
PARTITION BY a.site, a.bu_no, a.delNo, a.item_no |
|
|
|
ORDER BY b.notify_detail_item_no |
|
|
|
) AS rn |
|
|
|
FROM ecss_CoDelBoxList a |
|
|
|
LEFT JOIN ecss_CoDelPalletDetail b ON a.site=b.site AND a.bu_no=b.bu_no AND a.delNo=b.delNo AND a.item_no=b.seq_no |
|
|
|
LEFT JOIN ecss_CoDelNotifydetail c ON b.site=c.site AND b.bu_no=c.bu_no AND b.delNo=c.delNo AND b.notify_detail_item_no=c.item_no |
|
|
|
WHERE a.site=#{site} AND a.bu_no=#{buNo} AND a.delNo=#{delNo} AND b.site IS NOT NULL |
|
|
|
) t |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="searchEcssCoDelNotifyDetailList" resultType="java.util.Map"> |
|
|
|
|