From 9d1abffd696a43a3d8e4622b1f5c2432fa5d0554 Mon Sep 17 00:00:00 2001 From: liuchuang <123456> Date: Sat, 4 Dec 2021 23:18:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81=E6=8E=A8=E9=80=81=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E7=BD=91=E6=A0=BC=E5=90=B9=E5=93=A8=E5=87=86?= =?UTF-8?q?=E7=A1=AE=E7=8E=87=E6=8C=87=E6=A0=87=E6=95=B0=E6=8D=AE=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E8=A7=84=E5=88=99=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/screen/ScreenIndexDataDao.xml | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenIndexDataDao.xml b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenIndexDataDao.xml index f843a9b2..50730fd6 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenIndexDataDao.xml +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenIndexDataDao.xml @@ -436,9 +436,9 @@ / IFNULL(itemCount.itemCloseAndScoreNum,0),4),0) * 100 satisfactionRatio, ROUND(IFNULL(IFNULL(issueCount.thisMonthIssueToItemCount,0) / IFNULL(issueCount.issueNum,0),0),4) * 100 issueToProjectRatio, IFNULL(itemCount.selfSolveProjectNum,0) selfSolveProjectCount, - 0 AS transferRightRatio, - 0 AS transferRightRatioFz, - 0 AS transferRightRatioFm, + IFNULL(tmpp.transferRightRatio,0) AS transferRightRatio, + IFNULL(tmpp.transferRightRatioFz,0) AS transferRightRatioFz, + IFNULL(tmpp.transferRightRatioFm,0) AS transferRightRatioFm, IFNULL(itemCount.itemSatisfiedNum,0) * 0.6 + IFNULL(itemCount.itemVeryNum,0) satisfactionRatioFz, IFNULL(itemCount.itemCloseAndScoreNum,0) satisfactionRatioFm, IFNULL(issueCount.thisMonthIssueToItemCount,0) issueToProjectRatioFz, @@ -475,7 +475,25 @@ and date_format(item.CREATED_TIME, '%Y-%m' ) = #{yearMonth, jdbcType=VARCHAR} group by item.GRID_ID ) itemCount on itemCount.DEPT_ID = sd.ID - + left join ( + SELECT + tt.CREATED_DEPT_ID, + IF(tt.csCount = 0, 100.0000, IFNULL(ROUND((tt.csCount - tt.thCount) / tt.csCount, 4)*100, 0.0000)) AS transferRightRatio, + (tt.csCount - tt.thCount) AS transferRightRatioFz, + tt.csCount AS transferRightRatioFm + FROM + (SELECT tmp1.CREATED_DEPT_ID, COUNT(tmp1.ID) AS csCount, IFNULL(CASE WHEN tmp1.DEL_FLAG = '1' THEN SUM(1) ELSE SUM(0) END, 0) AS thCount + FROM( + SELECT eid.`ID`, eid.`CREATED_DEPT_ID`, eid.`CREATED_TIME`, eid.`ITEM_ID`, eid.`DEL_FLAG` + FROM `esua_epdc_events`.`epdc_item_dept` eid + WHERE date_format(eid.CREATED_TIME, '%Y-%m') = #{yearMonth, jdbcType=VARCHAR} + AND eid.`ID` NOT IN( + SELECT tmp.id + FROM( + SELECT t.`ITEM_ID`, t.`ID`, MIN(t.`CREATED_TIME`) FROM `esua_epdc_events`.`epdc_item_dept` t + WHERE date_format(t.CREATED_TIME, '%Y-%m') = #{yearMonth, jdbcType=VARCHAR} + GROUP BY t.`ITEM_ID`) tmp) GROUP BY eid.`CREATED_DEPT_ID`, eid.`ITEM_HANDLE_ID`) tmp1 GROUP BY tmp1.CREATED_DEPT_ID) tt + ) tmpp on tmpp.CREATED_DEPT_ID = sd.ID where sd.DEL_FLAG = '0' and sd.id not in (