Commit 79d11672 authored by 刘林's avatar 刘林

fix:(大屏):总览-设备状态统计慢问题处理

parent 5ee0545c
...@@ -124,41 +124,22 @@ ...@@ -124,41 +124,22 @@
LEFT JOIN idx_biz_jg_use_info use on jede.equ_id = use.RECORD LEFT JOIN idx_biz_jg_use_info use on jede.equ_id = use.RECORD
where jed.sequence_nbr = #{sequenceNbr} where jed.sequence_nbr = #{sequenceNbr}
</select> </select>
<select id="queryStoppedDeviceStaticListData"
resultType="com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto"> <select id="queryStoppedDeviceStaticListData" resultType="com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto">
select SELECT COUNT(1) AS num,
c.equ_list, jri.equ_list AS equList,
c.equ_category, jri.equ_category AS equCategory
c.equ_define,
count(1) as num
from
(SELECT
ri.equ_list,
ri.equ_category,
ri.equ_define,
concat(u.PROVINCE,'#', u.CITY,'#', u.COUNTY) as areaCode
FROM FROM
"tzs_jg_enable_disable_eq" ae, privilege_company pc
tzs_jg_enable_disable a, INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
"idx_biz_jg_use_info" u, INNER JOIN tzs_jg_enable_disable tjed ON tjed.use_unit_credit_code = bi.use_unit_code
idx_biz_jg_register_info ri AND tjed.audit_status = '已完成' and tjed.apply_type ='SB_TY'
where INNER JOIN tzs_jg_enable_disable_eq tjede ON tjede.enable_disable_apply_id = tjed.sequence_nbr
a.sequence_nbr = ae.enable_disable_apply_id INNER JOIN idx_biz_jg_register_info jri ON tjede.equ_id = jri.record
and ae.equ_id = u."RECORD" WHERE pc.company_code = #{cityCode}
and u."RECORD" = ri."RECORD" AND ( tjed.audit_pass_date BETWEEN #{ beginDate } AND #{ endDate } )
and (a.audit_pass_date between #{beginDate} and #{endDate}) AND tjed.is_delete = 0
and a.apply_type ='SB_TY' GROUP BY jri.equ_category
and a.audit_status='已完成'
and u."PROVINCE" <![CDATA[<>]]> ''
and u."CITY" <![CDATA[<>]]> ''
and u."COUNTY" <![CDATA[<>]]> ''
) c
where
c.areaCode like concat('%',#{cityCode}, '%')
group by
c.equ_list,
c.equ_category,
c.equ_define
</select> </select>
<select id="queryForFlowingEquipList" resultType="com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto"> <select id="queryForFlowingEquipList" resultType="com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto">
......
...@@ -256,42 +256,23 @@ ...@@ -256,42 +256,23 @@
WHERE ur.sequence_nbr = #{sequenceNbr} WHERE ur.sequence_nbr = #{sequenceNbr}
LIMIT 1 LIMIT 1
</select> </select>
<select id="queryScrappedDeviceStaticListData"
resultType="com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto"> <select id="queryScrappedDeviceStaticListData" resultType="com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto">
select SELECT COUNT(1) AS num,
c.equ_list, jri.equ_list AS equList,
c.equ_category, jri.equ_category AS equCategory
c.equ_define, FROM privilege_company pc
count(1) as num INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
from INNER JOIN tzs_jg_scrap_cancel tjsc ON tjsc.use_unit_code = bi.use_unit_code
(SELECT AND tjsc.audit_status = '已完成' and tjsc.cancel_type ='1'
ri.equ_list, INNER JOIN tzs_jg_scrap_cancel_eq tjsce ON tjsce.equip_transfer_id = tjsc.sequence_nbr
ri.equ_category, INNER JOIN idx_biz_jg_register_info jri ON tjsce.equ_id = jri.record
ri.equ_define, WHERE pc.company_code = #{cityCode}
concat(u.PROVINCE,'#', u.CITY,'#', u.COUNTY) as areaCode AND ( tjsc.audit_pass_date BETWEEN #{ beginDate } AND #{ endDate } )
FROM AND tjsc.is_delete = 0
"tzs_jg_scrap_cancel_eq" ae, GROUP BY jri.equ_category
tzs_jg_scrap_cancel a,
"idx_biz_jg_use_info" u,
idx_biz_jg_register_info ri
where
a.sequence_nbr = ae.equip_transfer_id
and ae.equ_id = u."RECORD"
and u."RECORD" = ri."RECORD"
and (a.audit_pass_date between #{beginDate} and #{endDate})
and a.cancel_type ='1'
and a.audit_status='已完成'
and u."PROVINCE" <![CDATA[<>]]> ''
and u."CITY" <![CDATA[<>]]> ''
and u."COUNTY" <![CDATA[<>]]> ''
) c
where
c.areaCode like concat('%',#{cityCode}, '%')
group by
c.equ_list,
c.equ_category,
c.equ_define
</select> </select>
<select id="getScrappedDeviceCount" resultType="java.util.Map"> <select id="getScrappedDeviceCount" resultType="java.util.Map">
select select
count(1) as num,c.time count(1) as num,c.time
......
...@@ -1487,42 +1487,24 @@ ...@@ -1487,42 +1487,24 @@
LEFT JOIN idx_biz_jg_register_info jri ON re.equ_id = jri.RECORD LEFT JOIN idx_biz_jg_register_info jri ON re.equ_id = jri.RECORD
where ur.sequence_nbr = #{sequenceNbr} where ur.sequence_nbr = #{sequenceNbr}
</select> </select>
<select id="queryNewDeviceStaticListData"
resultType="com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto"> <select id="queryNewDeviceStaticListData" resultType="com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto">
select SELECT COUNT ( 1 ) as num,
c.equ_list, jri.equ_list AS equList,
c.equ_category, jri.equ_category AS equCategory
c.equ_define,
count(1) as num
from
(SELECT
ri.equ_list,
ri.equ_category,
ri.equ_define,
concat(u.PROVINCE,'#', u.CITY,'#', u.COUNTY) as areaCode
FROM FROM
"tzs_jg_use_registration_eq" ae, privilege_company pc
tzs_jg_use_registration a, INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
"idx_biz_jg_use_info" u, INNER JOIN tzs_jg_use_registration ur ON ur.use_unit_credit_code = bi.use_unit_code
idx_biz_jg_register_info ri AND ur.status = '已完成'
where INNER JOIN tzs_jg_use_registration_eq te ON te.equip_transfer_id = ur.sequence_nbr
ae.equ_id = u."RECORD" INNER JOIN idx_biz_jg_register_info jri ON te.equ_id = jri.record
and a.sequence_nbr = ae.equip_transfer_id WHERE pc.company_code = #{cityCode} and (ur.audit_pass_date between #{beginDate} and #{endDate})
and u."RECORD" = ri."RECORD" and ur.is_delete = 0
and (a.audit_pass_date between #{beginDate} and #{endDate}) GROUP BY
and a.status='已完成' jri.equ_category
and a.is_delete = 0
and u."PROVINCE" <![CDATA[<>]]> ''
and u."CITY" <![CDATA[<>]]> ''
and u."COUNTY" <![CDATA[<>]]> ''
) c
where
c.areaCode like concat('%',#{cityCode}, '%')
group by
c.equ_list,
c.equ_category,
c.equ_define
</select> </select>
<select id="getUseRegisterCount" resultType="java.util.Map"> <select id="getUseRegisterCount" resultType="java.util.Map">
SELECT COUNT(1) AS num,C.time SELECT COUNT(1) AS num,C.time
FROM FROM
...@@ -1534,8 +1516,7 @@ ...@@ -1534,8 +1516,7 @@
tzs_jg_use_registration A, tzs_jg_use_registration A,
"idx_biz_jg_use_info" u, "idx_biz_jg_use_info" u,
idx_biz_jg_register_info ri idx_biz_jg_register_info ri
WHERE WHERE ae.equ_id = u."RECORD"
ae.equ_id = u."RECORD"
AND ri.EQU_CATEGORY = '2300' AND ri.EQU_CATEGORY = '2300'
AND A.sequence_nbr = ae.equip_transfer_id AND A.sequence_nbr = ae.equip_transfer_id
AND u."RECORD" = ri."RECORD" AND u."RECORD" = ri."RECORD"
......
...@@ -1168,9 +1168,9 @@ public class JGDPStatisticsServiceImpl { ...@@ -1168,9 +1168,9 @@ public class JGDPStatisticsServiceImpl {
//停用 //停用
List<Map> stopList = useRegistrationMapper.stopStateCount(orgCode); List<Map> stopList = useRegistrationMapper.stopStateCount(orgCode);
//注销 //注销
List<Map> cancelList = useRegistrationMapper.cancelStateCount(orgCode, 1); List<Map> cancelList = useRegistrationMapper.cancelStateCount(orgCode, 2);
//报废 //报废
List<Map> scrapList = useRegistrationMapper.cancelStateCount(orgCode, 2); List<Map> scrapList = useRegistrationMapper.cancelStateCount(orgCode, 1);
Map<String, Long> stopMap = new HashMap<>(); Map<String, Long> stopMap = new HashMap<>();
Map<String, Long> cancelMap = new HashMap<>(); Map<String, Long> cancelMap = new HashMap<>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment