md
This commit is contained in:
parent
e29ecb92d5
commit
7ce389895d
@ -2553,7 +2553,6 @@ public class EmisTmsScanRecordServiceImpl extends EmisBaseService implements IEm
|
||||
EmisTmsScanRecord record=selectEmisTmsScanRecordById(id);
|
||||
// 删除运单签收记录
|
||||
updateUnSignStatus(record.getMainBillCode());
|
||||
|
||||
record.setRemark(remark);
|
||||
emisTmsScanRecordMapper.updateEmisTmsScanRecord(record);
|
||||
}
|
||||
|
||||
@ -174,28 +174,24 @@
|
||||
group by a.main_bill_code
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--获取签收异常扫描统计数据-->
|
||||
<!--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)
|
||||
)-->
|
||||
|
||||
<select id="queryScanStatListOld" parameterType="EmisTmsScanRecord" resultMap="ScanStatDataInfoResult">
|
||||
select t1.scan_site_code,t1.scan_count,ifnull(t2.sign_count,0) as sign_count,round(round(ifnull(t2.sign_count,0)/t1.scan_count,3)*100,1) as sign_rate
|
||||
<select id="queryScanStatList" parameterType="EmisTmsScanRecord" resultMap="ScanStatDataInfoResult">
|
||||
select tbA.scan_site_code ,count(tbA.bill_code) as scan_count,sum(if(tbA.bl_sign=1,1,0)) as sign_count,round(round(ifnull(sum(if(tbA.bl_sign=1,1,0)),0)/count(tbA.bill_code),3)*100,1) as sign_rate
|
||||
from (
|
||||
select a.scan_site_code ,count(DISTINCT a.main_bill_code) as scan_count
|
||||
select DISTINCT a.scan_site_code,b.bill_code , b.bl_sign
|
||||
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 not EXISTS (
|
||||
select 1 from emis_waybill_problem_info ewpi where ewpi.bill_code=b.bill_code and ewpi.del_flag='0' and ewpi.`problem_type` in(151,173,170)
|
||||
)
|
||||
and a.scan_type=#{scanType}
|
||||
where a.del_flag='0' and b.del_flag='0' and a.main_bill_code=b.bill_code and a.bl_sub_bill='0'
|
||||
and not EXISTS (
|
||||
select 1 from emis_waybill_problem_info ewpi where ewpi.bill_code=b.bill_code and ewpi.del_flag='0' and ewpi.`problem_type` in(151,173,170)
|
||||
)
|
||||
and a.scan_type=#{scanType}
|
||||
|
||||
<if test="scanType != null and scanType == '20'">
|
||||
and a.scan_site_code=b.send_site_code
|
||||
</if>
|
||||
<if test="scanType != null and scanType == '20'">
|
||||
and a.scan_site_code=b.send_site_code
|
||||
</if>
|
||||
|
||||
<if test="scanSiteCode != null and scanSiteCode != ''"> and a.scan_site_code=#{scanSiteCode}</if>
|
||||
<if test="preOrNextStationCode != null and preOrNextStationCode != ''"> and a.pre_or_next_station_code=#{preOrNextStationCode}</if>
|
||||
@ -204,88 +200,18 @@
|
||||
<if test="params.endScanDate != null and params.endScanDate != ''">and a.scan_date <![CDATA[ <= ]]> #{params.endScanDate}</if>
|
||||
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
|
||||
and a.scan_site_code in (
|
||||
SELECT t1.site_code FROM (
|
||||
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
|
||||
#{params.privSiteCode} ) pd
|
||||
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
|
||||
UNION
|
||||
SELECT #{params.privSiteCode} FROM dual
|
||||
SELECT t1.site_code FROM (
|
||||
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
|
||||
#{params.privSiteCode} ) pd
|
||||
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
|
||||
UNION
|
||||
SELECT #{params.privSiteCode} FROM dual
|
||||
)
|
||||
</if>
|
||||
GROUP BY a.scan_site_code
|
||||
) t1 left join
|
||||
(
|
||||
select a.scan_site_code ,count(DISTINCT a.main_bill_code) as sign_count
|
||||
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 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_type=#{scanType}
|
||||
<if test="scanType != null and scanType == '20'">
|
||||
and a.scan_site_code=b.send_site_code
|
||||
</if>
|
||||
|
||||
<if test="scanSiteCode != null and scanSiteCode != ''"> and a.scan_site_code=#{scanSiteCode}</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>
|
||||
-->
|
||||
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
|
||||
|
||||
and a.scan_site_code in (
|
||||
SELECT t1.site_code FROM (
|
||||
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
|
||||
#{params.privSiteCode} ) pd
|
||||
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
|
||||
UNION
|
||||
SELECT #{params.privSiteCode} FROM dual
|
||||
)
|
||||
</if>
|
||||
GROUP BY a.scan_site_code
|
||||
) t2
|
||||
on t1.scan_site_code=t2.scan_site_code
|
||||
|
||||
) tbA
|
||||
GROUP BY tbA.scan_site_code
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryScanStatList" parameterType="EmisTmsScanRecord" resultMap="ScanStatDataInfoResult">
|
||||
select t1.scan_site_code,t1.scan_count,ifnull(t1.sign_count,0) as sign_count,round(round(ifnull(t1.sign_count,0)/t1.scan_count,3)*100,1) as sign_rate
|
||||
from (
|
||||
select a.scan_site_code ,count(DISTINCT a.main_bill_code) as scan_count,sum(if(b.bl_sign=1,1,0)) as sign_count
|
||||
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 a.bl_sub_bill='0'
|
||||
and not EXISTS (
|
||||
select 1 from emis_waybill_problem_info ewpi where ewpi.bill_code=b.bill_code and ewpi.del_flag='0' and ewpi.`problem_type` in(151,173,170)
|
||||
)
|
||||
and a.scan_type=#{scanType}
|
||||
|
||||
<if test="scanType != null and scanType == '20'">
|
||||
and a.scan_site_code=b.send_site_code
|
||||
</if>
|
||||
|
||||
<if test="scanSiteCode != null and scanSiteCode != ''"> and a.scan_site_code=#{scanSiteCode}</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>
|
||||
<if test="params.privSiteCode != null and params.privSiteCode != '88888'">
|
||||
and a.scan_site_code in (
|
||||
SELECT t1.site_code FROM (
|
||||
SELECT * FROM emis_site WHERE parent_site_code IS NOT NULL ) t1,( SELECT @pid :=
|
||||
#{params.privSiteCode} ) pd
|
||||
WHERE FIND_IN_SET( parent_site_code, @pid ) > 0 AND @pid := concat(@pid,',',site_code)
|
||||
UNION
|
||||
SELECT #{params.privSiteCode} FROM dual
|
||||
)
|
||||
</if>
|
||||
GROUP BY a.scan_site_code
|
||||
) t1
|
||||
</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
|
||||
@ -294,7 +220,7 @@
|
||||
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'
|
||||
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 (
|
||||
|
||||
Loading…
Reference in New Issue
Block a user