|
@ -113,28 +113,32 @@ |
|
|
<!--新闻数 通知数 议题数--> |
|
|
<!--新闻数 通知数 议题数--> |
|
|
<select id="selectListNewsNoticeEventCount" resultType="com.elink.esua.epdc.dto.user.result.GridOpeningResultDTO"> |
|
|
<select id="selectListNewsNoticeEventCount" resultType="com.elink.esua.epdc.dto.user.result.GridOpeningResultDTO"> |
|
|
SELECT |
|
|
SELECT |
|
|
t.gridId, |
|
|
dept.id, |
|
|
COUNT( DISTINCT nne.id ) newsCount, |
|
|
COUNT( DISTINCT nne.id ) newsCount, |
|
|
COUNT( DISTINCT nnn.ID ) noticeCount, |
|
|
-- COUNT( DISTINCT nnn.ID ) noticeCount, |
|
|
COUNT( DISTINCT eee.ID ) eventCount |
|
|
COUNT( DISTINCT eee.ID ) eventCount |
|
|
FROM |
|
|
FROM |
|
|
<foreach collection="gridIdList" item="gridId" open="(" separator="UNION ALL" close=") t"> |
|
|
esua_epdc_admin.sys_dept dept |
|
|
SELECT #{gridId} gridId |
|
|
LEFT JOIN esua_epdc_news.epdc_news nne ON nne.DEPT_ID = dept.id AND nne.DEL_FLAG = '0' |
|
|
</foreach> |
|
|
<!-- LEFT JOIN esua_epdc_news.epdc_notice nnn ON nnn.DEPT_ID = dept.id AND nnn.DEL_FLAG = '0'--> |
|
|
LEFT JOIN esua_epdc_news.epdc_news nne ON FIND_IN_SET(t.gridId,nne.ALL_DEPT_IDS) AND nne.DEL_FLAG = '0' |
|
|
<!-- <if test="startTime != null and endTime != null and endTime != ''">--> |
|
|
|
|
|
<!-- AND DATE_FORMAT(nnn.CREATED_TIME,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}--> |
|
|
|
|
|
<!-- </if>--> |
|
|
|
|
|
LEFT JOIN esua_epdc_events.epdc_issue eee ON eee.GRID_ID = dept.id AND eee.DEL_FLAG = '0' |
|
|
<if test="startTime != null and endTime != null and endTime != ''"> |
|
|
<if test="startTime != null and endTime != null and endTime != ''"> |
|
|
AND DATE_FORMAT(nne.CREATED_TIME,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime} |
|
|
AND DATE_FORMAT(eee.CREATED_TIME,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime} |
|
|
</if> |
|
|
</if> |
|
|
LEFT JOIN esua_epdc_news.epdc_notice nnn ON t.gridId = nnn.DEPT_ID AND nnn.DEL_FLAG = '0' |
|
|
where |
|
|
|
|
|
dept.DEL_FLAG = '0' |
|
|
|
|
|
AND dept.type_key = 'grid_party' |
|
|
<if test="startTime != null and endTime != null and endTime != ''"> |
|
|
<if test="startTime != null and endTime != null and endTime != ''"> |
|
|
AND DATE_FORMAT(nnn.CREATED_TIME,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime} |
|
|
AND DATE_FORMAT(nne.CREATED_TIME,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime} |
|
|
</if> |
|
|
</if> |
|
|
LEFT JOIN esua_epdc_events.epdc_issue eee ON t.gridId = eee.GRID_ID AND eee.DEL_FLAG = '0' |
|
|
<if test="gridIdList != null and gridIdList.size() > 0"> |
|
|
<if test="startTime != null and endTime != null and endTime != ''"> |
|
|
AND dept.id in <include refid="foreachGridIdList"></include> |
|
|
AND DATE_FORMAT(eee.CREATED_TIME,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime} |
|
|
|
|
|
</if> |
|
|
</if> |
|
|
GROUP BY |
|
|
GROUP BY |
|
|
t.gridId |
|
|
dept.id |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
|
|
|
<!--项目数--> |
|
|
<!--项目数--> |
|
@ -154,7 +158,7 @@ |
|
|
esua_epdc_events.epdc_item item |
|
|
esua_epdc_events.epdc_item item |
|
|
LEFT JOIN ( SELECT MAX( CREATED_TIME ) AS CREATED_TIME, ITEM_ID FROM esua_epdc_events.epdc_item_handle_process |
|
|
LEFT JOIN ( SELECT MAX( CREATED_TIME ) AS CREATED_TIME, ITEM_ID FROM esua_epdc_events.epdc_item_handle_process |
|
|
WHERE |
|
|
WHERE |
|
|
DEL_FLAG = '0' |
|
|
DEL_FLAG = '0' and (state=0 or state=5 or state=10 ) |
|
|
<if test="endTime != null and endTime != ''"> |
|
|
<if test="endTime != null and endTime != ''"> |
|
|
AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') <= #{endTime} |
|
|
AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') <= #{endTime} |
|
|
</if> |
|
|
</if> |
|
@ -727,7 +731,7 @@ |
|
|
left join esua_epdc_admin.sys_dept sd on eie.GRID_ID=sd.ID |
|
|
left join esua_epdc_admin.sys_dept sd on eie.GRID_ID=sd.ID |
|
|
where sd.del_flag='0') item |
|
|
where sd.del_flag='0') item |
|
|
LEFT JOIN ( SELECT MAX( CREATED_TIME ) AS CREATED_TIME, ITEM_ID FROM esua_epdc_events.epdc_item_handle_process WHERE |
|
|
LEFT JOIN ( SELECT MAX( CREATED_TIME ) AS CREATED_TIME, ITEM_ID FROM esua_epdc_events.epdc_item_handle_process WHERE |
|
|
DEL_FLAG = '0' |
|
|
DEL_FLAG = '0' and (state=0 or state=5 or state=10 ) |
|
|
<if test="endTime != null and endTime != ''"> |
|
|
<if test="endTime != null and endTime != ''"> |
|
|
AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') <= #{endTime} |
|
|
AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') <= #{endTime} |
|
|
</if> |
|
|
</if> |
|
|