md
This commit is contained in:
parent
24587dc217
commit
aac7aca672
@ -18,10 +18,10 @@ import java.util.Map;
|
||||
public class ScanStatDataInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// 扫描记录数,已签收数量
|
||||
// 扫描记录数,已签收数量,签收率
|
||||
private Integer scanCount;
|
||||
private Integer signCount;
|
||||
|
||||
private BigDecimal signRate;
|
||||
// private String billCodeStr;
|
||||
|
||||
private String scanSiteCode;
|
||||
|
||||
@ -65,14 +65,9 @@
|
||||
<result property="scanType" column="scan_type" />
|
||||
|
||||
<result property="scanSiteCode" column="scan_site_code" />
|
||||
<!-- 1+ 查询-->
|
||||
<result property="scanCount" column="scan_count" />
|
||||
|
||||
<association property="signCount"
|
||||
column="bill_code_str"
|
||||
select="selectSignCountByBillCodeStr"
|
||||
fetchType="lazy"
|
||||
/>
|
||||
<result property="signCount" column="sign_count" />
|
||||
<result property="signRate" column="sign_rate" />
|
||||
|
||||
<association property="scanSiteName"
|
||||
column="scan_site_code"
|
||||
@ -83,57 +78,82 @@
|
||||
|
||||
</resultMap>
|
||||
|
||||
<!-- 根据获取签收数量统计 -->
|
||||
<select id="selectSignCountByBillCodeStr" parameterType="string" resultType="int">
|
||||
select count(DISTINCT main_bill_code) as sign_cnt from emis_tms_scan_record
|
||||
where scan_type='50' and FIND_IN_SET(bill_code,#{billCodeStr})
|
||||
</select>
|
||||
|
||||
<!--获取扫描统计数据-->
|
||||
<select id="queryScanStatList" parameterType="EmisTmsScanRecord" resultMap="ScanStatDataInfoResult">
|
||||
select a.scan_site_code ,
|
||||
count(DISTINCT a.main_bill_code) as scan_count,
|
||||
GROUP_CONCAT(DISTINCT a.main_bill_code) as bill_code_str
|
||||
from emis_tms_scan_record a
|
||||
where a.del_flag='0'
|
||||
|
||||
<if test="scanSiteCode != null and scanSiteCode != ''"> and a.scan_site_code=#{scanSiteCode}</if>
|
||||
<if test="scanType != null and scanType != ''"> and a.scan_type=#{scanType}</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.thisSiteScanType != null and params.thisSiteScanType !=''">
|
||||
and a.scan_type=#{params.thisSiteScanType}
|
||||
</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 id="queryScanStatList" parameterType="EmisTmsScanRecord" resultType="ScanStatDataInfoResult">
|
||||
select t1.scan_site_code,t1.scan_count,t2.sign_count,round(round(t2.sign_count/t1.scan_count,3)*100,1) as sign_rate
|
||||
from (
|
||||
select a.scan_site_code ,count(DISTINCT a.main_bill_code) as scan_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.scan_type=#{scanType}
|
||||
<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 asc
|
||||
</if>
|
||||
GROUP BY a.scan_site_code
|
||||
) t1,
|
||||
(
|
||||
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 a.scan_type=#{scanType}
|
||||
<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
|
||||
where t1.scan_site_code=t2.scan_site_code
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryScanStatRecordList" parameterType="EmisTmsScanRecord" resultMap="EmisTmsScanRecordResult">
|
||||
select id, bill_code,
|
||||
main_bill_code, order_sn, scan_type,
|
||||
select a.main_bill_code as bill_code,a.main_bill_code,a.scan_type,max(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'
|
||||
and a.main_bill_code in(
|
||||
select x.main_bill_code
|
||||
from emis_tms_scan_record x
|
||||
where x.del_flag='0' and x.scan_site_code=#{scanSiteCode}
|
||||
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>
|
||||
|
||||
|
||||
<select id="queryScanStatRecordList_old" parameterType="EmisTmsScanRecord" resultMap="EmisTmsScanRecordResult">
|
||||
select id, main_bill_code as bill_code,
|
||||
order_sn, scan_type,
|
||||
pre_or_next_station, pre_or_next_station_code,
|
||||
pre_or_next_station_phone, pre_or_next_man_code, pre_or_next_man_phone, max(scan_date) as scan_date, scan_man_code,
|
||||
scan_man_phone, scan_man, pre_or_next_man, scan_site, scan_site_code, scan_site_phone,
|
||||
@ -172,9 +192,9 @@
|
||||
)
|
||||
</if>
|
||||
|
||||
and exists (select 1 from emis_waybill ewb where ewb.bl_sign != '1' and ewb.bill_code=a.bill_code)
|
||||
and exists (select 1 from emis_waybill ewb where ewb.bl_sign != '1' and ewb.bill_code=a.main_bill_code)
|
||||
|
||||
group by bill_code
|
||||
group by main_bill_code
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user