From 00e793fe44794214bd4c75648bc55e5f7eef2ebc Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.com> Date: Tue, 21 Dec 2021 15:19:57 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E3=80=81=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0=20-=20=E6=9C=80=E7=BB=88?= =?UTF-8?q?=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/screen/ScreenGovernanceDao.xml | 44 +++++++++++++++---- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/epdc-cloud-analysis-pc/src/main/resources/mapper/screen/ScreenGovernanceDao.xml b/epdc-cloud-analysis-pc/src/main/resources/mapper/screen/ScreenGovernanceDao.xml index 126b0a6..94c3fae 100644 --- a/epdc-cloud-analysis-pc/src/main/resources/mapper/screen/ScreenGovernanceDao.xml +++ b/epdc-cloud-analysis-pc/src/main/resources/mapper/screen/ScreenGovernanceDao.xml @@ -268,12 +268,11 @@ from( SELECT info.*, - IFNULL((info.problemResolvedCount - info.communityClosedCount - info.streetClosedCount - info.districtClosedCount), 0) gridSelfGovernProjectTotal, IFNULL( ( info.inGroupTopicResolvedCount + info.inGroupTopicUnResolvedCount ) / info.problemResolvedCount, 0 ) AS groupSelfGovernRatio, IFNULL( info.communityClosedCount / info.problemResolvedCount, 0 ) AS communityClosedRatio, 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 ( SELECT @@ -307,9 +306,10 @@ 0 AS eventResolvedCount, 0 AS eventUnResolvedCount, + IFNULL( gridsolved.gridClosedCount, 0 ) AS gridSelfGovernProjectTotal, IFNULL( commsolved.communityClosedCount, 0 ) AS communityClosedCount, IFNULL( streetsolved.streetClosedCount, 0 ) AS streetClosedCount, - IFNULL( districtsolved.districtClosedCount, 0 ) AS districtClosedCount + IFNULL( districtsolved.districtClosedCount, 0 ) AS districtDeptClosedCount FROM esua_epdc_admin.sys_dept sd LEFT JOIN ( @@ -384,6 +384,32 @@ GROUP BY t.GRID_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 ( SELECT GRID_ID, @@ -473,7 +499,7 @@