From b8e036ece2cc71ed3a24cafdf205145e1b192e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E9=A3=9E?= Date: Tue, 17 Nov 2020 16:19:11 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E4=BA=BA=E6=95=B0=E7=BB=9F=E8=AE=A1=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/screen/DataStatsScreencollDao.xml | 127 +++++++++++++----- 1 file changed, 95 insertions(+), 32 deletions(-) diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/DataStatsScreencollDao.xml b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/DataStatsScreencollDao.xml index f7d6b2ce5..822b26a69 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/DataStatsScreencollDao.xml +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/DataStatsScreencollDao.xml @@ -909,17 +909,17 @@ union all IFNULL(t.groupTotal,0) AS groupTotal, IFNULL(t.issueTotal,0) AS issueTotal, IFNULL(t.topicTotal,0) AS topicTotal, - IFNULL(t.projectTotal,0) AS projectTotal, + IFNULL(t.projectTotal,0) as projectTotal, 0 as companyTotal, DATE_FORMAT(now(),'%Y%m%d') as dataEndTime FROM esua_epdc_admin.sys_dept gr left join (select total.GRID_ID, - sum(total.userTotal) as userTotal, + sum(total.userTotal+total.companyTotal) as userTotal, sum(total.partyTotal) as partyTotal, sum(total.groupTotal) as groupTotal, sum(total.issueTotal) as issueTotal, sum(total.topicTotal) as topicTotal, - sum(total.projectTotal) as projectTotal + sum(total.projectTotal) as projectTotal, 0 as companyTotal from (select eu.DEPT_ID AS GRID_ID, count(eu.id) as userTotal, @@ -927,11 +927,28 @@ union all 0 as groupTotal, 0 as issueTotal, 0 as topicTotal, - 0 as projectTotal + 0 as projectTotal, 0 as companyTotal from esua_epdc_user.epdc_user eu where eu.DEL_FLAG=0 group by eu.DEPT_ID + + UNION all + SELECT + DEPT_ID AS GRID_ID, + 0 as userTotal, + 0 AS partyTotal, + 0 as groupTotal, + 0 as issueTotal, + 0 as topicTotal, + 0 as projectTotal, count(id) as companyTotal + FROM + esua_epdc_custom.epdc_enterprise_info + WHERE + DEL_FLAG = 0 + GROUP BY + DEPT_ID + UNION ALL select GRID_ID, @@ -940,7 +957,7 @@ union all count(id) as groupTotal, 0 as issueTotal, 0 as topicTotal, - 0 as projectTotal + 0 as projectTotal, 0 as companyTotal from esua_epdc_group.epdc_group where DEL_FLAG=0 and STATE=10 group by GRID_ID @@ -953,7 +970,7 @@ union all 0 as groupTotal, count(id) as issueTotal, 0 as topicTotal, - 0 as projectTotal + 0 as projectTotal, 0 as companyTotal from esua_epdc_events.epdc_issue where DEL_FLAG=0 group by GRID_ID @@ -966,7 +983,7 @@ union all 0 as groupTotal, 0 as issueTotal, count(id) as topicTotal, - 0 as projectTotal + 0 as projectTotal, 0 as companyTotal from esua_epdc_group.epdc_topic where DEL_FLAG=0 group by GRID_ID @@ -979,7 +996,7 @@ union all 0 as groupTotal, 0 as issueTotal, 0 as topicTotal, - count(id) as projectTotal + count(id) as projectTotal, 0 as companyTotal from esua_epdc_events.epdc_item where DEL_FLAG=0 group by GRID_ID)total @@ -1001,18 +1018,18 @@ UNION ALL SUM(IFNULL(t.groupTotal,0)) AS groupTotal, SUM(IFNULL(t.issueTotal,0)) AS issueTotal, SUM(IFNULL(t.topicTotal,0)) AS topicTotal, - SUM(IFNULL(t.projectTotal,0)) AS projectTotal, + SUM(IFNULL(t.projectTotal,0)) as projectTotal, 0 as companyTotal, DATE_FORMAT(now(),'%Y%m%d') as dataEndTime FROM esua_epdc_admin.sys_dept co LEFT JOIN esua_epdc_admin.sys_dept gr on co.id=gr.pid left join (select total.GRID_ID, - sum(total.userTotal) as userTotal, + sum(total.userTotal+total.companyTotal) as userTotal, sum(total.partyTotal) as partyTotal, sum(total.groupTotal) as groupTotal, sum(total.issueTotal) as issueTotal, sum(total.topicTotal) as topicTotal, - sum(total.projectTotal) as projectTotal + sum(total.projectTotal) as projectTotal, 0 as companyTotal from (select eu.DEPT_ID AS GRID_ID, count(eu.id) as userTotal, @@ -1020,11 +1037,27 @@ UNION ALL 0 as groupTotal, 0 as issueTotal, 0 as topicTotal, - 0 as projectTotal + 0 as projectTotal, 0 as companyTotal from esua_epdc_user.epdc_user eu where eu.DEL_FLAG=0 group by eu.DEPT_ID + UNION all + SELECT + DEPT_ID AS GRID_ID, + 0 as userTotal, + 0 AS partyTotal, + 0 as groupTotal, + 0 as issueTotal, + 0 as topicTotal, + 0 as projectTotal, count(id) as companyTotal + FROM + esua_epdc_custom.epdc_enterprise_info + WHERE + DEL_FLAG = 0 + GROUP BY + DEPT_ID + UNION ALL select GRID_ID, @@ -1033,7 +1066,7 @@ UNION ALL count(id) as groupTotal, 0 as issueTotal, 0 as topicTotal, - 0 as projectTotal + 0 as projectTotal, 0 as companyTotal from esua_epdc_group.epdc_group where DEL_FLAG=0 and STATE=10 group by GRID_ID @@ -1046,7 +1079,7 @@ UNION ALL 0 as groupTotal, count(id) as issueTotal, 0 as topicTotal, - 0 as projectTotal + 0 as projectTotal, 0 as companyTotal from esua_epdc_events.epdc_issue where DEL_FLAG=0 group by GRID_ID @@ -1059,7 +1092,7 @@ UNION ALL 0 as groupTotal, 0 as issueTotal, count(id) as topicTotal, - 0 as projectTotal + 0 as projectTotal, 0 as companyTotal from esua_epdc_group.epdc_topic where DEL_FLAG=0 group by GRID_ID @@ -1072,7 +1105,7 @@ UNION ALL 0 as groupTotal, 0 as issueTotal, 0 as topicTotal, - count(id) as projectTotal + count(id) as projectTotal, 0 as companyTotal from esua_epdc_events.epdc_item where DEL_FLAG=0 group by GRID_ID)total @@ -1096,19 +1129,19 @@ union all SUM(IFNULL(t.groupTotal,0)) AS groupTotal, SUM(IFNULL(t.issueTotal,0)) AS issueTotal, SUM(IFNULL(t.topicTotal,0)) AS topicTotal, - SUM(IFNULL(t.projectTotal,0)) AS projectTotal, + SUM(IFNULL(t.projectTotal,0)) as projectTotal, 0 as companyTotal, DATE_FORMAT(now(),'%Y%m%d') as dataEndTime FROM esua_epdc_admin.sys_dept st left join esua_epdc_admin.sys_dept co on co.pid=st.id LEFT JOIN esua_epdc_admin.sys_dept gr on co.id=gr.pid left join (select total.GRID_ID, - sum(total.userTotal) as userTotal, + sum(total.userTotal+total.companyTotal) as userTotal, sum(total.partyTotal) as partyTotal, sum(total.groupTotal) as groupTotal, sum(total.issueTotal) as issueTotal, sum(total.topicTotal) as topicTotal, - sum(total.projectTotal) as projectTotal + sum(total.projectTotal) as projectTotal, 0 as companyTotal from (select eu.DEPT_ID AS GRID_ID, count(eu.id) as userTotal, @@ -1116,10 +1149,25 @@ union all 0 as groupTotal, 0 as issueTotal, 0 as topicTotal, - 0 as projectTotal + 0 as projectTotal, 0 as companyTotal from esua_epdc_user.epdc_user eu where eu.DEL_FLAG=0 group by eu.DEPT_ID + UNION all + SELECT + DEPT_ID AS GRID_ID, + 0 as userTotal, + 0 AS partyTotal, + 0 as groupTotal, + 0 as issueTotal, + 0 as topicTotal, + 0 as projectTotal, count(id) as companyTotal + FROM + esua_epdc_custom.epdc_enterprise_info + WHERE + DEL_FLAG = 0 + GROUP BY + DEPT_ID UNION ALL @@ -1129,7 +1177,7 @@ union all count(id) as groupTotal, 0 as issueTotal, 0 as topicTotal, - 0 as projectTotal + 0 as projectTotal, 0 as companyTotal from esua_epdc_group.epdc_group where DEL_FLAG=0 and STATE=10 group by GRID_ID @@ -1142,7 +1190,7 @@ union all 0 as groupTotal, count(id) as issueTotal, 0 as topicTotal, - 0 as projectTotal + 0 as projectTotal, 0 as companyTotal from esua_epdc_events.epdc_issue where DEL_FLAG=0 group by GRID_ID @@ -1155,7 +1203,7 @@ union all 0 as groupTotal, 0 as issueTotal, count(id) as topicTotal, - 0 as projectTotal + 0 as projectTotal, 0 as companyTotal from esua_epdc_group.epdc_topic where DEL_FLAG=0 group by GRID_ID @@ -1168,7 +1216,7 @@ union all 0 as groupTotal, 0 as issueTotal, 0 as topicTotal, - count(id) as projectTotal + count(id) as projectTotal, 0 as companyTotal from esua_epdc_events.epdc_item where DEL_FLAG=0 group by GRID_ID)total @@ -1193,7 +1241,7 @@ union all SUM(IFNULL(t.groupTotal,0)) AS groupTotal, SUM(IFNULL(t.issueTotal,0)) AS issueTotal, SUM(IFNULL(t.topicTotal,0)) AS topicTotal, - SUM(IFNULL(t.projectTotal,0)) AS projectTotal, + SUM(IFNULL(t.projectTotal,0)) as projectTotal, 0 as companyTotal, DATE_FORMAT(now(),'%Y%m%d') as dataEndTime FROM esua_epdc_admin.sys_dept city left join esua_epdc_admin.sys_dept st on st.pid=city.id @@ -1201,12 +1249,12 @@ union all LEFT JOIN esua_epdc_admin.sys_dept gr on co.id=gr.pid left join (select total.GRID_ID, - sum(total.userTotal) as userTotal, + sum(total.userTotal+total.companyTotal) as userTotal, sum(total.partyTotal) as partyTotal, sum(total.groupTotal) as groupTotal, sum(total.issueTotal) as issueTotal, sum(total.topicTotal) as topicTotal, - sum(total.projectTotal) as projectTotal + sum(total.projectTotal) as projectTotal, 0 as companyTotal from (select eu.DEPT_ID AS GRID_ID, count(eu.id) as userTotal, @@ -1214,10 +1262,25 @@ union all 0 as groupTotal, 0 as issueTotal, 0 as topicTotal, - 0 as projectTotal + 0 as projectTotal, 0 as companyTotal from esua_epdc_user.epdc_user eu where eu.DEL_FLAG=0 group by eu.DEPT_ID + UNION all + SELECT + DEPT_ID AS GRID_ID, + 0 as userTotal, + 0 AS partyTotal, + 0 as groupTotal, + 0 as issueTotal, + 0 as topicTotal, + 0 as projectTotal, count(id) as companyTotal + FROM + esua_epdc_custom.epdc_enterprise_info + WHERE + DEL_FLAG = 0 + GROUP BY + DEPT_ID UNION ALL @@ -1227,7 +1290,7 @@ union all count(id) as groupTotal, 0 as issueTotal, 0 as topicTotal, - 0 as projectTotal + 0 as projectTotal, 0 as companyTotal from esua_epdc_group.epdc_group where DEL_FLAG=0 and STATE=10 group by GRID_ID @@ -1240,7 +1303,7 @@ union all 0 as groupTotal, count(id) as issueTotal, 0 as topicTotal, - 0 as projectTotal + 0 as projectTotal, 0 as companyTotal from esua_epdc_events.epdc_issue where DEL_FLAG=0 group by GRID_ID @@ -1253,7 +1316,7 @@ union all 0 as groupTotal, 0 as issueTotal, count(id) as topicTotal, - 0 as projectTotal + 0 as projectTotal, 0 as companyTotal from esua_epdc_group.epdc_topic where DEL_FLAG=0 group by GRID_ID @@ -1266,7 +1329,7 @@ union all 0 as groupTotal, 0 as issueTotal, 0 as topicTotal, - count(id) as projectTotal + count(id) as projectTotal, 0 as companyTotal from esua_epdc_events.epdc_item where DEL_FLAG=0 group by GRID_ID)total