1
This commit is contained in:
@@ -103,12 +103,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
w.warehouse_name,
|
||||
COUNT(mc.coil_id) as coil_count,
|
||||
COALESCE(SUM(mc.gross_weight), 0) as total_gross_weight,
|
||||
COALESCE(SUM(mc.net_weight), 0) as total_net_weight
|
||||
COALESCE(SUM(mc.net_weight), 0) as total_net_weight,
|
||||
CASE
|
||||
WHEN mc.item_type = 'raw_material' THEN rm.raw_material_name
|
||||
WHEN mc.item_type = 'product' THEN p.product_name
|
||||
ELSE NULL
|
||||
END as itemName,
|
||||
CASE
|
||||
WHEN mc.item_type = 'raw_material' THEN rm.raw_material_code
|
||||
WHEN mc.item_type = 'product' THEN p.product_code
|
||||
ELSE NULL
|
||||
END as itemCode
|
||||
FROM wms_material_coil mc
|
||||
LEFT JOIN wms_warehouse w ON mc.warehouse_id = w.warehouse_id
|
||||
LEFT JOIN wms_raw_material rm ON mc.item_type = 'raw_material' AND mc.item_id = rm.raw_material_id
|
||||
LEFT JOIN wms_product p ON mc.item_type = 'product' AND mc.item_id = p.product_id
|
||||
WHERE mc.data_type = 1
|
||||
AND mc.del_flag = '0'
|
||||
AND (w.del_flag = '0' OR w.del_flag IS NULL)
|
||||
and (mc.material_type='成品' or mc.material_type='原料')
|
||||
and mc.status!=1
|
||||
<if test="itemType != null and itemType != ''">
|
||||
AND mc.item_type = #{itemType}
|
||||
</if>
|
||||
@@ -123,17 +137,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
w.warehouse_name AS warehouseName,
|
||||
aw.warehouse_name AS actualWarehouseName,
|
||||
CASE
|
||||
WHEN mc.item_type = 'row_material' THEN rm.raw_material_name
|
||||
WHEN mc.item_type = 'raw_material' THEN rm.raw_material_name
|
||||
WHEN mc.item_type = 'product' THEN p.product_name
|
||||
ELSE NULL
|
||||
END as itemName,
|
||||
CASE
|
||||
WHEN mc.item_type = 'row_material' THEN rm.raw_material_code
|
||||
WHEN mc.item_type = 'raw_material' THEN rm.raw_material_code
|
||||
WHEN mc.item_type = 'product' THEN p.product_code
|
||||
ELSE NULL
|
||||
END as itemCode
|
||||
FROM wms_material_coil mc
|
||||
LEFT JOIN wms_raw_material rm ON mc.item_type = 'row_material' AND mc.item_id = rm.raw_material_id
|
||||
LEFT JOIN wms_raw_material rm ON mc.item_type = 'raw_material' AND mc.item_id = rm.raw_material_id
|
||||
LEFT JOIN wms_product p ON mc.item_type = 'product' AND mc.item_id = p.product_id
|
||||
LEFT JOIN wms_warehouse w ON mc.warehouse_id = w.warehouse_id
|
||||
LEFT JOIN wms_actual_warehouse aw ON mc.actual_warehouse_id = aw.actual_warehouse_id
|
||||
@@ -150,6 +164,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
LEFT JOIN wms_material_coil mc ON w.actual_warehouse_id = mc.actual_warehouse_id
|
||||
AND mc.data_type = 1
|
||||
AND mc.del_flag = '0'
|
||||
and (mc.material_type='成品' or mc.material_type='原料')
|
||||
and mc.status!=2
|
||||
WHERE w.del_flag = '0'
|
||||
<if test="itemType != null and itemType != ''">
|
||||
AND mc.item_type = #{itemType}
|
||||
|
||||
Reference in New Issue
Block a user