|
|
@ -578,7 +578,7 @@ |
|
|
|
AND ios.bill_type = #{paramMap.bill_type} |
|
|
|
</if> |
|
|
|
<if test="paramMap.bill_code != null and paramMap.bill_code != ''"> |
|
|
|
and ios.bill_code LIKE '%${paramMap.bill_code}%' |
|
|
|
AND ios.bill_code LIKE '%${paramMap.bill_code}%' |
|
|
|
</if> |
|
|
|
<if test="paramMap.create_mode != null and paramMap.create_mode != ''"> |
|
|
|
AND ios.create_mode = #{paramMap.create_mode} |
|
|
@ -653,5 +653,212 @@ |
|
|
|
dtl.iostorinv_id |
|
|
|
) dtl2 ON ios2.iostorinv_id = dtl2.iostorinv_id |
|
|
|
</select> |
|
|
|
<select id="outBillPage" resultType="org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinv"> |
|
|
|
SELECT |
|
|
|
ios.iostorinv_id, |
|
|
|
ios.bill_code, |
|
|
|
ios.io_type, |
|
|
|
ios.buss_type, |
|
|
|
ios.bill_type, |
|
|
|
ios.biz_date, |
|
|
|
ios.stor_id, |
|
|
|
ios.stor_code, |
|
|
|
ios.stor_name, |
|
|
|
ios.source_id, |
|
|
|
ios.source_name, |
|
|
|
ios.source_type, |
|
|
|
ios.total_qty, |
|
|
|
ios.total_weight, |
|
|
|
ios.detail_count, |
|
|
|
ios.bill_status, |
|
|
|
ios.remark, |
|
|
|
ios.create_mode, |
|
|
|
ios.input_optid, |
|
|
|
ios.input_optname, |
|
|
|
ios.input_time, |
|
|
|
ios.update_optid, |
|
|
|
ios.update_optname, |
|
|
|
ios.update_time, |
|
|
|
ios.dis_optid, |
|
|
|
ios.dis_optname, |
|
|
|
ios.dis_time, |
|
|
|
ios.confirm_optid, |
|
|
|
ios.confirm_optname, |
|
|
|
ios.confirm_time, |
|
|
|
ios.sysdeptid, |
|
|
|
ios.syscompanyid, |
|
|
|
ios.is_delete, |
|
|
|
ios.is_upload, |
|
|
|
ios.upload_optid, |
|
|
|
ios.upload_time, |
|
|
|
ios.is_writeoff, |
|
|
|
ios.writeoff_optid, |
|
|
|
ios.writeoff_time, |
|
|
|
ios.consignee, |
|
|
|
ios.receiver, |
|
|
|
ios.receiptaddress, |
|
|
|
ios.receiptphone, |
|
|
|
ios.logisticscompany, |
|
|
|
ios.drivername, |
|
|
|
ios.carno, |
|
|
|
ios.driverphone, |
|
|
|
ios.contractno, |
|
|
|
ios.deliveryunit, |
|
|
|
ios.deliveryaddress, |
|
|
|
ios.deliveryname, |
|
|
|
ios.deliveryphone, |
|
|
|
ios.trans_code, |
|
|
|
ios.estimated_freight, |
|
|
|
ios.cust_code, |
|
|
|
ios.out_stor_id, |
|
|
|
ios.upload_mes, |
|
|
|
ios.upload_sap, |
|
|
|
ios.run_freight, |
|
|
|
ios.unload_freight, |
|
|
|
ios.other_freight, |
|
|
|
ios.order_number, |
|
|
|
ios.car_type, |
|
|
|
ios.is_overdue, |
|
|
|
a.plan_qty, |
|
|
|
IFNULL(c.vbeln,'') as vbeln |
|
|
|
FROM |
|
|
|
( |
|
|
|
SELECT |
|
|
|
mst.*, |
|
|
|
cu.shd_dtl_num, |
|
|
|
cu.cust_name, |
|
|
|
cu.cust_simple_name, |
|
|
|
attr.stor_name AS out_stor_name |
|
|
|
FROM |
|
|
|
st_ivt_iostorinv mst |
|
|
|
LEFT JOIN md_cs_customerbase cu ON mst.cust_code = cu.cust_code |
|
|
|
LEFT JOIN st_ivt_bsrealstorattr attr ON attr.stor_id = mst.out_stor_id |
|
|
|
WHERE |
|
|
|
mst.io_type = '1' |
|
|
|
and mst.is_delete='0' |
|
|
|
<if test="paramMap.in_stor_id != null and !paramMap.in_stor_id.isEmpty()"> |
|
|
|
AND mst.stor_id IN |
|
|
|
<foreach collection="paramMap.in_stor_id" item="code" separator="," open="(" close=")"> |
|
|
|
#{code} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test="paramMap.bill_code != null and paramMap.bill_code != ''"> |
|
|
|
AND mst.bill_code LIKE '%${paramMap.bill_code}%' |
|
|
|
</if> |
|
|
|
<if test="paramMap.cust_code != null and paramMap.cust_code != ''"> |
|
|
|
AND (cu.cust_code LIKE '%${paramMap.cust_code}%' |
|
|
|
OR cu.cust_simple_name LIKE '%${paramMap.cust_code}%') |
|
|
|
</if> |
|
|
|
<if test="paramMap.is_upload != null and paramMap.is_upload != ''"> |
|
|
|
AND mst.is_upload LIKE '%${paramMap.is_upload}%' |
|
|
|
</if> |
|
|
|
<if test="paramMap.bill_type != null and !paramMap.bill_type.isEmpty()"> |
|
|
|
AND mst.bill_type IN |
|
|
|
<foreach collection="paramMap.bill_type" item="code" separator="," open="(" close=")"> |
|
|
|
#{code} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test="paramMap.stor_id != null and !paramMap.stor_id.isEmpty()"> |
|
|
|
AND mst.stor_id IN |
|
|
|
<foreach collection="paramMap.stor_id" item="code" separator="," open="(" close=")"> |
|
|
|
#{code} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test="paramMap.create_mode != null and paramMap.create_mode != ''"> |
|
|
|
AND mst.create_mode = #{paramMap.create_mode} |
|
|
|
</if> |
|
|
|
<if test="paramMap.bill_status != null and !paramMap.bill_status.isEmpty()"> |
|
|
|
AND mst.bill_status IN |
|
|
|
<foreach collection="paramMap.bill_status" item="code" separator="," open="(" close=")"> |
|
|
|
#{code} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test="paramMap.begin_time != null and paramMap.begin_time != ''"> |
|
|
|
AND mst.input_time <![CDATA[ >= ]]> #{paramMap.begin_time} |
|
|
|
</if> |
|
|
|
<if test="paramMap.end_time != null and paramMap.end_time != ''"> |
|
|
|
AND mst.input_time <![CDATA[ <= ]]> #{paramMap.end_time} |
|
|
|
</if> |
|
|
|
) ios |
|
|
|
inner JOIN ( |
|
|
|
select |
|
|
|
dtl.iostorinv_id, |
|
|
|
dtl.vbeln |
|
|
|
from |
|
|
|
st_ivt_iostorinvdtl dtl |
|
|
|
where 1=1 |
|
|
|
<if test="paramMap.vbeln != null and paramMap.vbeln != ''"> |
|
|
|
AND dtl.vbeln LIKE '%${paramMap.vbeln}%' |
|
|
|
</if> |
|
|
|
<if test="paramMap.vbeln_in != null and !paramMap.vbeln_in.isEmpty()"> |
|
|
|
AND dtl.vbeln IN |
|
|
|
<foreach collection="paramMap.vbeln_in" item="code" separator="," open="(" close=")"> |
|
|
|
#{code} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test="paramMap.width != null and paramMap.width != ''"> |
|
|
|
AND dtl.width LIKE '%${paramMap.width}%' |
|
|
|
</if> |
|
|
|
GROUP BY |
|
|
|
dtl.iostorinv_id, |
|
|
|
dtl.vbeln |
|
|
|
) c ON ios.iostorinv_id = c.iostorinv_id |
|
|
|
|
|
|
|
<if test="paramMap.flag != null and paramMap.flag != ''"> |
|
|
|
inner JOIN ( |
|
|
|
SELECT |
|
|
|
dis.iostorinv_id |
|
|
|
FROM |
|
|
|
st_ivt_iostorinvdis dis |
|
|
|
LEFT JOIN pdm_bi_subpackagerelationrecord sub ON (sub.container_name = dis.pcsn AND dis.box_no = |
|
|
|
sub.package_box_sn AND dis.iostorinv_id = sub.bill_id) |
|
|
|
WHERE |
|
|
|
1 = 1 |
|
|
|
<if test="paramMap.pcsn != null and paramMap.pcsn != ''"> |
|
|
|
AND dis.pcsn LIKE '%${paramMap.pcsn}%' |
|
|
|
</if> |
|
|
|
<if test="paramMap.pcsn_in != null and !paramMap.pcsn_in.isEmpty()"> |
|
|
|
AND dis.pcsn IN |
|
|
|
<foreach collection="paramMap.pcsn_in" item="code" separator="," open="(" close=")"> |
|
|
|
#{code} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test="paramMap.box_no != null and paramMap.box_no != ''"> |
|
|
|
AND dis.box_no LIKE '%${paramMap.box_no}%' |
|
|
|
</if> |
|
|
|
<if test="paramMap.box_no_in != null and !paramMap.box_no_in.isEmpty()"> |
|
|
|
AND dis.box_no IN |
|
|
|
<foreach collection="paramMap.box_no_in" item="code" separator="," open="(" close=")"> |
|
|
|
#{code} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
<if test="paramMap.sap_pcsn != null and paramMap.sap_pcsn != ''"> |
|
|
|
AND sub.sap_pcsn LIKE '%${paramMap.sap_pcsn}%' |
|
|
|
</if> |
|
|
|
<if test="paramMap.sap_pcsn_in != null and !paramMap.sap_pcsn_in.isEmpty()"> |
|
|
|
AND sub.sap_pcsn IN |
|
|
|
<foreach collection="paramMap.sap_pcsn_in" item="code" separator="," open="(" close=")"> |
|
|
|
#{code} |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
GROUP BY |
|
|
|
dis.iostorinv_id |
|
|
|
) b ON b.iostorinv_id = ios.iostorinv_id |
|
|
|
</if> |
|
|
|
|
|
|
|
LEFT JOIN ( |
|
|
|
SELECT |
|
|
|
SUM(a.plan_qty) AS plan_qty, |
|
|
|
a.iostorinv_id |
|
|
|
FROM |
|
|
|
st_ivt_iostorinvdis a |
|
|
|
LEFT JOIN ST_IVT_IOStorInv b ON a.iostorinv_id = b.iostorinv_id |
|
|
|
WHERE |
|
|
|
b.io_type = '1' |
|
|
|
and b.is_delete='0' |
|
|
|
and b.is_overdue = '0' |
|
|
|
GROUP BY a.iostorinv_id |
|
|
|
) a ON a.iostorinv_id = ios.iostorinv_id |
|
|
|
</select> |
|
|
|
|
|
|
|
</mapper> |
|
|
|