diff --git a/src/main/resources/mapper/inboundNotification/InboundNotificationHeadMapper.xml b/src/main/resources/mapper/inboundNotification/InboundNotificationHeadMapper.xml index 2f112c2..42f3aa5 100644 --- a/src/main/resources/mapper/inboundNotification/InboundNotificationHeadMapper.xml +++ b/src/main/resources/mapper/inboundNotification/InboundNotificationHeadMapper.xml @@ -14,7 +14,7 @@ SUM(CASE WHEN pr.hardtag_in_flag = '已入库' THEN 1 ELSE 0 END) AS labelinCount, -- 已入库标签数 COUNT(DISTINCT pr.roll_no) AS totalLabels, -- 需入库标签数 SUM(CASE WHEN pr.hardtag_in_flag = '已入库' THEN ISNULL(pr.roll_qty, 0) ELSE 0 END) AS totalinLabels, -- 已入库物料总数 - SUM(CAST(D.required_qty AS float)) as labelCount --需入库总数 + D.required_qty as labelCount --需入库总数 FROM inbound_notification_head h INNER JOIN inbound_notification_detail d ON h.site = d.site and h.bu_no = d.bu_no and h.order_no = d.order_no LEFT JOIN po_order_roll_no pr ON d.site = pr.site and d.bu_no = pr.bu_no and d.inspection_no = pr.inspection_no AND d.part_no = pr.part_no @@ -29,7 +29,7 @@ AND CONVERT(DATE, h.required_inbound_date) = CONVERT(DATE, GETDATE()) - GROUP BY h.site,h.bu_no,h.order_no,h.required_inbound_date + GROUP BY h.site,h.bu_no,h.order_no,h.required_inbound_date ,D.required_qty ORDER BY h.required_inbound_date DESC @@ -46,7 +46,7 @@ SUM(CASE WHEN hardtag_in_flag = '已入库' then 1 else 0 end) labelinCount, --已入库标签数 COUNT(DISTINCT pr.roll_no) as totalLabels , --需入库标签数 SUM(CASE WHEN hardtag_in_flag = '已入库' then CAST(roll_qty AS float) else 0 end) totalinLabels,--已入库物料总数 - SUM(CAST(D.required_qty AS float)) as labelCount --需入库总数 + D.required_qty as labelCount --需入库总数 FROM inbound_notification_head h INNER JOIN inbound_notification_detail d ON h.site = d.site and h.bu_no = d.bu_no and h.order_no = d.order_no LEFT JOIN po_order_roll_no pr ON d.site = pr.site and d.bu_no = pr.bu_no and d.inspection_no = pr.inspection_no AND d.part_no = pr.part_no @@ -54,7 +54,7 @@ h.site = #{site} AND h.bu_no = #{buNo} AND h.order_no = #{orderNo} - GROUP BY h.order_no, h.site, h.bu_no, h.required_inbound_date + GROUP BY h.order_no, h.site, h.bu_no, h.required_inbound_date,D.required_qty @@ -74,11 +74,11 @@ SELECT d.site, d.bu_no,d.part_no as partNo,d.part_desc, SUM(CASE WHEN hardtag_in_flag = '已入库' then CAST(roll_qty AS float) else 0 end) totalinLabels,--已入库数 - SUM(CAST(D.required_qty AS float)) as labelCount --需求数量 + D.required_qty as labelCount --需入库总数 FROM inbound_notification_detail d LEFT JOIN po_order_roll_no pr ON d.site = pr.site and d.bu_no = pr.bu_no and d.inspection_no = pr.inspection_no AND d.part_no = pr.part_no WHERE d.SITE = #{site} AND d.bu_no = #{buNo} AND d.order_no = #{inboundNo} - group by d.site, d.bu_no,d.part_no, d.part_desc + group by d.site, d.bu_no,d.part_no, d.part_desc,D.required_qty