Browse Source

网格、组织治理指数 - 最终版

master
zhangyongzhangyong 4 years ago
parent
commit
00e793fe44
  1. 44
      epdc-cloud-analysis-pc/src/main/resources/mapper/screen/ScreenGovernanceDao.xml

44
epdc-cloud-analysis-pc/src/main/resources/mapper/screen/ScreenGovernanceDao.xml

@ -268,12 +268,11 @@
from( from(
SELECT SELECT
info.*, info.*,
IFNULL((info.problemResolvedCount - info.communityClosedCount - info.streetClosedCount - info.districtClosedCount), 0) gridSelfGovernProjectTotal,
IFNULL( ( info.inGroupTopicResolvedCount + info.inGroupTopicUnResolvedCount ) / info.problemResolvedCount, 0 ) AS groupSelfGovernRatio, IFNULL( ( info.inGroupTopicResolvedCount + info.inGroupTopicUnResolvedCount ) / info.problemResolvedCount, 0 ) AS groupSelfGovernRatio,
IFNULL( info.communityClosedCount / info.problemResolvedCount, 0 ) AS communityClosedRatio, IFNULL( info.communityClosedCount / info.problemResolvedCount, 0 ) AS communityClosedRatio,
IFNULL( info.streetClosedCount / info.problemResolvedCount, 0 ) AS streetClosedRatio, IFNULL( info.streetClosedCount / info.problemResolvedCount, 0 ) AS streetClosedRatio,
IFNULL( info.districtClosedCount / info.problemResolvedCount, 0 ) AS districtDeptClosedRatio IFNULL( info.districtDeptClosedCount / info.problemResolvedCount, 0 ) AS districtDeptClosedRatio
FROM FROM
( (
SELECT SELECT
@ -307,9 +306,10 @@
0 AS eventResolvedCount, 0 AS eventResolvedCount,
0 AS eventUnResolvedCount, 0 AS eventUnResolvedCount,
IFNULL( gridsolved.gridClosedCount, 0 ) AS gridSelfGovernProjectTotal,
IFNULL( commsolved.communityClosedCount, 0 ) AS communityClosedCount, IFNULL( commsolved.communityClosedCount, 0 ) AS communityClosedCount,
IFNULL( streetsolved.streetClosedCount, 0 ) AS streetClosedCount, IFNULL( streetsolved.streetClosedCount, 0 ) AS streetClosedCount,
IFNULL( districtsolved.districtClosedCount, 0 ) AS districtClosedCount IFNULL( districtsolved.districtClosedCount, 0 ) AS districtDeptClosedCount
FROM FROM
esua_epdc_admin.sys_dept sd esua_epdc_admin.sys_dept sd
LEFT JOIN ( LEFT JOIN (
@ -384,6 +384,32 @@
GROUP BY GROUP BY
t.GRID_ID t.GRID_ID
) selfsolved ON selfsolved.GRID_ID = sd.id ) selfsolved ON selfsolved.GRID_ID = sd.id
LEFT JOIN (
SELECT
GRID_ID,
IFNULL( COUNT( 0 ), 0 ) AS gridClosedCount
FROM
(
SELECT
GRID_ID,
eit.id,
hp.HANDLER_DEPT_ID,
eit.UPDATED_TIME
FROM
( SELECT GRID_ID, ID, UPDATED_TIME, ITEM_STATE FROM esua_epdc_events.epdc_item eit
WHERE DEL_FLAG = '0' AND ITEM_STATE IN ( '5', '10' ) GROUP BY EVENT_ID) eit
LEFT JOIN esua_epdc_events.epdc_item_handle_process hp ON hp.item_id = eit.id
LEFT JOIN esua_epdc_admin.sys_dept sd ON sd.id = hp.HANDLER_DEPT_ID
WHERE
hp.DEL_FLAG = '0'
AND hp.STATE IN ( '5', '10' )
AND sd.type_key IN ('grid_party', 'grid_dept')
GROUP BY eit.GRID_ID, eit.ID
) t
WHERE
DATE_FORMAT( t.UPDATED_TIME, '%Y-%m-%d' ) <= DATE_FORMAT( date_add( now(), INTERVAL - 1 DAY ), '%Y-%m-%d' )
GROUP BY t.GRID_ID
) gridsolved ON gridsolved.GRID_ID = sd.id
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
GRID_ID, GRID_ID,
@ -473,7 +499,7 @@
</select> </select>
<select id="agencygoverndaily" resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.ScreenAgencyGovernDailyResultDTO"> <select id="agencygoverndaily" resultType="com.elink.esua.epdc.dto.analysis.pc.screen.result.ScreenAgencyGovernDailyResultDTO">
SELECT SELECT
radio.*, radio.*,
(1 - ROUND(radio.communityClosedRatio, 4) - ROUND(radio.streetClosedRatio, 4) - ROUND(radio.districtDeptClosedRatio, 4)) AS gridSelfGovernRatio (1 - ROUND(radio.communityClosedRatio, 4) - ROUND(radio.streetClosedRatio, 4) - ROUND(radio.districtDeptClosedRatio, 4)) AS gridSelfGovernRatio
FROM ( FROM (
@ -501,12 +527,8 @@
IFNULL( sum( info.approvalProjectUnResolvedCount ), 0 ) AS approvalProjectUnResolvedCount, IFNULL( sum( info.approvalProjectUnResolvedCount ), 0 ) AS approvalProjectUnResolvedCount,
IFNULL( sum( info.inGroupTopicResolvedCount ), 0 ) AS inGroupTopicResolvedCount, IFNULL( sum( info.inGroupTopicResolvedCount ), 0 ) AS inGroupTopicResolvedCount,
IFNULL( sum( info.inGroupTopicUnResolvedCount ), 0 ) AS inGroupTopicUnResolvedCount, IFNULL( sum( info.inGroupTopicUnResolvedCount ), 0 ) AS inGroupTopicUnResolvedCount,
IFNULL(( IFNULL( sum( info.problemResolvedCount ), 0 )
- IFNULL( sum( info.communityClosedCount ), 0 )
- IFNULL( sum( info.streetClosedCount ), 0 )
- IFNULL( sum( info.districtClosedCount ), 0 )), 0
) gridSelfGovernProjectTotal,
IFNULL( sum( info.gridClosedCount ), 0 ) AS gridSelfGovernProjectTotal,
IFNULL( sum( info.communityClosedCount ), 0 ) AS communityClosedCount, IFNULL( sum( info.communityClosedCount ), 0 ) AS communityClosedCount,
IFNULL( sum( info.streetClosedCount ), 0 ) AS streetClosedCount, IFNULL( sum( info.streetClosedCount ), 0 ) AS streetClosedCount,
IFNULL( sum( info.districtClosedCount ), 0 ) AS districtDeptClosedCount, IFNULL( sum( info.districtClosedCount ), 0 ) AS districtDeptClosedCount,
@ -543,6 +565,10 @@
IFNULL( selfsolved.fromAgencyResolvedInGridCount, 0 ) AS fromAgencyResolvedInGridCount, IFNULL( selfsolved.fromAgencyResolvedInGridCount, 0 ) AS fromAgencyResolvedInGridCount,
IFNULL( selfsolved.fromAgencyUnResolvedInGridCount, 0 ) AS fromAgencyUnResolvedInGridCount, IFNULL( selfsolved.fromAgencyUnResolvedInGridCount, 0 ) AS fromAgencyUnResolvedInGridCount,
(IFNULL( item.issueProjectResolvedCount, 0 ) + IFNULL( item.issueProjectUnResolvedCount, 0 ))
- IFNULL( commsolved.communityClosedCount, 0 )
- IFNULL( streetsolved.streetClosedCount, 0 )
- IFNULL( districtsolved.districtClosedCount, 0 ) AS gridClosedCount,
IFNULL( commsolved.communityClosedCount, 0 ) AS communityClosedCount, IFNULL( commsolved.communityClosedCount, 0 ) AS communityClosedCount,
IFNULL( streetsolved.streetClosedCount, 0 ) AS streetClosedCount, IFNULL( streetsolved.streetClosedCount, 0 ) AS streetClosedCount,
IFNULL( districtsolved.districtClosedCount, 0 ) AS districtClosedCount IFNULL( districtsolved.districtClosedCount, 0 ) AS districtClosedCount

Loading…
Cancel
Save