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

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

parent 5ee0545c
......@@ -124,41 +124,22 @@
LEFT JOIN idx_biz_jg_use_info use on jede.equ_id = use.RECORD
where jed.sequence_nbr = #{sequenceNbr}
</select>
<select id="queryStoppedDeviceStaticListData"
resultType="com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto">
select
c.equ_list,
c.equ_category,
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
<select id="queryStoppedDeviceStaticListData" resultType="com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto">
SELECT COUNT(1) AS num,
jri.equ_list AS equList,
jri.equ_category AS equCategory
FROM
"tzs_jg_enable_disable_eq" ae,
tzs_jg_enable_disable a,
"idx_biz_jg_use_info" u,
idx_biz_jg_register_info ri
where
a.sequence_nbr = ae.enable_disable_apply_id
and ae.equ_id = u."RECORD"
and u."RECORD" = ri."RECORD"
and (a.audit_pass_date between #{beginDate} and #{endDate})
and a.apply_type ='SB_TY'
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
privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN tzs_jg_enable_disable tjed ON tjed.use_unit_credit_code = bi.use_unit_code
AND tjed.audit_status = '已完成' and tjed.apply_type ='SB_TY'
INNER JOIN tzs_jg_enable_disable_eq tjede ON tjede.enable_disable_apply_id = tjed.sequence_nbr
INNER JOIN idx_biz_jg_register_info jri ON tjede.equ_id = jri.record
WHERE pc.company_code = #{cityCode}
AND ( tjed.audit_pass_date BETWEEN #{ beginDate } AND #{ endDate } )
AND tjed.is_delete = 0
GROUP BY jri.equ_category
</select>
<select id="queryForFlowingEquipList" resultType="com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto">
......
......@@ -256,42 +256,23 @@
WHERE ur.sequence_nbr = #{sequenceNbr}
LIMIT 1
</select>
<select id="queryScrappedDeviceStaticListData"
resultType="com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto">
select
c.equ_list,
c.equ_category,
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
"tzs_jg_scrap_cancel_eq" ae,
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 id="queryScrappedDeviceStaticListData" resultType="com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto">
SELECT COUNT(1) AS num,
jri.equ_list AS equList,
jri.equ_category AS equCategory
FROM privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN tzs_jg_scrap_cancel tjsc ON tjsc.use_unit_code = bi.use_unit_code
AND tjsc.audit_status = '已完成' and tjsc.cancel_type ='1'
INNER JOIN tzs_jg_scrap_cancel_eq tjsce ON tjsce.equip_transfer_id = tjsc.sequence_nbr
INNER JOIN idx_biz_jg_register_info jri ON tjsce.equ_id = jri.record
WHERE pc.company_code = #{cityCode}
AND ( tjsc.audit_pass_date BETWEEN #{ beginDate } AND #{ endDate } )
AND tjsc.is_delete = 0
GROUP BY jri.equ_category
</select>
<select id="getScrappedDeviceCount" resultType="java.util.Map">
select
count(1) as num,c.time
......
......@@ -1487,42 +1487,24 @@
LEFT JOIN idx_biz_jg_register_info jri ON re.equ_id = jri.RECORD
where ur.sequence_nbr = #{sequenceNbr}
</select>
<select id="queryNewDeviceStaticListData"
resultType="com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto">
select
c.equ_list,
c.equ_category,
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
<select id="queryNewDeviceStaticListData" resultType="com.yeejoin.amos.boot.module.jg.api.dto.EquipBizCountDto">
SELECT COUNT ( 1 ) as num,
jri.equ_list AS equList,
jri.equ_category AS equCategory
FROM
"tzs_jg_use_registration_eq" ae,
tzs_jg_use_registration a,
"idx_biz_jg_use_info" u,
idx_biz_jg_register_info ri
where
ae.equ_id = u."RECORD"
and a.sequence_nbr = ae.equip_transfer_id
and u."RECORD" = ri."RECORD"
and (a.audit_pass_date between #{beginDate} and #{endDate})
and a.status='已完成'
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
privilege_company pc
INNER JOIN tz_base_enterprise_info bi ON bi.supervise_org_code LIKE CONCAT ( pc.org_code, '%' )
INNER JOIN tzs_jg_use_registration ur ON ur.use_unit_credit_code = bi.use_unit_code
AND ur.status = '已完成'
INNER JOIN tzs_jg_use_registration_eq te ON te.equip_transfer_id = ur.sequence_nbr
INNER JOIN idx_biz_jg_register_info jri ON te.equ_id = jri.record
WHERE pc.company_code = #{cityCode} and (ur.audit_pass_date between #{beginDate} and #{endDate})
and ur.is_delete = 0
GROUP BY
jri.equ_category
</select>
<select id="getUseRegisterCount" resultType="java.util.Map">
SELECT COUNT(1) AS num,C.time
FROM
......@@ -1534,8 +1516,7 @@
tzs_jg_use_registration A,
"idx_biz_jg_use_info" u,
idx_biz_jg_register_info ri
WHERE
ae.equ_id = u."RECORD"
WHERE ae.equ_id = u."RECORD"
AND ri.EQU_CATEGORY = '2300'
AND A.sequence_nbr = ae.equip_transfer_id
AND u."RECORD" = ri."RECORD"
......
......@@ -1168,9 +1168,9 @@ public class JGDPStatisticsServiceImpl {
//停用
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> 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