|
|
@ -113,22 +113,30 @@ |
|
|
|
<select id="selectListNewsNoticeEventCount" resultType="com.elink.esua.epdc.dto.user.result.GridOpeningResultDTO"> |
|
|
|
SELECT |
|
|
|
t.gridId, |
|
|
|
COUNT( DISTINCT nne.id ) newsCount, |
|
|
|
COUNT( DISTINCT nnn.ID ) noticeCount, |
|
|
|
COUNT( DISTINCT eee.ID ) eventCount |
|
|
|
ifnull(nne.count,0) as newsCount, |
|
|
|
ifnull(nnn.count,0) as noticeCount, |
|
|
|
ifnull(eee.count,0) as eventCount |
|
|
|
FROM |
|
|
|
<foreach collection="gridIdList" item="gridId" open="(" separator="UNION ALL" close=") t"> |
|
|
|
SELECT #{gridId} gridId |
|
|
|
</foreach> |
|
|
|
LEFT JOIN esua_epdc_news.epdc_news nne ON t.gridId = nne.DEPT_ID AND nne.DEL_FLAG = '0' |
|
|
|
LEFT JOIN esua_epdc_news.epdc_notice nnn ON t.gridId = nnn.DEPT_ID AND nnn.DEL_FLAG = '0' |
|
|
|
LEFT JOIN esua_epdc_events.epdc_events eee ON t.gridId = eee.GRID_ID AND eee.DEL_FLAG = '0' AND eee.EVENT_STATE = '4' |
|
|
|
where 1=1 |
|
|
|
(select dept.id as gridId from esua_epdc_admin.sys_dept dept where dept.type_key = 'grid_party' and dept.DEL_FLAG = '0' |
|
|
|
<if test="gridIdList != null and gridIdList.size() > 0"> |
|
|
|
AND dept.id in <include refid="foreachGridIdList"></include> |
|
|
|
</if> |
|
|
|
) t |
|
|
|
LEFT JOIN (select count(id) as count,DEPT_ID from esua_epdc_news.epdc_news where DEL_FLAG = '0' |
|
|
|
<if test="startTime != null and endTime != null and endTime != ''"> |
|
|
|
AND nne.CREATED_TIME BETWEEN #{startTime} AND #{endTime} |
|
|
|
AND nnn.CREATED_TIME BETWEEN #{startTime} AND #{endTime} |
|
|
|
AND eee.CREATED_TIME BETWEEN #{startTime} AND #{endTime} |
|
|
|
AND CREATED_TIME BETWEEN #{startTime} AND #{endTime} |
|
|
|
</if> |
|
|
|
GROUP BY DEPT_ID) nne ON t.gridId = nne.DEPT_ID |
|
|
|
LEFT JOIN (select count(id) as count,DEPT_ID from esua_epdc_news.epdc_notice where DEL_FLAG = '0' |
|
|
|
<if test="startTime != null and endTime != null and endTime != ''"> |
|
|
|
AND CREATED_TIME BETWEEN #{startTime} AND #{endTime} |
|
|
|
</if> |
|
|
|
GROUP BY DEPT_ID) nnn ON t.gridId = nnn.DEPT_ID |
|
|
|
LEFT JOIN (select count(id) as count,GRID_ID from esua_epdc_events.epdc_events where DEL_FLAG = '0' and EVENT_STATE = '4' |
|
|
|
<if test="startTime != null and endTime != null and endTime != ''"> |
|
|
|
AND CREATED_TIME BETWEEN #{startTime} AND #{endTime} |
|
|
|
</if> |
|
|
|
GROUP BY GRID_ID) eee ON t.gridId = eee.GRID_ID |
|
|
|
GROUP BY |
|
|
|
t.gridId |
|
|
|
</select> |
|
|
@ -513,7 +521,7 @@ |
|
|
|
AND ad.del_flag = 0 |
|
|
|
) t0 |
|
|
|
LEFT JOIN esua_epdc_news.epdc_news un ON find_in_set(t0.id, un.ALL_DEPT_IDS) |
|
|
|
AND un.DEL_FLAG = '0' |
|
|
|
and un.DEL_FLAG = '0' |
|
|
|
<if test="operationStartTime != null and operationEndTime != null and operationEndTime != ''"> |
|
|
|
AND un.CREATED_TIME BETWEEN #{operationStartTime} AND #{operationEndTime} |
|
|
|
</if> |
|
|
@ -543,7 +551,7 @@ |
|
|
|
AND ad.del_flag = 0 |
|
|
|
) t0 |
|
|
|
LEFT JOIN esua_epdc_events.epdc_events epen ON find_in_set(t0.id, epen.ALL_DEPT_IDS) |
|
|
|
AND epen.DEL_FLAG = '0' |
|
|
|
and epen.DEL_FLAG = '0' |
|
|
|
AND epen.EVENT_STATE = '4' |
|
|
|
<if test="operationStartTime != null and operationEndTime != null and operationEndTime != ''"> |
|
|
|
AND epen.CREATED_TIME BETWEEN #{operationStartTime} AND #{operationEndTime} |
|
|
|