This commit is contained in:
linfso 2024-08-15 18:13:19 +08:00
parent adac0a0877
commit d7981e76a4

View File

@ -246,10 +246,28 @@
<select id="queryScanStatRecordList" parameterType="EmisTmsScanRecord" resultMap="EmisTmsScanRecordResult">
select a.main_bill_code as bill_code,a.main_bill_code,a.bl_sub_bill,a.scan_type,scan_date as scan_date,
a.pre_or_next_station,a.pre_or_next_station_code,a.scan_site, a.scan_site_code,a.scan_man,a.scan_man_code
from emis_tms_scan_record a,emis_waybill b
where a.del_flag='0' and b.del_flag='0' and a.main_bill_code=b.bill_code and b.bl_sign!='1'
from emis_tms_scan_record a
where a.del_flag='0'
and a.id in(
select max(x.id) as id
from emis_tms_scan_record x,emis_waybill x2
where x.del_flag='0' and b.del_flag='0' and x.main_bill_code=x2.bill_code and x2.bl_sign='0'
and x.scan_site_code=#{scanSiteCode}
and x.scan_type=#{scanType}
<if test="scanType != null and scanType == '20'">
and x.scan_site_code=x2.send_site_code
</if>
<if test="scanType != null and scanType == '30'">
and x.scan_site_code=x2.dispatch_underling_site_code
</if>
<if test="scanType != null and scanType == '40'">
and x.scan_site_code=x2.dispatch_underling_site_code
</if>
<if test="preOrNextStationCode != null and preOrNextStationCode != ''"> and x.pre_or_next_station_code=#{preOrNextStationCode}</if>
<if test="scanManCode != null and scanManCode != ''"> and x.scan_man_code=#{scanManCode}</if>
<if test="params.beginScanDate != null and params.beginScanDate != ''">and x.scan_date <![CDATA[ >= ]]> #{params.beginScanDate}</if>
<if test="params.endScanDate != null and params.endScanDate != ''">and x.scan_date <![CDATA[ <= ]]> #{params.endScanDate}</if>
GROUP BY a.main_bill_code
)
</select>
@ -259,14 +277,14 @@
from emis_tms_scan_record a,emis_waybill b
where a.del_flag='0' and b.del_flag='0' and a.main_bill_code=b.bill_code and b.bl_sign!='1'
and a.main_bill_code in(
select distinct x.main_bill_code
from emis_tms_scan_record x
where x.del_flag='0' and x.scan_site_code=#{scanSiteCode}
and x.scan_type=#{scanType}
<if test="preOrNextStationCode != null and preOrNextStationCode != ''"> and x.pre_or_next_station_code=#{preOrNextStationCode}</if>
<if test="scanManCode != null and scanManCode != ''"> and x.scan_man_code=#{scanManCode}</if>
<if test="params.beginScanDate != null and params.beginScanDate != ''">and x.scan_date <![CDATA[ >= ]]> #{params.beginScanDate}</if>
<if test="params.endScanDate != null and params.endScanDate != ''">and x.scan_date <![CDATA[ <= ]]> #{params.endScanDate}</if>
select distinct x.main_bill_code
from emis_tms_scan_record x
where x.del_flag='0' and x.scan_site_code=#{scanSiteCode}
and x.scan_type=#{scanType}
<if test="preOrNextStationCode != null and preOrNextStationCode != ''"> and x.pre_or_next_station_code=#{preOrNextStationCode}</if>
<if test="scanManCode != null and scanManCode != ''"> and x.scan_man_code=#{scanManCode}</if>
<if test="params.beginScanDate != null and params.beginScanDate != ''">and x.scan_date <![CDATA[ >= ]]> #{params.beginScanDate}</if>
<if test="params.endScanDate != null and params.endScanDate != ''">and x.scan_date <![CDATA[ <= ]]> #{params.endScanDate}</if>
)
GROUP BY a.main_bill_code
</select>