|
|
@ -123,10 +123,10 @@ |
|
|
|
<if test="paramMap.quality_scode != null and paramMap.quality_scode != ''"> |
|
|
|
AND StructIvt.quality_scode = #{paramMap.quality_scode} |
|
|
|
</if> |
|
|
|
<if test="paramMap.is_virtual == '0'"> |
|
|
|
<if test="paramMap.is_virtual == 0"> |
|
|
|
AND sect.sect_type_attr <![CDATA[ <> ]]> '09' |
|
|
|
</if> |
|
|
|
<if test="paramMap.is_virtual == '1'"> |
|
|
|
<if test="paramMap.is_virtual == 1"> |
|
|
|
AND sect.sect_type_attr = '09' |
|
|
|
</if> |
|
|
|
<if test="paramMap.stor_id != null and paramMap.stor_id != ''"> |
|
|
@ -144,10 +144,10 @@ |
|
|
|
<if test="paramMap.ivt_status == 'frozen_qty'"> |
|
|
|
AND StructIvt.frozen_qty <![CDATA[ > ]]> 0 |
|
|
|
</if> |
|
|
|
<if test="paramMap.control == '0'"> |
|
|
|
<if test="paramMap.control == 0"> |
|
|
|
AND attr.lock_type <![CDATA[ <> ]]> '88' |
|
|
|
</if> |
|
|
|
<if test="paramMap.control == '1'"> |
|
|
|
<if test="paramMap.control == 1"> |
|
|
|
AND attr.lock_type = '88' |
|
|
|
</if> |
|
|
|
|
|
|
@ -378,10 +378,10 @@ |
|
|
|
<if test="paramMap.quality_scode != null and paramMap.quality_scode != ''"> |
|
|
|
AND StructIvt.quality_scode = #{paramMap.quality_scode} |
|
|
|
</if> |
|
|
|
<if test="paramMap.is_virtual == '0'"> |
|
|
|
<if test="paramMap.is_virtual == 0"> |
|
|
|
AND sect.sect_type_attr <![CDATA[ <> ]]> '09' |
|
|
|
</if> |
|
|
|
<if test="paramMap.is_virtual == '1'"> |
|
|
|
<if test="paramMap.is_virtual == 1"> |
|
|
|
AND sect.sect_type_attr = '09' |
|
|
|
</if> |
|
|
|
<if test="paramMap.stor_id != null and paramMap.stor_id != ''"> |
|
|
@ -399,10 +399,10 @@ |
|
|
|
<if test="paramMap.ivt_status == 'frozen_qty'"> |
|
|
|
AND StructIvt.frozen_qty <![CDATA[ > ]]> 0 |
|
|
|
</if> |
|
|
|
<if test="paramMap.control == '0'"> |
|
|
|
<if test="paramMap.control == 0"> |
|
|
|
AND attr.lock_type <![CDATA[ <> ]]> '88' |
|
|
|
</if> |
|
|
|
<if test="paramMap.control == '1'"> |
|
|
|
<if test="paramMap.control == 1"> |
|
|
|
AND attr.lock_type = '88' |
|
|
|
</if> |
|
|
|
) ivt |
|
|
@ -476,4 +476,194 @@ |
|
|
|
</if> |
|
|
|
order by a.instorage_time desc,a.package_box_sn |
|
|
|
</select> |
|
|
|
<select id="getPastStructPage" resultType="org.nl.wms.stat.service.vo.PastStructPageVo"> |
|
|
|
SELECT |
|
|
|
attr.stor_name, |
|
|
|
attr.sect_name, |
|
|
|
attr.struct_code, |
|
|
|
sub.package_box_sn, |
|
|
|
sub.quanlity_in_box, |
|
|
|
sub.customer_name, |
|
|
|
sub.customer_description, |
|
|
|
sub.sale_order_name, |
|
|
|
ivt.pcsn, |
|
|
|
sub.sap_pcsn, |
|
|
|
sub.product_name, |
|
|
|
sub.product_description, |
|
|
|
sub.width, |
|
|
|
sub.thickness, |
|
|
|
sub.mass_per_unit_area, |
|
|
|
ivt.canuse_qty, |
|
|
|
sub.length, |
|
|
|
sub.date_of_production, |
|
|
|
sub.date_of_FG_inbound, |
|
|
|
sub.box_weight, |
|
|
|
sub.quality_guaran_period, |
|
|
|
sub.un_plan_product_property1, |
|
|
|
sub.un_plan_product_property2, |
|
|
|
sub.un_plan_product_property3, |
|
|
|
sub.box_type, |
|
|
|
sub.box_length, |
|
|
|
sub.box_width, |
|
|
|
sub.box_high, |
|
|
|
sub.remark, |
|
|
|
DATEDIFF( NOW(), ivt.instorage_time ) AS sid_day, |
|
|
|
cust.sales_owner |
|
|
|
FROM |
|
|
|
st_ivt_structivt ivt |
|
|
|
LEFT JOIN st_ivt_structattr attr ON attr.struct_id = ivt.struct_id |
|
|
|
LEFT JOIN pdm_bi_subpackagerelation sub ON ivt.pcsn = sub.container_name |
|
|
|
LEFT JOIN md_cs_customerbase cust ON cust.cust_code = sub.customer_name |
|
|
|
WHERE |
|
|
|
1 = 1 |
|
|
|
AND ivt.canuse_qty > 0 |
|
|
|
<if test="paramMap.stor_id != null and paramMap.stor_id != ''"> |
|
|
|
AND attr.stor_id = #{paramMap.stor_id} |
|
|
|
</if> |
|
|
|
<if test="paramMap.sect_id != null and paramMap.sect_id != ''"> |
|
|
|
AND attr.sect_id = #{paramMap.sect_id} |
|
|
|
</if> |
|
|
|
<if test="paramMap.material_code != null and paramMap.material_code != ''"> |
|
|
|
AND ( |
|
|
|
sub.product_name LIKE '%${paramMap.material_code}%' or |
|
|
|
sub.product_description LIKE '%${paramMap.material_code}%' |
|
|
|
) |
|
|
|
</if> |
|
|
|
<if test="paramMap.package_box_sn != null and paramMap.package_box_sn != ''"> |
|
|
|
AND sub.package_box_sn LIKE '%${paramMap.package_box_sn}%' |
|
|
|
</if> |
|
|
|
<if test="paramMap.container_name != null and paramMap.container_name != ''"> |
|
|
|
AND sub.container_name LIKE '%${paramMap.container_name}%' |
|
|
|
</if> |
|
|
|
<if test="paramMap.sap_pcsn != null and paramMap.sap_pcsn != ''"> |
|
|
|
AND sub.sap_pcsn LIKE '%${paramMap.sap_pcsn}%' |
|
|
|
</if> |
|
|
|
<if test="paramMap.begin_time != null and paramMap.begin_time != ''"> |
|
|
|
AND sub.date_of_production <![CDATA[ >= ]]> #{paramMap.begin_time} |
|
|
|
</if> |
|
|
|
<if test="paramMap.end_time != null and paramMap.end_time != ''"> |
|
|
|
AND sub.date_of_production <![CDATA[ <= ]]> #{paramMap.end_time} |
|
|
|
</if> |
|
|
|
<if test="paramMap.date_of_FG_inbound != null and paramMap.date_of_FG_inbound != ''"> |
|
|
|
AND sub.date_of_FG_inbound = #{paramMap.date_of_FG_inbound} |
|
|
|
</if> |
|
|
|
<if test="paramMap.sale_order_name != null and paramMap.sale_order_name != ''"> |
|
|
|
AND sub.sale_order_name = #{paramMap.sale_order_name} |
|
|
|
</if> |
|
|
|
<if test="paramMap.customer_name != null and paramMap.customer_name != ''"> |
|
|
|
AND ( |
|
|
|
sub.customer_name LIKE '%${paramMap.customer_name}%' or |
|
|
|
sub.customer_description LIKE '%${paramMap.customer_name}%' |
|
|
|
) |
|
|
|
</if> |
|
|
|
<if test="paramMap.sid_day_start != null and paramMap.sid_day_start != ''"> |
|
|
|
AND DATEDIFF( NOW(), ivt.instorage_time ) <![CDATA[ >= ]]> #{paramMap.sid_day_start} |
|
|
|
</if> |
|
|
|
<if test="paramMap.sid_day_end != null and paramMap.sid_day_end != ''"> |
|
|
|
AND DATEDIFF( NOW(), ivt.instorage_time ) <![CDATA[ <= ]]> #{paramMap.sid_day_end} |
|
|
|
</if> |
|
|
|
<if test="paramMap.is_sid != null and paramMap.is_sid == 0"> |
|
|
|
AND DATEDIFF( NOW(), sub.date_of_production ) <![CDATA[ <= ]]> SUBSTRING_INDEX(sub.quality_guaran_period,'天',1) |
|
|
|
</if> |
|
|
|
<if test="paramMap.is_sid != null and paramMap.is_sid == 1"> |
|
|
|
AND DATEDIFF( NOW(), sub.date_of_production ) <![CDATA[ >= ]]> SUBSTRING_INDEX(sub.quality_guaran_period,'天',1) |
|
|
|
</if> |
|
|
|
ORDER BY sub.package_box_sn ASC |
|
|
|
</select> |
|
|
|
<select id="getPastStructDatas" resultType="org.nl.wms.stat.service.vo.PastStructPageVo"> |
|
|
|
SELECT |
|
|
|
attr.stor_name, |
|
|
|
attr.sect_name, |
|
|
|
attr.struct_code, |
|
|
|
sub.package_box_sn, |
|
|
|
sub.quanlity_in_box, |
|
|
|
sub.customer_name, |
|
|
|
sub.customer_description, |
|
|
|
sub.sale_order_name, |
|
|
|
ivt.pcsn, |
|
|
|
sub.sap_pcsn, |
|
|
|
sub.product_name, |
|
|
|
sub.product_description, |
|
|
|
sub.width, |
|
|
|
sub.thickness, |
|
|
|
sub.mass_per_unit_area, |
|
|
|
ivt.canuse_qty, |
|
|
|
sub.length, |
|
|
|
sub.date_of_production, |
|
|
|
sub.date_of_FG_inbound, |
|
|
|
sub.box_weight, |
|
|
|
sub.quality_guaran_period, |
|
|
|
sub.un_plan_product_property1, |
|
|
|
sub.un_plan_product_property2, |
|
|
|
sub.un_plan_product_property3, |
|
|
|
sub.box_type, |
|
|
|
sub.box_length, |
|
|
|
sub.box_width, |
|
|
|
sub.box_high, |
|
|
|
sub.remark, |
|
|
|
DATEDIFF( NOW(), ivt.instorage_time ) AS sid_day, |
|
|
|
cust.sales_owner |
|
|
|
FROM |
|
|
|
st_ivt_structivt ivt |
|
|
|
LEFT JOIN st_ivt_structattr attr ON attr.struct_id = ivt.struct_id |
|
|
|
LEFT JOIN pdm_bi_subpackagerelation sub ON ivt.pcsn = sub.container_name |
|
|
|
LEFT JOIN md_cs_customerbase cust ON cust.cust_code = sub.customer_name |
|
|
|
WHERE |
|
|
|
1 = 1 |
|
|
|
AND ivt.canuse_qty > 0 |
|
|
|
<if test="paramMap.stor_id != null and paramMap.stor_id != ''"> |
|
|
|
AND attr.stor_id = #{paramMap.stor_id} |
|
|
|
</if> |
|
|
|
<if test="paramMap.sect_id != null and paramMap.sect_id != ''"> |
|
|
|
AND attr.sect_id = #{paramMap.sect_id} |
|
|
|
</if> |
|
|
|
<if test="paramMap.material_code != null and paramMap.material_code != ''"> |
|
|
|
AND ( |
|
|
|
sub.product_name LIKE '%${paramMap.material_code}%' or |
|
|
|
sub.product_description LIKE '%${paramMap.material_code}%' |
|
|
|
) |
|
|
|
</if> |
|
|
|
<if test="paramMap.package_box_sn != null and paramMap.package_box_sn != ''"> |
|
|
|
AND sub.package_box_sn LIKE '%${paramMap.package_box_sn}%' |
|
|
|
</if> |
|
|
|
<if test="paramMap.container_name != null and paramMap.container_name != ''"> |
|
|
|
AND sub.container_name LIKE '%${paramMap.container_name}%' |
|
|
|
</if> |
|
|
|
<if test="paramMap.sap_pcsn != null and paramMap.sap_pcsn != ''"> |
|
|
|
AND sub.sap_pcsn LIKE '%${paramMap.sap_pcsn}%' |
|
|
|
</if> |
|
|
|
<if test="paramMap.begin_time != null and paramMap.begin_time != ''"> |
|
|
|
AND sub.date_of_production <![CDATA[ >= ]]> #{paramMap.begin_time} |
|
|
|
</if> |
|
|
|
<if test="paramMap.end_time != null and paramMap.end_time != ''"> |
|
|
|
AND sub.date_of_production <![CDATA[ <= ]]> #{paramMap.end_time} |
|
|
|
</if> |
|
|
|
<if test="paramMap.date_of_FG_inbound != null and paramMap.date_of_FG_inbound != ''"> |
|
|
|
AND sub.date_of_FG_inbound = #{paramMap.date_of_FG_inbound} |
|
|
|
</if> |
|
|
|
<if test="paramMap.sale_order_name != null and paramMap.sale_order_name != ''"> |
|
|
|
AND sub.sale_order_name = #{paramMap.sale_order_name} |
|
|
|
</if> |
|
|
|
<if test="paramMap.customer_name != null and paramMap.customer_name != ''"> |
|
|
|
AND ( |
|
|
|
sub.customer_name LIKE '%${paramMap.customer_name}%' or |
|
|
|
sub.customer_description LIKE '%${paramMap.customer_name}%' |
|
|
|
) |
|
|
|
</if> |
|
|
|
<if test="paramMap.sid_day_start != null and paramMap.sid_day_start != ''"> |
|
|
|
AND DATEDIFF( NOW(), ivt.instorage_time ) <![CDATA[ >= ]]> #{paramMap.sid_day_start} |
|
|
|
</if> |
|
|
|
<if test="paramMap.sid_day_end != null and paramMap.sid_day_end != ''"> |
|
|
|
AND DATEDIFF( NOW(), ivt.instorage_time ) <![CDATA[ <= ]]> #{paramMap.sid_day_end} |
|
|
|
</if> |
|
|
|
<if test="paramMap.is_sid != null and paramMap.is_sid == 0"> |
|
|
|
AND DATEDIFF( NOW(), sub.date_of_production ) <![CDATA[ <= ]]> |
|
|
|
SUBSTRING_INDEX(sub.quality_guaran_period,'天',1) |
|
|
|
</if> |
|
|
|
<if test="paramMap.is_sid != null and paramMap.is_sid == 1"> |
|
|
|
AND DATEDIFF( NOW(), sub.date_of_production ) <![CDATA[ >= ]]> |
|
|
|
SUBSTRING_INDEX(sub.quality_guaran_period,'天',1) |
|
|
|
</if> |
|
|
|
ORDER BY sub.package_box_sn ASC |
|
|
|
</select> |
|
|
|
</mapper> |
|
|
|