Commit 479a59c1 authored by suhuiguang's avatar suhuiguang

1.业务办结率统计优化

parent 4a594cee
......@@ -233,7 +233,7 @@ public interface CommonMapper extends BaseMapper<EquipmentCategory> {
Page<Map<String, Object>> countBizFinishedNumForDPListSYDJ(@Param("page") Page<Map<String, Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto);
Page<Map<String, Object>> countBizFinishedNumForDPListDQJY(@Param("page") Page<Map<String, Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto);
Page<Map<String, Object>> countBizFinishedNumForDPListDQJY(@Param("page") Page<Map<String, Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto);
Page<Map<String, Object>> countBizFinishedNumForDPListBGDJ(@Param("page") Page<Map<String, Object>> page, @Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamForDetailDto);
......
......@@ -1292,9 +1292,7 @@
<select id="countBizFinishedNumForDPList" resultType="java.util.Map">
SELECT * FROM (SELECT sequence_nbr as sequenceNbr,install_unit_name as unitName,receive_org_name as
receiveOrgName,create_date as createDate,handle_date as handleDate,'azgz' as tplType,'azgz' as bType,
CASE when notice_status = 0 then '已完成'
ELSE '进行中'
END as status
'已完成' as status
FROM "tzs_jg_installation_notice"
where
receive_company_org_code like CONCAT(#{orgCode}, '%') and notice_status = '6616'
......@@ -1313,9 +1311,7 @@
union all
SELECT sequence_nbr as sequenceNbr,install_unit_name as unitName,receive_org_name as
receiveOrgName,create_date as createDate,handle_date as handleDate,'azgz' as tplType,'azgz' as bType,
CASE when notice_status = 0 then '已完成'
ELSE '进行中'
END as status FROM "tzs_jg_installation_notice" where receive_company_org_code like CONCAT(#{orgCode}, '%') and notice_status != '6610' and notice_status != '6615' and notice_status != '6617' and notice_status != '6616'
'进行中' as status FROM "tzs_jg_installation_notice" where receive_company_org_code like CONCAT(#{orgCode}, '%') and notice_status != '6610' and notice_status != '6615' and notice_status != '6617' and notice_status != '6616'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(notice_date as date),#{dto.beginDate})
</if>
......@@ -1333,9 +1329,7 @@
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as
receiveOrgName,application_date as createDate,accept_date as handleDate,'jdjy' as tplType,'jdjy' as bType,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
'已完成' as status
FROM
"tz_jyjc_inspection_application" a,
tz_base_enterprise_info b
......@@ -1359,9 +1353,7 @@
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as
receiveOrgName,application_date as createDate,accept_date as handleDate,'jdjy' as tplType,'jdjy' as bType,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
'进行中' as status
FROM
"tz_jyjc_inspection_application" a,
tz_base_enterprise_info b
......@@ -1416,7 +1408,7 @@
)
union all
SELECT * FROM (
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'sydj' as tplType,'sydj' as bType, status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成' and is_delete = 0
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'sydj' as tplType,'sydj' as bType, '进行中' as status FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成' and is_delete = 0
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -1430,7 +1422,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'sydj' as tplType,'vehicle' as bType, status FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'sydj' as tplType,'vehicle' as bType, '进行中' as status FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -1449,9 +1441,7 @@
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate,
'dqjy' as tplType,'dqjy' as bType,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
'已完成' as status
FROM
"tz_jyjc_inspection_application" a,
tz_base_enterprise_info b
......@@ -1475,9 +1465,7 @@
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate,
'dqjy' as tplType,'dqjy' as bType,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
'进行中' as status
FROM
"tz_jyjc_inspection_application" a,
tz_base_enterprise_info b
......@@ -1572,7 +1560,7 @@
)
union all
select * from (
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'bgdj' as tplType,'gm' as bType, a.audit_status as status from tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位已撤回' and a.audit_status != '使用单位待提交' and a.audit_status !='已作废' and a.audit_status !='已完成'
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'bgdj' as tplType,'gm' as bType, '进行中' as status from tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位已撤回' and a.audit_status != '使用单位待提交' and a.audit_status !='已作废' and a.audit_status !='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.apply_date as date),#{dto.beginDate})
</if>
......@@ -1586,7 +1574,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'bgdj' as tplType,'gz' as bType, audit_status as status FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'bgdj' as tplType,'gz' as bType,'进行中' as status FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -1600,7 +1588,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'bgdj' as tplType,'yz' as bType ,audit_status as status FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'bgdj' as tplType,'yz' as bType ,'进行中' as status FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -1614,7 +1602,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'bgdj' as tplType,'dw' as bType ,status FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'bgdj' as tplType,'dw' as bType ,'进行中' as status FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(apply_date as date),#{dto.beginDate})
</if>
......@@ -1629,7 +1617,7 @@
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'bgdj' as tplType,'cyqp' as bType ,status FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'bgdj' as tplType,'cyqp' as bType ,'进行中' as status FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(apply_date as date),#{dto.beginDate})
</if>
......@@ -1645,7 +1633,7 @@
)
union all
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'zxbf' as tplType,'zxbf' as bType, a.status as status from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status = '已完成'
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'zxbf' as tplType,'zxbf' as bType, a.audit_status as status from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status = '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -1659,7 +1647,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'zxbf' as tplType,'zxbf' as bType, a.status as status from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位待提交' and a.audit_status != '使用单位已撤回' and a.audit_status != '已作废' and a.audit_status != '已完成'
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'zxbf' as tplType,'zxbf' as bType, '进行中' as status from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位待提交' and a.audit_status != '使用单位已撤回' and a.audit_status != '已作废' and a.audit_status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.create_date as date),#{dto.beginDate})
</if>
......@@ -1909,9 +1897,7 @@
<select id="countBizFinishedNumForDPListAZGZ" resultType="java.util.Map">
SELECT sequence_nbr as sequenceNbr,install_unit_name as unitName,receive_org_name as
receiveOrgName,create_date as createDate,handle_date as handleDate,'azgz' as tplType,'azgz' as bType,
CASE when notice_status = 0 then '已完成'
ELSE '进行中'
END as status
'已完成' as status
FROM "tzs_jg_installation_notice"
where
receive_company_org_code like CONCAT(#{orgCode}, '%') and notice_status = '6616'
......@@ -1930,9 +1916,7 @@
union all
SELECT sequence_nbr as sequenceNbr,install_unit_name as unitName,receive_org_name as
receiveOrgName,create_date as createDate,handle_date as handleDate,'azgz' as tplType,'azgz' as bType,
CASE when notice_status = 0 then '已完成'
ELSE '进行中'
END as status FROM "tzs_jg_installation_notice" where receive_company_org_code like CONCAT(#{orgCode}, '%') and notice_status != '6610' and notice_status != '6615' and notice_status != '6617' and notice_status != '6616'
'进行中'as status FROM "tzs_jg_installation_notice" where receive_company_org_code like CONCAT(#{orgCode}, '%') and notice_status != '6610' and notice_status != '6615' and notice_status != '6617' and notice_status != '6616'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(notice_date as date),#{dto.beginDate})
</if>
......@@ -1950,9 +1934,7 @@
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as
receiveOrgName,application_date as createDate,accept_date as handleDate,'jdjy' as tplType,'jdjy' as bType,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
'已完成' as status
FROM
"tz_jyjc_inspection_application" a,
tz_base_enterprise_info b
......@@ -1976,9 +1958,7 @@
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as
receiveOrgName,application_date as createDate,accept_date as handleDate,'jdjy' as tplType,'jdjy' as bType,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
'进行中' as status
FROM
"tz_jyjc_inspection_application" a,
tz_base_enterprise_info b
......@@ -2033,7 +2013,7 @@
)
union all
SELECT * FROM (
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'sydj' as tplType,'sydj' as bType FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成' and is_delete = 0
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate, '进行中' as status,'sydj' as tplType,'sydj' as bType FROM "tzs_jg_use_registration" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成' and is_delete = 0
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -2047,7 +2027,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'sydj' as tplType,'vehicle' as bType FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate, '进行中' as status,'sydj' as tplType,'vehicle' as bType FROM "tzs_jg_vehicle_information" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -2066,9 +2046,7 @@
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate,
'dqjy' as tplType,'dqjy' as bType,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
'已完成' as status
FROM
"tz_jyjc_inspection_application" a,
tz_base_enterprise_info b
......@@ -2092,9 +2070,7 @@
SELECT
a.sequence_nbr as sequenceNbr,application_unit_name as unitName,inspection_unit_name as receiveOrgName,application_date as createDate,accept_date as handleDate,
'dqjy' as tplType,'dqjy' as bType,
CASE when a.status = 0 then '已完成'
ELSE '进行中'
END as status
'进行中' as status
FROM
"tz_jyjc_inspection_application" a,
tz_base_enterprise_info b
......@@ -2190,7 +2166,7 @@
)
union all
select * from (
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status,'bgdj' as tplType,'gm' as bType from tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位已撤回' and a.audit_status != '使用单位待提交' and a.audit_status !='已作废' and a.audit_status !='已完成'
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'进行中' as status,'bgdj' as tplType,'gm' as bType from tzs_jg_change_registration_name a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位已撤回' and a.audit_status != '使用单位待提交' and a.audit_status !='已作废' and a.audit_status !='已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.apply_date as date),#{dto.beginDate})
</if>
......@@ -2204,7 +2180,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status,'bgdj' as tplType,'gz' as bType FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'进行中' as status,'bgdj' as tplType,'gz' as bType FROM "tzs_jg_change_registration_reform" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -2218,7 +2194,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,audit_status as status,'bgdj' as tplType,'yz' as bType FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'进行中' as status,'bgdj' as tplType,'yz' as bType FROM "tzs_jg_change_registration_transfer" where receive_company_org_code like CONCAT(#{orgCode}, '%') and audit_status != '使用单位待提交' and audit_status != '使用单位已撤回' and audit_status != '已作废' and audit_status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(reg_date as date),#{dto.beginDate})
</if>
......@@ -2232,7 +2208,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'bgdj' as tplType,'dw' as bType FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'进行中' as status,'bgdj' as tplType,'dw' as bType FROM "tzs_jg_change_registration_unit" where receive_company_org_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(apply_date as date),#{dto.beginDate})
</if>
......@@ -2247,7 +2223,7 @@
</if>
union all
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,status,'bgdj' as tplType,'cyqp' as bType FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
SELECT sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,'进行中' as status,'bgdj' as tplType,'cyqp' as bType FROM "tzs_jg_change_vehicle_registration_unit" where org_branch_code like CONCAT(#{orgCode}, '%') and status != '使用单位待提交' and status != '使用单位已撤回' and status != '已作废' and status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(apply_date as date),#{dto.beginDate})
</if>
......@@ -2263,7 +2239,7 @@
)
</select>
<select id="countBizFinishedNumForDPListZXBX" resultType="java.util.Map">
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.status as status,'zxbf' as tplType,'zxbf' as bType from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status = '已完成'
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.audit_status as status,'zxbf' as tplType,'zxbf' as bType from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status = '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.audit_pass_date as date),#{dto.beginDate})
</if>
......@@ -2277,7 +2253,7 @@
and receive_org_name like CONCAT('%', #{dto.superviseUnitName}, '%')
</if>
union all
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate,a.status as status,'zxbf' as tplType,'zxbf' as bType from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位待提交' and a.audit_status != '使用单位已撤回' and a.audit_status != '已作废' and a.audit_status != '已完成'
select a.sequence_nbr as sequenceNbr,use_unit_name as unitName,receive_org_name as receiveOrgName,create_date as createDate,audit_pass_date as handleDate, '进行中' as status,'zxbf' as tplType,'zxbf' as bType from tzs_jg_scrap_cancel a, privilege_company b where a.receive_org_code= b.company_code and b.org_code like CONCAT(#{orgCode}, '%') and a.audit_status != '使用单位待提交' and a.audit_status != '使用单位已撤回' and a.audit_status != '已作废' and a.audit_status != '已完成'
<if test="dto.beginDate != null and dto.beginDate != ''">
and date_ge(CAST(a.create_date as date),#{dto.beginDate})
</if>
......
......@@ -46,6 +46,7 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.*;
import com.yeejoin.amos.feign.systemctl.model.RegionModel;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.io.IOUtils;
......@@ -97,6 +98,7 @@ import static com.alibaba.fastjson.JSON.parseArray;
*/
@Service
@Slf4j
@RequiredArgsConstructor
public class JGDPStatisticsServiceImpl {
/**
......@@ -191,146 +193,78 @@ public class JGDPStatisticsServiceImpl {
@Value("classpath:/json/jgdp_businessType.json")
private Resource allBusinessType;
private JgUseRegistrationMapper useRegistrationMapper;
private final JgUseRegistrationMapper useRegistrationMapper;
private CylinderBusinessStatisticsMapper businessStatisticsMapper;
private final CylinderBusinessStatisticsMapper businessStatisticsMapper;
private JgEnableDisableMapper enableDisableMapper;
private final JgEnableDisableMapper enableDisableMapper;
private JgScrapCancelMapper scrapCancelMapper;
private final JgScrapCancelMapper scrapCancelMapper;
private RestHighLevelClient restHighLevelClient;
private final RestHighLevelClient restHighLevelClient;
private TzBaseEnterpriseInfoMapper enterpriseInfoMapper;
private final TzBaseEnterpriseInfoMapper enterpriseInfoMapper;
private CommonMapper commonMapper;
private final CommonMapper commonMapper;
private TzsUserInfoMapper userInfoMapper;
private final TzsUserInfoMapper userInfoMapper;
private ZLStatisticsMapper zlStatisticsMapper;
private final ZLStatisticsMapper zlStatisticsMapper;
private JGStatisticsMapper jgStatisticsMapper;
private final JGStatisticsMapper jgStatisticsMapper;
private JgUseRegistrationManageMapper jgUseRegistrationManageMapper;
private final JgUseRegistrationManageMapper jgUseRegistrationManageMapper;
private StCommonServiceImpl stCommonService;
private final StCommonServiceImpl stCommonService;
private RedisUtils redisUtils;
private final RedisUtils redisUtils;
private SafetyProblemTracingMapper safetyProblemTracingMapper;
private final SafetyProblemTracingMapper safetyProblemTracingMapper;
private JgCertificateChangeRecordMapper jgCertificateChangeRecordMapper;
private final JgCertificateChangeRecordMapper jgCertificateChangeRecordMapper;
private IdxBizJgRegisterInfoMapper idxBizJgRegisterInfoMapper;
private final IdxBizJgRegisterInfoMapper idxBizJgRegisterInfoMapper;
private EquipmentCategoryMapper equipmentCategoryMapper;
private final EquipmentCategoryMapper equipmentCategoryMapper;
private IdxBizJgUseInfoMapper idxBizJgUseInfoMapper;
private final IdxBizJgUseInfoMapper idxBizJgUseInfoMapper;
private IdxBizJgFactoryInfoMapper idxBizJgFactoryInfoMapper;
private final IdxBizJgFactoryInfoMapper idxBizJgFactoryInfoMapper;
private IdxBizJgDesignInfoMapper idxBizJgDesignInfoMapper;
private final IdxBizJgDesignInfoMapper idxBizJgDesignInfoMapper;
private IdxBizJgSupervisionInfoMapper idxBizJgSupervisionInfoMapper;
private final IdxBizJgSupervisionInfoMapper idxBizJgSupervisionInfoMapper;
private IdxBizJgTechParamsRopewayMapper idxBizJgTechParamsRopewayMapper;
private final IdxBizJgTechParamsRopewayMapper idxBizJgTechParamsRopewayMapper;
private IdxBizJgTechParamsBoilerMapper idxBizJgTechParamsBoilerMapper;
private final IdxBizJgTechParamsBoilerMapper idxBizJgTechParamsBoilerMapper;
private IdxBizJgConstructionInfoMapper idxBizJgConstructionInfoMapper;
private final IdxBizJgConstructionInfoMapper idxBizJgConstructionInfoMapper;
private IdxBizJgOtherInfoMapper idxBizJgOtherInfoMapper;
private final IdxBizJgOtherInfoMapper idxBizJgOtherInfoMapper;
private IdxBizJgMaintenanceRecordInfoMapper idxBizJgMaintenanceRecordInfoMapper;
private final IdxBizJgMaintenanceRecordInfoMapper idxBizJgMaintenanceRecordInfoMapper;
private IdxBizJgInspectionDetectionInfoMapper idxBizJgInspectionDetectionInfoMapper;
private final IdxBizJgInspectionDetectionInfoMapper idxBizJgInspectionDetectionInfoMapper;
private IdxBizJgMainPartsMapper idxBizJgMainPartsMapper;
private final IdxBizJgMainPartsMapper idxBizJgMainPartsMapper;
private IdxBizJgProtectionDevicesMapper idxBizJgProtectionDevicesMapper;
private final IdxBizJgProtectionDevicesMapper idxBizJgProtectionDevicesMapper;
private IdxBizJgTechParamsElevatorMapper idxBizJgTechParamsElevatorMapper;
private final IdxBizJgTechParamsElevatorMapper idxBizJgTechParamsElevatorMapper;
private IdxBizJgTechParamsVehicleMapper idxBizJgTechParamsVehicleMapper;
private final IdxBizJgTechParamsVehicleMapper idxBizJgTechParamsVehicleMapper;
private IdxBizJgTechParamsRidesMapper idxBizJgTechParamsRidesMapper;
private final IdxBizJgTechParamsRidesMapper idxBizJgTechParamsRidesMapper;
private IdxBizJgTechParamsVesselMapper idxBizJgTechParamsVesselMapper;
private final IdxBizJgTechParamsVesselMapper idxBizJgTechParamsVesselMapper;
private IdxBizJgTechParamsPipelineMapper idxBizJgTechParamsPipelineMapper;
private final IdxBizJgTechParamsPipelineMapper idxBizJgTechParamsPipelineMapper;
private IdxBizJgTechParamsLiftingMapper idxBizJgTechParamsLiftingMapper;
private final IdxBizJgTechParamsLiftingMapper idxBizJgTechParamsLiftingMapper;
private final DataDictionaryServiceImpl iDataDictionaryService;
public JGDPStatisticsServiceImpl(JgUseRegistrationMapper useRegistrationMapper, JgEnableDisableMapper enableDisableMapper,
JgScrapCancelMapper scrapCancelMapper, RestHighLevelClient restHighLevelClient,
TzBaseEnterpriseInfoMapper enterpriseInfoMapper, CommonMapper commonMapper,
TzsUserInfoMapper userInfoMapper, ZLStatisticsMapper zlStatisticsMapper,
JGStatisticsMapper jgStatisticsMapper,
JgUseRegistrationManageMapper jgUseRegistrationManageMapper,
StCommonServiceImpl stCommonService, RedisUtils redisUtils,
JgCertificateChangeRecordMapper jgCertificateChangeRecordMapper,
IdxBizJgRegisterInfoMapper idxBizJgRegisterInfoMapper,
EquipmentCategoryMapper equipmentCategoryMapper,
IdxBizJgUseInfoMapper idxBizJgUseInfoMapper,
IdxBizJgSupervisionInfoMapper idxBizJgSupervisionInfoMapper,
IdxBizJgDesignInfoMapper idxBizJgDesignInfoMapper,
IdxBizJgFactoryInfoMapper idxBizJgFactoryInfoMapper,
IdxBizJgTechParamsRopewayMapper idxBizJgTechParamsRopewayMapper,
IdxBizJgConstructionInfoMapper idxBizJgConstructionInfoMapper,
IdxBizJgOtherInfoMapper idxBizJgOtherInfoMapper,
IdxBizJgMaintenanceRecordInfoMapper idxBizJgMaintenanceRecordInfoMapper,
IdxBizJgInspectionDetectionInfoMapper idxBizJgInspectionDetectionInfoMapper,
IdxBizJgMainPartsMapper idxBizJgMainPartsMapper,
IdxBizJgProtectionDevicesMapper idxBizJgProtectionDevicesMapper,
IdxBizJgTechParamsLiftingMapper iIdxBizJgTechParamsLiftingMapper,
IdxBizJgTechParamsVehicleMapper idxBizJgTechParamsVehicleMapper,
IdxBizJgTechParamsRidesMapper idxBizJgTechParamsRidesMapper,
IdxBizJgTechParamsBoilerMapper idxBizJgTechParamsBoilerMapper,
IdxBizJgTechParamsVesselMapper idxBizJgTechParamsVesselMapper,
IdxBizJgTechParamsPipelineMapper idxBizJgTechParamsPipelineMapper,
IdxBizJgTechParamsElevatorMapper idxBizJgTechParamsElevatorMapper,
DataDictionaryServiceImpl iDataDictionaryService,
SafetyProblemTracingMapper safetyProblemTracingMapper,
CylinderBusinessStatisticsMapper businessStatisticsMapper) {
this.useRegistrationMapper = useRegistrationMapper;
this.businessStatisticsMapper = businessStatisticsMapper;
this.enableDisableMapper = enableDisableMapper;
this.scrapCancelMapper = scrapCancelMapper;
this.restHighLevelClient = restHighLevelClient;
this.enterpriseInfoMapper = enterpriseInfoMapper;
this.commonMapper = commonMapper;
this.userInfoMapper = userInfoMapper;
this.zlStatisticsMapper = zlStatisticsMapper;
this.jgStatisticsMapper = jgStatisticsMapper;
this.jgUseRegistrationManageMapper = jgUseRegistrationManageMapper;
this.stCommonService = stCommonService;
this.redisUtils = redisUtils;
this.safetyProblemTracingMapper = safetyProblemTracingMapper;
this.jgCertificateChangeRecordMapper = jgCertificateChangeRecordMapper;
this.equipmentCategoryMapper = equipmentCategoryMapper;
this.idxBizJgUseInfoMapper = idxBizJgUseInfoMapper;
this.idxBizJgDesignInfoMapper = idxBizJgDesignInfoMapper;
this.idxBizJgSupervisionInfoMapper = idxBizJgSupervisionInfoMapper;
this.idxBizJgTechParamsRopewayMapper = idxBizJgTechParamsRopewayMapper;
this.idxBizJgTechParamsBoilerMapper = idxBizJgTechParamsBoilerMapper;
this.idxBizJgFactoryInfoMapper = idxBizJgFactoryInfoMapper;
this.idxBizJgRegisterInfoMapper = idxBizJgRegisterInfoMapper;
this.idxBizJgConstructionInfoMapper = idxBizJgConstructionInfoMapper;
this.idxBizJgOtherInfoMapper = idxBizJgOtherInfoMapper;
this.idxBizJgMaintenanceRecordInfoMapper = idxBizJgMaintenanceRecordInfoMapper;
this.idxBizJgInspectionDetectionInfoMapper = idxBizJgInspectionDetectionInfoMapper;
this.idxBizJgMainPartsMapper = idxBizJgMainPartsMapper;
this.idxBizJgProtectionDevicesMapper = idxBizJgProtectionDevicesMapper;
this.idxBizJgTechParamsVehicleMapper = idxBizJgTechParamsVehicleMapper;
this.idxBizJgTechParamsRidesMapper = idxBizJgTechParamsRidesMapper;
this.idxBizJgTechParamsVesselMapper = idxBizJgTechParamsVesselMapper;
this.idxBizJgTechParamsPipelineMapper = idxBizJgTechParamsPipelineMapper;
this.idxBizJgTechParamsLiftingMapper = iIdxBizJgTechParamsLiftingMapper;
this.idxBizJgTechParamsElevatorMapper = idxBizJgTechParamsElevatorMapper;
this.iDataDictionaryService = iDataDictionaryService;
}
private List<LegendDataDto> buildLegendDataList() {
List<LegendDataDto> legendDataDtos = new ArrayList<>();
......@@ -921,28 +855,34 @@ public class JGDPStatisticsServiceImpl {
Map<String, Object> result = new HashMap<>();
this.setDefaultFilter(dpFilterParamDto);
result.put("xdata", Arrays.asList("安装告知", "监督检验", "使用登记", "定期检验", "变更登记", "注销报废"));
List<Long> ydata = this.countBizFinishedNum(dpFilterParamDto);
Long allFinishedCount = this.calEveryAll(dpFilterParamDto, ydata).stream().mapToLong(e -> e).sum();
result.put("ydata", this.calEveryAll(dpFilterParamDto, ydata));
result.put("allCount", allFinishedCount);
result.put("percentData", this.calEveryPercent(dpFilterParamDto, ydata));
result.put("completionRate", this.calPercentForBizCycleData(dpFilterParamDto, allFinishedCount));
// 进行中
List<Long> everyFlowingNum = this.countBizDataInFlowing(dpFilterParamDto);
// 已完成
List<Long> everyFinishedNum = this.countBizFinishedNum(dpFilterParamDto);
result.put("ydata", this.calEveryFinishAndFlowNum(everyFinishedNum, everyFlowingNum));
// 进行中 + 已完成的业务单据总数
result.put("allCount", this.calAll(everyFinishedNum, everyFlowingNum));
// 每项业务办结率统计
result.put("percentData", this.calEveryPercent(everyFlowingNum, everyFinishedNum));
// 总的业务办结率统计
result.put("completionRate", this.calPercentForBizCycleData(everyFlowingNum, everyFinishedNum));
return result;
}
private List<Long> calEveryAll(DPFilterParamDto dpFilterParamDto, List<Long> everyFinished) {
List<Long> everyInFlow = countBizDataInFlowing(dpFilterParamDto);
List<Long> allArray = new ArrayList<>();
for (int i = 0; i < everyInFlow.size(); i++) {
Long flowIng = everyInFlow.get(i);
Long finished = everyFinished.get(i);
allArray.add(flowIng + finished);
private Long calAll(List<Long> everyFinishedNum, List<Long> everyFlowingNum) {
return everyFlowingNum.stream().mapToLong(e -> e).sum() + everyFinishedNum.stream().mapToLong(e -> e).sum() ;
}
private List<Long> calEveryFinishAndFlowNum(List<Long> everyFinished, List<Long> everyFlowingCount) {
List<Long> all = new ArrayList<>();
for(int i= 0; i< everyFinished.size(); i++ ){
all.add(everyFinished.get(i) + everyFlowingCount.get(i));
}
return allArray;
return all;
}
private List<String> calEveryPercent(DPFilterParamDto dpFilterParamDto, List<Long> everyFinished) {
List<Long> everyInFlow = countBizDataInFlowing(dpFilterParamDto);
private List<String> calEveryPercent(List<Long> everyInFlow, List<Long> everyFinished) {
List<String> percentArray = new ArrayList<>();
for (int i = 0; i < everyInFlow.size(); i++) {
Long flowIng = everyInFlow.get(i);
......@@ -960,10 +900,11 @@ public class JGDPStatisticsServiceImpl {
return percentArray;
}
private String calPercentForBizCycleData(DPFilterParamDto dpFilterParamDto, Long allFinishedCount) {
Long allBizDataInFlowingCount = this.countAllBizDataInFlowing(dpFilterParamDto);
BigDecimal finish = new BigDecimal(String.valueOf(allFinishedCount));
private String calPercentForBizCycleData(List<Long> everyFlowingNum, List<Long> everyFinishedNum) {
Long allBizDataInFlowingCount = everyFlowingNum.stream().mapToLong(e -> e).sum();
Long allFinishedCount = everyFinishedNum.stream().mapToLong(e -> e).sum();
BigDecimal flowing = new BigDecimal(String.valueOf(allBizDataInFlowingCount));
BigDecimal finish = new BigDecimal(String.valueOf(allFinishedCount));
BigDecimal total = finish.add(flowing);
if (total.compareTo(BigDecimal.ZERO) > 0) {
BigDecimal result = finish.divide(total, 2, RoundingMode.HALF_UP);
......
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