diff --git a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenBaseReportDataDao.xml b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenBaseReportDataDao.xml index 5d33f3ec..1cd3afde 100644 --- a/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenBaseReportDataDao.xml +++ b/esua-epdc/epdc-module/epdc-analysis/epdc-analysis-server/src/main/resources/mapper/screen/ScreenBaseReportDataDao.xml @@ -576,9 +576,11 @@ and grid.id not in IFNULL(SUM(IF(DATE_FORMAT(eis.CREATED_TIME, '%Y-%m-%d') = DATE_FORMAT(date_add(now(), INTERVAL - 1 DAY), '%Y-%m-%d'), 1, 0)), 0) AS issueIncr, IFNULL(SUM(IF(eis.issue_state = '4', 1, 0)), 0) AS shiftProjectTotal, - 0 AS votingIncr, - 0 AS votingTotal, - 0 AS votingPercent, + IFNULL(SUM(CASE WHEN DATE_FORMAT(eit.CREATED_TIME, '%Y-%m-%d')= DATE_FORMAT(date_add(now(), INTERVAL - 1 DAY), '%Y-%m-%d') + AND eis.issue_state= '0' THEN 1 ELSE 0 END), 0) AS votingIncr, + IFNULL(SUM(CASE WHEN eis.issue_state= '0' THEN 1 ELSE 0 END), 0) AS votingTotal, + IFNULL(ROUND(SUM(CASE WHEN DATE_FORMAT(eit.CREATED_TIME, '%Y-%m-%d')= DATE_FORMAT(date_add(now(), INTERVAL - 1 DAY), '%Y-%m-%d') + AND eis.issue_state= '0' THEN 1 ELSE 0 END) / SUM(CASE WHEN eis.issue_state= '0' THEN 1 ELSE 0 END), 6), 0) AS votingPercent, IFNULL(SUM(IF(DATE_FORMAT(eis.UPDATED_TIME, '%Y-%m-%d') = DATE_FORMAT(date_add(now(), INTERVAL - 1 DAY), '%Y-%m-%d') AND eis.ISSUE_STATE = '2', 1, 0)), 0) AS closedIncr, @@ -636,7 +638,12 @@ and grid.id not in 0 AS closedCaseUnresolvedPercent FROM( SELECT DATE_FORMAT(date_add(now(), INTERVAL - 1 DAY), '%Y%m%d') AS dateId, CONCAT(DATE_FORMAT(STR_TO_DATE(DATE_FORMAT(date_add(now(), INTERVAL - 1 DAY), '%Y-%m-%d'), '%Y'), '%Y'), 'W', WEEK(STR_TO_DATE(DATE_FORMAT(date_add(now(), INTERVAL - 1 DAY), '%Y-%m-%d'), '%Y-%m-%d'))) weekId, DATE_FORMAT(STR_TO_DATE(DATE_FORMAT(date_add(now(), INTERVAL - 1 DAY), '%Y-%m-%d'), '%Y'), '%Y') AS yearId, CONCAT(DATE_FORMAT(STR_TO_DATE(DATE_FORMAT(date_add(now(), INTERVAL - 1 DAY), '%Y-%m-%d'), '%Y'), '%Y'), 'Q', QUARTER(STR_TO_DATE(DATE_FORMAT(date_add(now(), INTERVAL - 1 DAY), '%Y-%m-%d'), '%Y-%m-%d'))) quarterId, DATE_FORMAT(STR_TO_DATE(DATE_FORMAT(date_add(now(), INTERVAL - 1 DAY), '%Y-%m-%d'), '%Y-%m'), '%Y%m') AS monthId, sd.id AS agencyId, sd.pid AS pid, IFNULL(COUNT(eis.id), 0) AS issueTotal, IFNULL(SUM(CASE WHEN DATE_FORMAT(eis.CREATED_TIME, '%Y-%m-%d')= DATE_FORMAT(date_add(now(), INTERVAL - 1 DAY), '%Y-%m-%d') THEN 1 ELSE 0 END), 0) AS issueIncr, - IFNULL(SUM(CASE WHEN eis.issue_state= '4' THEN 1 ELSE 0 END), 0) AS shiftProjectTotal, 0 AS votingIncr, 0 AS votingTotal, 0 AS votingPercent, IFNULL(SUM(CASE WHEN DATE_FORMAT(eis.UPDATED_TIME, '%Y-%m-%d')= DATE_FORMAT(date_add(now(), INTERVAL - 1 DAY), '%Y-%m-%d') + IFNULL(SUM(CASE WHEN eis.issue_state= '4' THEN 1 ELSE 0 END), 0) AS shiftProjectTotal, IFNULL(SUM(CASE WHEN DATE_FORMAT(eit.CREATED_TIME, '%Y-%m-%d')= DATE_FORMAT(date_add(now(), INTERVAL - 1 DAY), '%Y-%m-%d') + AND eis.issue_state= '0' THEN 1 ELSE 0 END), 0) AS votingIncr, + IFNULL(SUM(CASE WHEN eis.issue_state= '0' THEN 1 ELSE 0 END), 0) AS votingTotal, + IFNULL(ROUND(SUM(CASE WHEN DATE_FORMAT(eit.CREATED_TIME, '%Y-%m-%d')= DATE_FORMAT(date_add(now(), INTERVAL - 1 DAY), '%Y-%m-%d') + AND eis.issue_state= '0' THEN 1 ELSE 0 END) / SUM(CASE WHEN eis.issue_state= '0' THEN 1 ELSE 0 END), 6), 0) AS votingPercent + , IFNULL(SUM(CASE WHEN DATE_FORMAT(eis.UPDATED_TIME, '%Y-%m-%d')= DATE_FORMAT(date_add(now(), INTERVAL - 1 DAY), '%Y-%m-%d') AND eis.ISSUE_STATE= '2' THEN 1 ELSE 0 END), 0) AS closedIncr, IFNULL(SUM(CASE WHEN eis.issue_state= '2' THEN 1 ELSE 0 END), 0) AS closedTotal FROM esua_epdc_admin.sys_dept sd LEFT JOIN esua_epdc_events.epdc_issue eis ON find_in_set(sd.`id`, eis.`ALL_DEPT_IDS`)