md
This commit is contained in:
parent
7ce389895d
commit
f937c9e8f8
@ -213,29 +213,36 @@
|
||||
</select>
|
||||
|
||||
<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
|
||||
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 x2.del_flag='0' and x.main_bill_code=x2.bill_code and x2.bl_sign='0' and a.bl_sub_bill='0'
|
||||
and x.scan_site_code=#{scanSiteCode}
|
||||
and x.scan_type=#{scanType}
|
||||
and x.main_bill_code not in (
|
||||
select bill_code from emis_waybill_problem_info ewpi where ewpi.del_flag='0' and ewpi.`problem_type` in(151,173,170)
|
||||
)
|
||||
<if test="scanType != null and scanType == '20'">
|
||||
and x.scan_site_code=x2.send_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 x.main_bill_code
|
||||
)
|
||||
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.bl_sub_bill = '0'
|
||||
and a.main_bill_code = b.bill_code
|
||||
and b.bl_sign = '0'
|
||||
AND b.bill_code NOT IN ( SELECT bill_code FROM emis_waybill_problem_info ewpi WHERE ewpi.del_flag = '0' AND ewpi.`problem_type` IN ( 151, 173, 170 ) )
|
||||
and a.scan_site_code=#{scanSiteCode}
|
||||
and a.scan_type=#{scanType}
|
||||
<if test="scanType != null and scanType == '20'">
|
||||
and a.scan_site_code=b.send_site_code
|
||||
</if>
|
||||
<if test="preOrNextStationCode != null and preOrNextStationCode != ''"> and a.pre_or_next_station_code=#{preOrNextStationCode}</if>
|
||||
<if test="scanManCode != null and scanManCode != ''"> and a.scan_man_code=#{scanManCode}</if>
|
||||
<if test="params.beginScanDate != null and params.beginScanDate != ''">and a.scan_date <![CDATA[ >= ]]> #{params.beginScanDate}</if>
|
||||
<if test="params.endScanDate != null and params.endScanDate != ''">and a.scan_date <![CDATA[ <= ]]> #{params.endScanDate}</if>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user