Browse Source

产品推送接口

指标数据统计规则修改
master
liuchuang 4 years ago
parent
commit
ec7ec05442
  1. 216
      epdc-cloud-analysis-pc/src/main/resources/mapper/screen/ScreenIndexDataDao.xml

216
epdc-cloud-analysis-pc/src/main/resources/mapper/screen/ScreenIndexDataDao.xml

@ -489,80 +489,89 @@
d.id as agencyId, d.id as agencyId,
CASE WHEN d.TYPE_KEY = 'street_party' CASE WHEN d.TYPE_KEY = 'street_party'
THEN 0 ELSE PID END AS parentId, THEN 0 ELSE PID END AS parentId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId, DATE_FORMAT(STR_TO_DATE('2021-11', '%Y'),'%Y') AS yearId,
CONCAT(DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'), '%Y'), 'Q', QUARTER(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m-%d'))) quarterId, CONCAT(DATE_FORMAT(STR_TO_DATE('2021-11', '%Y'), '%Y'), 'Q', QUARTER(STR_TO_DATE('2021-11', '%Y-%m-%d'))) quarterId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId, DATE_FORMAT(STR_TO_DATE('2021-11', '%Y-%m'),'%Y%m') AS monthId,
CASE d.TYPE_KEY WHEN 'community_party' THEN 'community' WHEN 'street_party' THEN 'street' WHEN 'district_party' THEN 'district' END as dataType, CASE d.TYPE_KEY WHEN 'community_party' THEN 'community' WHEN 'street_party' THEN 'street' WHEN 'district_party' THEN 'district' END as dataType,
IFNULL(t1.transferedCount, 0) AS transferedCount, 0.0000 AS overdueProjectRatio,
IFNULL(t.closedProjectCount, 0) AS closedProjectCount,
IFNULL(round((t1.respProject / t1.transferedCount),2), 0.00) respProjectRatio,
IFNULL(t1.respProject, 0) respProjectRatioFz,
IFNULL(t1.transferedCount, 0) respProjectRatioFm,
CASE WHEN t.closedProjectCount > t1.transferedCount THEN 100.00 ELSE IFNULL(round((t.closedProjectCount / t1.transferedCount),4)*100, 0.00) END AS closedProjectRatio,
IFNULL(CASE WHEN t.closedProjectCount > t1.transferedCount THEN t.closedProjectCount ELSE t1.transferedCount END, 0) AS closedProjectRatioFm,
IFNULL(t.closedProjectCount, 0) closedProjectRatioFz,
IFNULL(t.satisfactionRatio, 0.00) AS satisfactionRatio,
IFNULL(t.satisfactionRatioFz, 0) AS satisfactionRatioFz,
IFNULL(t.satisfactionRatioFm, 0) AS satisfactionRatioFm,
IFNULL(IF( d.TYPE_KEY = 'street_party', t.handleProjectRatioFz, 0),0) handleProjectRatioFz,
IFNULL(IF( d.TYPE_KEY = 'street_party', t.handleProjectRatioFm, 0),0) handleProjectRatioFm,
IF( d.TYPE_KEY = 'street_party', IFNULL(t.handleProjectRatio,0.00),0.00) AS handleProjectRatio,
0.00 AS overdueProjectRatio,
0 AS overdueProjectRatioFz, 0 AS overdueProjectRatioFz,
0 AS overdueProjectRatioFm 0 AS overdueProjectRatioFm,
IFNULL(tm2.transferedCount, 0) AS transferedCount,
IFNULL(tm1.closedProjectCount, 0) AS closedProjectCount,
IFNULL(round(tm3.respProject / tm2.transferedCount, 4), 0.0000) respProjectRatio,
IFNULL(tm3.respProject, 0) respProjectRatioFz,
IFNULL(tm2.transferedCount, 0) respProjectRatioFm,
IFNULL(tm2.closedProjectRatio, 0.00) AS closedProjectRatio,
IFNULL(tm2.closedProjectRatioFz, 0) AS closedProjectRatioFz,
IFNULL(tm2.closedProjectRatioFm, 0) AS closedProjectRatioFm,
IFNULL(IF( d.TYPE_KEY = 'street_party', tm1.handleProjectRatioFz, 0),0) handleProjectRatioFz,
IFNULL(IF( d.TYPE_KEY = 'street_party', tm1.handleProjectRatioFm, 0),0) handleProjectRatioFm,
IF( d.TYPE_KEY = 'street_party', IFNULL(tm1.handleProjectRatio,0.0000),0.0000) AS handleProjectRatio
FROM esua_epdc_admin.sys_dept d FROM esua_epdc_admin.sys_dept d
LEFT JOIN LEFT JOIN
(SELECT (SELECT
t.HANDLER_DEPT_ID, tmp1.HANDLER_DEPT_ID,
COUNT(t.ITEM_ID) AS closedProjectCount, tmp1.closedProjectCount,
IFNULL(ROUND((count(t.EVALUATION_SCORE = 1 or null) * 0.6 + count(t.EVALUATION_SCORE = 2 or null)) / IFNULL(ROUND(tmp1.handleProjectRatioFz / tmp1.closedProjectCount, 4), 0.0000) AS handleProjectRatio,
count(t.EVALUATION_SCORE is not null or null),4)*100, 0.00) as satisfactionRatio, tmp1.handleProjectRatioFz,
(count(t.EVALUATION_SCORE = 1 or null) * 0.6 + count(t.EVALUATION_SCORE = 2 or null)) AS satisfactionRatioFz, tmp1.closedProjectCount AS handleProjectRatioFm,
count(t.EVALUATION_SCORE is not null or null) AS satisfactionRatioFm, IFNULL(ROUND((tmp1.bmyCount * 60 + tmp1.fcmyCount * 100 + (tmp1.closedProjectCount - tmp1.bmyCount - tmp1.fcmyCount) * 80 ) / tmp1.closedProjectCount, 4), 0.0000) AS satisfactionRatio,
COUNT(t.ITEM_ID) / SUM(TIMESTAMPDIFF(MINUTE,t.itemCreatedTime, t.closedItemTime)) AS handleProjectRatio, IFNULL((tmp1.bmyCount * 60 + tmp1.fcmyCount * 100 + (tmp1.closedProjectCount - tmp1.bmyCount - tmp1.fcmyCount) * 80 ), 0) AS satisfactionRatioFz,
COUNT(t.ITEM_ID) AS handleProjectRatioFz, tmp1.closedProjectCount AS satisfactionRatioFm
SUM(TIMESTAMPDIFF(MINUTE,t.itemCreatedTime, t.closedItemTime)) AS handleProjectRatioFm FROM
(SELECT
t1.HANDLER_DEPT_ID,
COUNT(t1.ID) AS closedProjectCount,
IFNULL(SUM(TIMESTAMPDIFF(MINUTE,t1.itemCreatedTime, t1.closedItemTime)), 0) AS handleProjectRatioFz,
CASE WHEN t1.EVALUATION_SCORE = 0 THEN SUM(1) ELSE SUM(0) END AS bmyCount,
CASE WHEN t1.EVALUATION_SCORE = 2 THEN SUM(1) ELSE SUM(0) END AS fcmyCount
FROM FROM
(SELECT eihp.`ITEM_ID` , eihp.`HANDLER_DEPT_ID` , eihp.`CREATED_TIME` AS closedItemTime, ei.`CREATED_TIME` AS itemCreatedTime, ei.`EVALUATION_SCORE` (SELECT eihp.`ID`, eihp.`HANDLER_DEPT_ID`, eihp.`CREATED_TIME` AS closedItemTime, ei.`CREATED_TIME` AS itemCreatedTime, ei.`EVALUATION_SCORE`
FROM `esua_epdc_events`.`epdc_item_handle_process` eihp FROM `esua_epdc_events`.`epdc_item_handle_process` eihp
LEFT JOIN `esua_epdc_events`.`epdc_item` ei on ei.`ID` = eihp.`ITEM_ID` AND ei.`DEL_FLAG` = '0' LEFT JOIN `esua_epdc_events`.`epdc_item` ei on ei.`ID` = eihp.`ITEM_ID`
WHERE eihp.`DEL_FLAG`= '0' WHERE eihp.`DEL_FLAG`= '0'
AND eihp.`STATE`= '10' AND eihp.`STATE`= 10
AND date_format(eihp.CREATED_TIME, '%Y-%m') = #{yearMonth, jdbcType=VARCHAR} GROUP BY eihp.`ITEM_ID`) t GROUP BY t.HANDLER_DEPT_ID) t on t.HANDLER_DEPT_ID = d.`id` AND date_format(eihp.CREATED_TIME, '%Y-%m') = '2021-11' GROUP BY eihp.`ITEM_ID`) t1 GROUP BY t1.HANDLER_DEPT_ID) tmp1) tm1 on tm1.HANDLER_DEPT_ID = d.`id`
LEFT JOIN LEFT JOIN
(SELECT ttt.DEPT_ID, COUNT(ttt.ITEM_ID) AS transferedCount, SUM(TIMESTAMPDIFF(MINUTE,ttt.timeToBeWhistled, ttt.earliestResponseTime)) AS respProject FROM (SELECT
tmp2.DEPT_ID,
tmp2.transferedCount,
IFNULL(ROUND((tmp2.closedProjectRatioFz / tmp2.transferedCount)*100, 4), 0.0000) AS closedProjectRatio,
tmp2.closedProjectRatioFz,
tmp2.transferedCount AS closedProjectRatioFm
FROM
(SELECT t2.DEPT_ID, COUNT(t2.ITEM_ID) AS transferedCount, CASE WHEN t2.ITEM_STATE = 10 OR t2.ITEM_STATE = 5 THEN SUM(1) ELSE SUM(0) END AS closedProjectRatioFz FROM
(SELECT eid.`DEPT_ID`, eid.`ITEM_ID`, ei.`ITEM_STATE`
FROM `esua_epdc_events`.`epdc_item_dept` eid
LEFT JOIN `esua_epdc_events`.`epdc_item` ei on ei.`ID`= eid.`ITEM_ID`
WHERE eid.`DEL_FLAG`= '0'
AND ei.`DEL_FLAG`= '0'
AND eid.`CREATED_TIME` <![CDATA[ <> ]]> ei.`CREATED_TIME`
AND date_format(eid.CREATED_TIME, '%Y-%m') = '2021-11' GROUP BY eid.`DEPT_ID`, eid.`ITEM_ID`) t2 GROUP BY t2.DEPT_ID) tmp2) tm2 on tm2.DEPT_ID = d.`id`
LEFT JOIN
(SELECT ttt.DEPT_ID, SUM(TIMESTAMPDIFF(MINUTE,ttt.timeToBeWhistled, ttt.earliestResponseTime)) AS respProject FROM
(SELECT (SELECT
tt.CREATED_TIME AS timeToBeWhistled, tt.CREATED_TIME AS timeToBeWhistled,
MIN( tmphp.CREATED_TIME ) AS earliestResponseTime, MIN( tmphp.CREATED_TIME ) AS earliestResponseTime,
tt.ITEM_ID, tt.ITEM_ID,
tt.DEPT_ID tt.DEPT_ID
FROM FROM
( (SELECT eid.`ID`, eid.`DEPT_ID`, eid.`ITEM_ID`, eid.CREATED_TIME
SELECT FROM `esua_epdc_events`.`epdc_item_dept` eid
eid.ID, LEFT JOIN `esua_epdc_events`.`epdc_item` ei on ei.`ID`= eid.`ITEM_ID`
eid.CREATED_TIME, WHERE eid.`DEL_FLAG`= '0'
eid.DEPT_ID, AND ei.`DEL_FLAG`= '0'
eid.ITEM_ID AND eid.`CREATED_TIME` <![CDATA[ <> ]]> ei.`CREATED_TIME`
FROM AND date_format(eid.CREATED_TIME, '%Y-%m') = '2021-11' GROUP BY eid.`DEPT_ID`, eid.`ITEM_ID`) tt
`esua_epdc_events`.epdc_item_dept eid
WHERE
eid.DEL_FLAG = '0'
AND date_format( eid.CREATED_TIME, '%Y-%m' ) = #{yearMonth, jdbcType=VARCHAR}
GROUP BY
eid.ITEM_ID
) tt
LEFT JOIN `esua_epdc_events`.epdc_item_handle_process tmphp ON tmphp.ITEM_ID = tt.ITEM_ID LEFT JOIN `esua_epdc_events`.epdc_item_handle_process tmphp ON tmphp.ITEM_ID = tt.ITEM_ID
AND tmphp.HANDLER_DEPT_ID = tt.DEPT_ID AND tmphp.HANDLER_DEPT_ID = tt.DEPT_ID
AND tmphp.CREATED_TIME > tt.CREATED_TIME AND tmphp.CREATED_TIME > tt.CREATED_TIME
AND tmphp.DEL_FLAG = '0' AND tmphp.DEL_FLAG = '0'
GROUP BY tt.`ID`) ttt WHERE ttt.earliestResponseTime IS NOT NULL GROUP BY ttt.DEPT_ID) t1 on t1.DEPT_ID = d.`id` GROUP BY tt.`ID`) ttt WHERE ttt.earliestResponseTime IS NOT NULL GROUP BY ttt.DEPT_ID) tm3 on tm3.DEPT_ID = d.`id`
WHERE WHERE
d.DEL_FLAG= '0' d.DEL_FLAG= '0'
and (d.TYPE_KEY = 'community_party' OR d.TYPE_KEY = 'street_party') and (d.TYPE_KEY = 'community_party' OR d.TYPE_KEY = 'street_party')
and d.id not in( and d.id not in(SELECT t.DEPT_ID FROM `esua_epdc_admin`.`sys_dept_config` t WHERE t.DEL_FLAG= '0')
SELECT t.DEPT_ID
FROM `esua_epdc_admin`.`sys_dept_config` t
WHERE t.DEL_FLAG= '0')
ORDER BY d.TYPE_KEY; ORDER BY d.TYPE_KEY;
</select> </select>
@ -573,73 +582,82 @@
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId, DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'),'%Y') AS yearId,
CONCAT(DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'), '%Y'), 'Q', QUARTER(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m-%d'))) quarterId, CONCAT(DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y'), '%Y'), 'Q', QUARTER(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m-%d'))) quarterId,
DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId, DATE_FORMAT(STR_TO_DATE(#{yearMonth, jdbcType=VARCHAR}, '%Y-%m'),'%Y%m') AS monthId,
IFNULL(t1.transferedCount, 0) AS transferedCount, IFNULL(tm2.transferedCount, 0) AS transferedCount,
IFNULL(t.closedProjectCount, 0) AS closedProjectCount, IFNULL(tm1.closedProjectCount, 0) AS closedProjectCount,
IFNULL(round((t1.respProject / t1.transferedCount),2), 0.00) respProjectRatio, IFNULL(round(tm3.respProject / tm2.transferedCount, 4), 0.0000) respProjectRatio,
IFNULL(t1.respProject, 0) respProjectRatioFz, IFNULL(tm3.respProject, 0) respProjectRatioFz,
IFNULL(t1.transferedCount, 0) respProjectRatioFm, IFNULL(tm2.transferedCount, 0) respProjectRatioFm,
CASE WHEN t.closedProjectCount > t1.transferedCount THEN 100.00 ELSE IFNULL(round((t.closedProjectCount / t1.transferedCount),4)*100, 0.00) END AS closedProjectRatio, IFNULL(tm2.closedProjectRatio, 0.00) AS closedProjectRatio,
IFNULL(CASE WHEN t.closedProjectCount > t1.transferedCount THEN t.closedProjectCount ELSE t1.transferedCount END, 0) AS closedProjectRatioFm, IFNULL(tm2.closedProjectRatioFz, 0) AS closedProjectRatioFz,
IFNULL(t.closedProjectCount, 0) closedProjectRatioFz, IFNULL(tm2.closedProjectRatioFm, 0) AS closedProjectRatioFm,
IFNULL(t.satisfactionRatio, 0.00) AS satisfactionRatio, IFNULL(tm1.handleProjectRatioFz,0) handleProjectRatioFz,
IFNULL(t.satisfactionRatioFz, 0) AS satisfactionRatioFz, IFNULL(tm1.handleProjectRatioFm,0) handleProjectRatioFm,
IFNULL(t.satisfactionRatioFm, 0) AS satisfactionRatioFm, IFNULL(tm1.handleProjectRatio,0.0000) AS handleProjectRatio
IFNULL(t.handleProjectRatioFz, 0) handleProjectRatioFz,
IFNULL(t.handleProjectRatioFm, 0) handleProjectRatioFm,
IFNULL(t.handleProjectRatio,0.00) AS handleProjectRatio
FROM esua_epdc_admin.sys_dept d FROM esua_epdc_admin.sys_dept d
LEFT JOIN LEFT JOIN
(SELECT (SELECT
t.HANDLER_DEPT_ID, tmp1.HANDLER_DEPT_ID,
COUNT(t.ITEM_ID) AS closedProjectCount, tmp1.closedProjectCount,
IFNULL(ROUND((count(t.EVALUATION_SCORE = 1 or null) * 0.6 + count(t.EVALUATION_SCORE = 2 or null)) / IFNULL(ROUND(tmp1.handleProjectRatioFz / tmp1.closedProjectCount, 4), 0.0000) AS handleProjectRatio,
count(t.EVALUATION_SCORE is not null or null),4)*100, 0.00) as satisfactionRatio, tmp1.handleProjectRatioFz,
(count(t.EVALUATION_SCORE = 1 or null) * 0.6 + count(t.EVALUATION_SCORE = 2 or null)) AS satisfactionRatioFz, tmp1.closedProjectCount AS handleProjectRatioFm,
count(t.EVALUATION_SCORE is not null or null) AS satisfactionRatioFm, IFNULL(ROUND((tmp1.bmyCount * 60 + tmp1.fcmyCount * 100 + (tmp1.closedProjectCount - tmp1.bmyCount - tmp1.fcmyCount) * 80 ) / tmp1.closedProjectCount, 4), 0.0000) AS satisfactionRatio,
COUNT(t.ITEM_ID) / SUM(TIMESTAMPDIFF(MINUTE,t.itemCreatedTime, t.closedItemTime)) AS handleProjectRatio, IFNULL((tmp1.bmyCount * 60 + tmp1.fcmyCount * 100 + (tmp1.closedProjectCount - tmp1.bmyCount - tmp1.fcmyCount) * 80 ), 0) AS satisfactionRatioFz,
COUNT(t.ITEM_ID) AS handleProjectRatioFz, tmp1.closedProjectCount AS satisfactionRatioFm
SUM(TIMESTAMPDIFF(MINUTE,t.itemCreatedTime, t.closedItemTime)) AS handleProjectRatioFm FROM
(SELECT
t1.HANDLER_DEPT_ID,
COUNT(t1.ID) AS closedProjectCount,
IFNULL(SUM(TIMESTAMPDIFF(MINUTE,t1.itemCreatedTime, t1.closedItemTime)), 0) AS handleProjectRatioFz,
CASE WHEN t1.EVALUATION_SCORE = 0 THEN SUM(1) ELSE SUM(0) END AS bmyCount,
CASE WHEN t1.EVALUATION_SCORE = 2 THEN SUM(1) ELSE SUM(0) END AS fcmyCount
FROM FROM
(SELECT eihp.`ITEM_ID` , eihp.`HANDLER_DEPT_ID` , eihp.`CREATED_TIME` AS closedItemTime, ei.`CREATED_TIME` AS itemCreatedTime, ei.`EVALUATION_SCORE` (SELECT eihp.`ID`, eihp.`HANDLER_DEPT_ID`, eihp.`CREATED_TIME` AS closedItemTime, ei.`CREATED_TIME` AS itemCreatedTime, ei.`EVALUATION_SCORE`
FROM `esua_epdc_events`.`epdc_item_handle_process` eihp FROM `esua_epdc_events`.`epdc_item_handle_process` eihp
LEFT JOIN `esua_epdc_events`.`epdc_item` ei on ei.`ID` = eihp.`ITEM_ID` AND ei.`DEL_FLAG` = '0' LEFT JOIN `esua_epdc_events`.`epdc_item` ei on ei.`ID` = eihp.`ITEM_ID`
WHERE eihp.`DEL_FLAG`= '0' WHERE eihp.`DEL_FLAG`= '0'
AND eihp.`STATE`= '10' AND eihp.`STATE`= 10
AND date_format(eihp.CREATED_TIME, '%Y-%m') = #{yearMonth, jdbcType=VARCHAR} GROUP BY eihp.`ITEM_ID`) t GROUP BY t.HANDLER_DEPT_ID) t on t.HANDLER_DEPT_ID = d.`id` AND date_format(eihp.CREATED_TIME, '%Y-%m') = #{yearMonth, jdbcType=VARCHAR} GROUP BY eihp.`ITEM_ID`) t1 GROUP BY t1.HANDLER_DEPT_ID) tmp1) tm1 on tm1.HANDLER_DEPT_ID = d.`id`
LEFT JOIN LEFT JOIN
(SELECT ttt.DEPT_ID, COUNT(ttt.ITEM_ID) AS transferedCount, SUM(TIMESTAMPDIFF(MINUTE,ttt.timeToBeWhistled, ttt.earliestResponseTime)) AS respProject FROM (SELECT
tmp2.DEPT_ID,
tmp2.transferedCount,
IFNULL(ROUND((tmp2.closedProjectRatioFz / tmp2.transferedCount)*100, 4), 0.0000) AS closedProjectRatio,
tmp2.closedProjectRatioFz,
tmp2.transferedCount AS closedProjectRatioFm
FROM
(SELECT t2.DEPT_ID, COUNT(t2.ITEM_ID) AS transferedCount, CASE WHEN t2.ITEM_STATE = 10 OR t2.ITEM_STATE = 5 THEN SUM(1) ELSE SUM(0) END AS closedProjectRatioFz FROM
(SELECT eid.`DEPT_ID`, eid.`ITEM_ID`, ei.`ITEM_STATE`
FROM `esua_epdc_events`.`epdc_item_dept` eid
LEFT JOIN `esua_epdc_events`.`epdc_item` ei on ei.`ID`= eid.`ITEM_ID`
WHERE eid.`DEL_FLAG`= '0'
AND ei.`DEL_FLAG`= '0'
AND eid.`CREATED_TIME` <![CDATA[ <> ]]> ei.`CREATED_TIME`
AND date_format(eid.CREATED_TIME, '%Y-%m') = #{yearMonth, jdbcType=VARCHAR} GROUP BY eid.`DEPT_ID`, eid.`ITEM_ID`) t2 GROUP BY t2.DEPT_ID) tmp2) tm2 on tm2.DEPT_ID = d.`id`
LEFT JOIN
(SELECT ttt.DEPT_ID, SUM(TIMESTAMPDIFF(MINUTE,ttt.timeToBeWhistled, ttt.earliestResponseTime)) AS respProject FROM
(SELECT (SELECT
tt.CREATED_TIME AS timeToBeWhistled, tt.CREATED_TIME AS timeToBeWhistled,
MIN( tmphp.CREATED_TIME ) AS earliestResponseTime, MIN( tmphp.CREATED_TIME ) AS earliestResponseTime,
tt.ITEM_ID, tt.ITEM_ID,
tt.DEPT_ID tt.DEPT_ID
FROM FROM
( (SELECT eid.`ID`, eid.`DEPT_ID`, eid.`ITEM_ID`, eid.CREATED_TIME
SELECT FROM `esua_epdc_events`.`epdc_item_dept` eid
eid.ID, LEFT JOIN `esua_epdc_events`.`epdc_item` ei on ei.`ID`= eid.`ITEM_ID`
eid.CREATED_TIME, WHERE eid.`DEL_FLAG`= '0'
eid.DEPT_ID, AND ei.`DEL_FLAG`= '0'
eid.ITEM_ID AND eid.`CREATED_TIME` <![CDATA[ <> ]]> ei.`CREATED_TIME`
FROM AND date_format(eid.CREATED_TIME, '%Y-%m') = #{yearMonth, jdbcType=VARCHAR} GROUP BY eid.`DEPT_ID`, eid.`ITEM_ID`) tt
`esua_epdc_events`.epdc_item_dept eid
WHERE
eid.DEL_FLAG = '0'
AND date_format( eid.CREATED_TIME, '%Y-%m' ) = #{yearMonth, jdbcType=VARCHAR}
GROUP BY
eid.ITEM_ID
) tt
LEFT JOIN `esua_epdc_events`.epdc_item_handle_process tmphp ON tmphp.ITEM_ID = tt.ITEM_ID LEFT JOIN `esua_epdc_events`.epdc_item_handle_process tmphp ON tmphp.ITEM_ID = tt.ITEM_ID
AND tmphp.HANDLER_DEPT_ID = tt.DEPT_ID AND tmphp.HANDLER_DEPT_ID = tt.DEPT_ID
AND tmphp.CREATED_TIME > tt.CREATED_TIME AND tmphp.CREATED_TIME > tt.CREATED_TIME
AND tmphp.DEL_FLAG = '0' AND tmphp.DEL_FLAG = '0'
GROUP BY tt.`ID`) ttt WHERE ttt.earliestResponseTime IS NOT NULL GROUP BY ttt.DEPT_ID) t1 on t1.DEPT_ID = d.`id` GROUP BY tt.`ID`) ttt WHERE ttt.earliestResponseTime IS NOT NULL GROUP BY ttt.DEPT_ID) tm3 on tm3.DEPT_ID = d.`id`
WHERE WHERE
d.DEL_FLAG= '0' d.DEL_FLAG= '0'
and d.TYPE_KEY = 'district_dept' and d.TYPE_KEY = 'district_dept'
and d.id not in( and d.id not in(SELECT t.DEPT_ID FROM `esua_epdc_admin`.`sys_dept_config` t WHERE t.DEL_FLAG= '0')
SELECT t.DEPT_ID
FROM `esua_epdc_admin`.`sys_dept_config` t
WHERE t.DEL_FLAG= '0')
ORDER BY d.TYPE_KEY; ORDER BY d.TYPE_KEY;
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save