Browse Source

2025-12-22

调整
master
fengyuan_yang 3 weeks ago
parent
commit
33fe83c5d4
  1. 10
      src/main/resources/mapper/outboundNotification/OutboundNotificationDetailMapper.xml

10
src/main/resources/mapper/outboundNotification/OutboundNotificationDetailMapper.xml

@ -110,9 +110,11 @@
a.PartNo, a.PartNo,
a.PartDescription as partDesc, a.PartDescription as partDesc,
a.UMID as unit, a.UMID as unit,
um.umName,
a.outbound_warehouse_id as outboundWarehouseId a.outbound_warehouse_id as outboundWarehouseId
FROM part as a FROM part as a
left join outbound_notification_detail as b on a.site = b.site and a.bu_no = b.bu_no and a.partNo = b.part_no and b.order_no = #{query.orderNo} left join outbound_notification_detail as b on a.site = b.site and a.bu_no = b.bu_no and a.partNo = b.part_no and b.order_no = #{query.orderNo}
left join um as um on a.site = um.site and a.UMID = um.UMID
where a.site = #{query.site} and a.bu_no = #{query.buNo} and b.site is null where a.site = #{query.site} and a.bu_no = #{query.buNo} and b.site is null
and a.PartNo not in and a.PartNo not in
<foreach collection="query.arr" close=")" open="(" item="item" separator=","> <foreach collection="query.arr" close=")" open="(" item="item" separator=",">
@ -175,24 +177,26 @@
a.part_desc as partDesc, a.part_desc as partDesc,
a.order_qty, a.order_qty,
b.umid as unit, b.umid as unit,
um.umName,
SUM(a.roll_qty) AS requiredQty -- 可出库数量 SUM(a.roll_qty) AS requiredQty -- 可出库数量
FROM po_order_roll_no a FROM po_order_roll_no a
INNER JOIN part b WITH (NOLOCK) ON a.site = b.site AND a.part_no = b.partno INNER JOIN part b WITH (NOLOCK) ON a.site = b.site AND a.part_no = b.partno
LEFT JOIN inventory_stock c WITH (NOLOCK) ON a.site = c.site AND a.roll_no = c.roll_no AND (c.status IN ('在库', '冻结') OR A.hardtag_in_flag ='未入库') LEFT JOIN inventory_stock c WITH (NOLOCK) ON a.site = c.site AND a.roll_no = c.roll_no AND (c.status IN ('在库', '冻结') OR A.hardtag_in_flag ='未入库')
left join um as um on a.site = um.site and b.umid = um.umid
where a.site = #{query.site} and a.bu_no = #{query.buNo} where a.site = #{query.site} and a.bu_no = #{query.buNo}
and a.Part_No not in and a.Part_No not in
<foreach collection="query.arr" close=")" open="(" item="item" separator=","> <foreach collection="query.arr" close=")" open="(" item="item" separator=",">
#{item} #{item}
</foreach> </foreach>
<if test = "query.relatedOrderNo != null and query.relatedOrderNo != ''"> <if test = "query.relatedOrderNo != null and query.relatedOrderNo != ''">
AND a.OrderNo like '%' + #{query.relatedOrderNo} + '%'
AND a.Order_No like '%' + #{query.relatedOrderNo} + '%'
</if> </if>
<if test = "query.partNo != null and query.partNo != ''"> <if test = "query.partNo != null and query.partNo != ''">
AND a.partNo like '%' + #{query.partNo} + '%'
AND a.Part_No like '%' + #{query.partNo} + '%'
</if> </if>
<if test = "query.partDesc != null and query.partDesc != ''"> <if test = "query.partDesc != null and query.partDesc != ''">
AND a.part_desc like '%' + #{query.partDesc} + '%' AND a.part_desc like '%' + #{query.partDesc} + '%'
</if> </if>
GROUP BY a.Site, a.bu_no, a.Order_No, a.item_no, a.Part_No, a.part_desc, a.order_qty, b.umid
GROUP BY a.Site, a.bu_no, a.Order_No, a.item_no, a.Part_No, a.part_desc, a.order_qty, b.umid, um.umName
</select> </select>
</mapper> </mapper>
Loading…
Cancel
Save