及时库存查询;
This commit is contained in:
@@ -533,10 +533,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND d.del_flag = 1
|
||||
LEFT JOIN stock_in_order e ON d.in_order_number = e.in_order_number
|
||||
WHERE
|
||||
c.del_flag = 1
|
||||
c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 3
|
||||
AND e.warehouse_id = a.warehouse_id
|
||||
AND (a.shipper_id IS NULL OR e.shipper_id = a.shipper_id)
|
||||
AND c.material_base_info_id = a.material_base_info_id
|
||||
and (c.BATCH_REF_NO = a.batch_ref_no or (c.BATCH_REF_NO is null and a.BATCH_REF_NO is null))
|
||||
and (c.SHEET_REF_NO = a.sheet_ref_no or (c.SHEET_REF_NO is null and a.SHEET_REF_NO is null))
|
||||
and (c.BOX_PALLET_NO = a.BOX_PALLET_NO or (c.BOX_PALLET_NO is null and a.BOX_PALLET_NO is null))
|
||||
and (c.EXT_ATTR_1 = a.EXT_ATTR_1 or (c.EXT_ATTR_1 is null and a.EXT_ATTR_1 is null))
|
||||
and (c.EXT_ATTR_2 = a.EXT_ATTR_2 or (c.EXT_ATTR_2 is null and a.EXT_ATTR_2 is null))
|
||||
and (c.EXT_ATTR_3 = a.EXT_ATTR_3 or (c.EXT_ATTR_3 is null and a.EXT_ATTR_3 is null))
|
||||
and (c.EXT_ATTR_4 = a.EXT_ATTR_4 or (c.EXT_ATTR_4 is null and a.EXT_ATTR_4 is null))
|
||||
and (c.PRODUCTION_DATE = a.PRODUCTION_DATE or (c.PRODUCTION_DATE is null and a.PRODUCTION_DATE is null))
|
||||
and (c.EXPIRY_DATE = a.EXPIRY_DATE or (c.EXPIRY_DATE is null and a.EXPIRY_DATE is null))
|
||||
and (c.INVENTORY_DATE = a.INVENTORY_DATE or (c.INVENTORY_DATE is null and a.INVENTORY_DATE is null))
|
||||
),
|
||||
0
|
||||
)> #{receivedQuantityStart}
|
||||
@@ -553,10 +563,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND d.del_flag = 1
|
||||
LEFT JOIN stock_in_order e ON d.in_order_number = e.in_order_number
|
||||
WHERE
|
||||
c.del_flag = 1
|
||||
c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 3
|
||||
AND e.warehouse_id = a.warehouse_id
|
||||
AND (a.shipper_id IS NULL OR e.shipper_id = a.shipper_id)
|
||||
AND c.material_base_info_id = a.material_base_info_id
|
||||
and (c.BATCH_REF_NO = a.batch_ref_no or (c.BATCH_REF_NO is null and a.BATCH_REF_NO is null))
|
||||
and (c.SHEET_REF_NO = a.sheet_ref_no or (c.SHEET_REF_NO is null and a.SHEET_REF_NO is null))
|
||||
and (c.BOX_PALLET_NO = a.BOX_PALLET_NO or (c.BOX_PALLET_NO is null and a.BOX_PALLET_NO is null))
|
||||
and (c.EXT_ATTR_1 = a.EXT_ATTR_1 or (c.EXT_ATTR_1 is null and a.EXT_ATTR_1 is null))
|
||||
and (c.EXT_ATTR_2 = a.EXT_ATTR_2 or (c.EXT_ATTR_2 is null and a.EXT_ATTR_2 is null))
|
||||
and (c.EXT_ATTR_3 = a.EXT_ATTR_3 or (c.EXT_ATTR_3 is null and a.EXT_ATTR_3 is null))
|
||||
and (c.EXT_ATTR_4 = a.EXT_ATTR_4 or (c.EXT_ATTR_4 is null and a.EXT_ATTR_4 is null))
|
||||
and (c.PRODUCTION_DATE = a.PRODUCTION_DATE or (c.PRODUCTION_DATE is null and a.PRODUCTION_DATE is null))
|
||||
and (c.EXPIRY_DATE = a.EXPIRY_DATE or (c.EXPIRY_DATE is null and a.EXPIRY_DATE is null))
|
||||
and (c.INVENTORY_DATE = a.INVENTORY_DATE or (c.INVENTORY_DATE is null and a.INVENTORY_DATE is null))
|
||||
),
|
||||
0
|
||||
) < #{receivedQuantityEnd}
|
||||
@@ -609,12 +629,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
sum( c.picking_quantity )
|
||||
FROM
|
||||
picking_material_detail c
|
||||
LEFT JOIN picking_order d ON c.picking_order_number = d.order_number
|
||||
LEFT JOIN picking_order d ON c.picking_order_number = d.PICKING_ORDER_NUMBER
|
||||
left join STOCK_OUT_ORDER e ON d.ORDER_NUMBER = e.OUT_ORDER_NUMBER
|
||||
WHERE
|
||||
c.del_flag = 1
|
||||
c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 7
|
||||
AND d.warehouse_id = a.warehouse_id
|
||||
AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id)
|
||||
AND c.material_base_info_id = a.material_base_info_id
|
||||
AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID
|
||||
),
|
||||
0
|
||||
) > #{pickQuantityStart}
|
||||
@@ -627,12 +649,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
sum( c.picking_quantity )
|
||||
FROM
|
||||
picking_material_detail c
|
||||
LEFT JOIN picking_order d ON c.picking_order_number = d.order_number
|
||||
LEFT JOIN picking_order d ON c.picking_order_number = d.PICKING_ORDER_NUMBER
|
||||
left join STOCK_OUT_ORDER e ON d.ORDER_NUMBER = e.OUT_ORDER_NUMBER
|
||||
WHERE
|
||||
c.del_flag = 1
|
||||
c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 7
|
||||
AND d.warehouse_id = a.warehouse_id
|
||||
AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id)
|
||||
AND c.material_base_info_id = a.material_base_info_id
|
||||
AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID
|
||||
),
|
||||
0
|
||||
) < #{pickQuantityEnd}
|
||||
@@ -653,13 +677,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
FROM
|
||||
OUT_MATERIAL_DETAIL c
|
||||
LEFT JOIN STOCK_OUT_ORDER d ON c.OUT_ORDER_NUMBER = d.OUT_ORDER_NUMBER
|
||||
LEFT JOIN HANDOVER_TASK_ORDER e ON d.OUT_ORDER_NUMBER = e.ORDER_NUMBER
|
||||
WHERE
|
||||
d.CHECK_STATUS = 2
|
||||
d.CHECK_STATUS = 2 and e.STATUS = 1
|
||||
AND d.DEL_FLAG = 1
|
||||
AND c.DEL_FLAG = 1
|
||||
and e.del_flag = 1
|
||||
AND d.warehouse_id = a.warehouse_id
|
||||
AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id)
|
||||
AND c.material_base_info_id = a.material_base_info_id
|
||||
AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID
|
||||
),
|
||||
0
|
||||
) = #{checkQuantity}
|
||||
|
||||
Reference in New Issue
Block a user