@ -20,10 +20,12 @@
AND d.type_key = 'grid_party'
AND d.type_key = 'grid_party'
</otherwise>
</otherwise>
</choose>
</choose>
AND d.ID IN
<if test= "deptIdList!=null and deptIdList.size()>0" >
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
AND d.ID IN
#{id}
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
</foreach>
#{id}
</foreach>
</if>
AND d.id NOT IN ( SELECT c.dept_id FROM esua_epdc_admin.sys_dept_config c WHERE c.DEL_FLAG = '0' )
AND d.id NOT IN ( SELECT c.dept_id FROM esua_epdc_admin.sys_dept_config c WHERE c.DEL_FLAG = '0' )
ORDER BY d.sort
ORDER BY d.sort
</select>
</select>
@ -53,10 +55,13 @@
<if test= "deptId != null and deptId != ''" >
<if test= "deptId != null and deptId != ''" >
AND find_in_set(#{deptId}, t.ALL_DEPT_IDS)
AND find_in_set(#{deptId}, t.ALL_DEPT_IDS)
</if>
</if>
AND t.GRID_ID IN
<if test= "deptIdList!=null and deptIdList.size()>0" >
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
AND t.GRID_ID IN
#{id}
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
</foreach> ) t1,
#{id}
</foreach>
</if>
) t1,
(
(
SELECT
SELECT
COUNT( issue.ID ) AS issueNum,
COUNT( issue.ID ) AS issueNum,
@ -69,10 +74,12 @@
<if test= "deptId != null and deptId != ''" >
<if test= "deptId != null and deptId != ''" >
AND find_in_set(#{deptId}, issue.ALL_DEPT_IDS)
AND find_in_set(#{deptId}, issue.ALL_DEPT_IDS)
</if>
</if>
AND issue.GRID_ID IN
<if test= "deptIdList!=null and deptIdList.size()>0" >
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
AND issue.GRID_ID IN
#{id}
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
</foreach>
#{id}
</foreach>
</if>
) t2,
) t2,
(
(
SELECT
SELECT
@ -91,10 +98,12 @@
<if test= "deptId != null and deptId != ''" >
<if test= "deptId != null and deptId != ''" >
AND find_in_set(#{deptId}, item.ALL_DEPT_IDS)
AND find_in_set(#{deptId}, item.ALL_DEPT_IDS)
</if>
</if>
AND item.GRID_ID IN
<if test= "deptIdList!=null and deptIdList.size()>0" >
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
AND item.GRID_ID IN
#{id}
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
</foreach>
#{id}
</foreach>
</if>
) t3,
) t3,
(SELECT
(SELECT
COUNT( io.ID ) AS superviseItemNum,
COUNT( io.ID ) AS superviseItemNum,
@ -107,10 +116,13 @@
<if test= "deptId != null and deptId != ''" >
<if test= "deptId != null and deptId != ''" >
AND #{deptId} = io.BE_OVERSEE_DEPT
AND #{deptId} = io.BE_OVERSEE_DEPT
</if>
</if>
AND io.BE_OVERSEE_DEPT IN
<if test= "deptIdList!=null and deptIdList.size()>0" >
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
AND io.BE_OVERSEE_DEPT IN
#{id}
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
</foreach> ) t4
#{id}
</foreach>
</if>
) t4
</select>
</select>
<select id= "topicIssueItemAnalysisCommunity" resultType= "com.elink.esua.epdc.dto.analysis.pc.backstage.result.EpdcWorkbenchTopicIssueItemAnalysisResultDTO" >
<select id= "topicIssueItemAnalysisCommunity" resultType= "com.elink.esua.epdc.dto.analysis.pc.backstage.result.EpdcWorkbenchTopicIssueItemAnalysisResultDTO" >
@ -123,30 +135,38 @@
FROM
FROM
esua_epdc_admin.sys_dept d
esua_epdc_admin.sys_dept d
LEFT JOIN ( SELECT SUBSTRING_INDEX(t.PARENT_DEPT_IDS,',',-1) AS parentId, COUNT( t.ID ) AS topicNum FROM esua_epdc_group.epdc_topic t WHERE t.DEL_FLAG = '0'
LEFT JOIN ( SELECT SUBSTRING_INDEX(t.PARENT_DEPT_IDS,',',-1) AS parentId, COUNT( t.ID ) AS topicNum FROM esua_epdc_group.epdc_topic t WHERE t.DEL_FLAG = '0'
AND t.GRID_ID IN
<if test= "deptIdList!=null and deptIdList.size()>0" >
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
AND t.GRID_ID IN
#{id}
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
</foreach>
#{id}
</foreach>
</if>
GROUP BY SUBSTRING_INDEX(t.PARENT_DEPT_IDS,',',-1)) t1 ON t1.parentId = d.id
GROUP BY SUBSTRING_INDEX(t.PARENT_DEPT_IDS,',',-1)) t1 ON t1.parentId = d.id
LEFT JOIN ( SELECT SUBSTRING_INDEX(issue.PARENT_DEPT_IDS,',',-1) AS parentId, COUNT( issue.ID ) AS issueNum FROM esua_epdc_events.epdc_issue issue WHERE issue.DEL_FLAG = '0'
LEFT JOIN ( SELECT SUBSTRING_INDEX(issue.PARENT_DEPT_IDS,',',-1) AS parentId, COUNT( issue.ID ) AS issueNum FROM esua_epdc_events.epdc_issue issue WHERE issue.DEL_FLAG = '0'
AND issue.GRID_ID IN
<if test= "deptIdList!=null and deptIdList.size()>0" >
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
AND issue.GRID_ID IN
#{id}
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
</foreach>
#{id}
</foreach>
</if>
GROUP BY SUBSTRING_INDEX(issue.PARENT_DEPT_IDS,',',-1)) t2 ON t2.parentId = d.id
GROUP BY SUBSTRING_INDEX(issue.PARENT_DEPT_IDS,',',-1)) t2 ON t2.parentId = d.id
LEFT JOIN ( SELECT SUBSTRING_INDEX(item.PARENT_DEPT_IDS,',',-1) AS parentId, COUNT( item.ID ) AS itemNum FROM esua_epdc_events.epdc_item item WHERE item.DEL_FLAG = '0'
LEFT JOIN ( SELECT SUBSTRING_INDEX(item.PARENT_DEPT_IDS,',',-1) AS parentId, COUNT( item.ID ) AS itemNum FROM esua_epdc_events.epdc_item item WHERE item.DEL_FLAG = '0'
AND item.GRID_ID IN
<if test= "deptIdList!=null and deptIdList.size()>0" >
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
AND item.GRID_ID IN
#{id}
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
</foreach>
#{id}
</foreach>
</if>
GROUP BY SUBSTRING_INDEX(item.PARENT_DEPT_IDS,',',-1)) t3 ON t3.parentId = d.id
GROUP BY SUBSTRING_INDEX(item.PARENT_DEPT_IDS,',',-1)) t3 ON t3.parentId = d.id
WHERE
WHERE
d.del_flag = '0'
d.del_flag = '0'
AND d.type_key = 'community_party'
AND d.type_key = 'community_party'
AND d.ID IN
<if test= "deptIdList!=null and deptIdList.size()>0" >
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
AND d.ID IN
#{id}
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
</foreach>
#{id}
</foreach>
</if>
<if test= "deptId != null and deptId != ''" >
<if test= "deptId != null and deptId != ''" >
AND #{deptId} = d.id
AND #{deptId} = d.id
</if>
</if>
@ -164,30 +184,38 @@
FROM
FROM
esua_epdc_admin.sys_dept d
esua_epdc_admin.sys_dept d
LEFT JOIN ( SELECT t.GRID_ID, COUNT( t.ID ) AS topicNum FROM esua_epdc_group.epdc_topic t WHERE t.DEL_FLAG = '0'
LEFT JOIN ( SELECT t.GRID_ID, COUNT( t.ID ) AS topicNum FROM esua_epdc_group.epdc_topic t WHERE t.DEL_FLAG = '0'
AND t.GRID_ID IN
<if test= "deptIdList!=null and deptIdList.size()>0" >
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
AND t.GRID_ID IN
#{id}
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
</foreach>
#{id}
</foreach>
</if>
GROUP BY t.GRID_ID) t1 ON t1.GRID_ID = d.id
GROUP BY t.GRID_ID) t1 ON t1.GRID_ID = d.id
LEFT JOIN ( SELECT issue.GRID_ID, COUNT( issue.ID ) AS issueNum FROM esua_epdc_events.epdc_issue issue WHERE issue.DEL_FLAG = '0'
LEFT JOIN ( SELECT issue.GRID_ID, COUNT( issue.ID ) AS issueNum FROM esua_epdc_events.epdc_issue issue WHERE issue.DEL_FLAG = '0'
AND issue.GRID_ID IN
<if test= "deptIdList!=null and deptIdList.size()>0" >
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
AND issue.GRID_ID IN
#{id}
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
</foreach>
#{id}
</foreach>
</if>
GROUP BY issue.GRID_ID) t2 ON t2.GRID_ID = d.id
GROUP BY issue.GRID_ID) t2 ON t2.GRID_ID = d.id
LEFT JOIN ( SELECT item.GRID_ID, COUNT( item.ID ) AS itemNum FROM esua_epdc_events.epdc_item item WHERE item.DEL_FLAG = '0'
LEFT JOIN ( SELECT item.GRID_ID, COUNT( item.ID ) AS itemNum FROM esua_epdc_events.epdc_item item WHERE item.DEL_FLAG = '0'
AND item.GRID_ID IN
<if test= "deptIdList!=null and deptIdList.size()>0" >
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
AND item.GRID_ID IN
#{id}
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
</foreach>
#{id}
</foreach>
</if>
GROUP BY item.GRID_ID) t3 ON t3.GRID_ID = d.id
GROUP BY item.GRID_ID) t3 ON t3.GRID_ID = d.id
WHERE
WHERE
d.del_flag = '0'
d.del_flag = '0'
AND d.type_key = 'grid_party'
AND d.type_key = 'grid_party'
<if test= "deptIdList!=null and deptIdList.size()>0" >
AND d.ID IN
AND d.ID IN
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
#{id}
#{id}
</foreach>
</foreach>
</if>
<if test= "deptId != null and deptId != ''" >
<if test= "deptId != null and deptId != ''" >
AND #{deptId} = d.id
AND #{deptId} = d.id
</if>
</if>
@ -208,10 +236,12 @@
WHERE
WHERE
u.DEL_FLAG = '0') tmp GROUP BY tmp.deptId) tt ON tt.deptId = d.id
u.DEL_FLAG = '0') tmp GROUP BY tmp.deptId) tt ON tt.deptId = d.id
WHERE d.del_flag = 0 AND d.type_key = 'grid_party'
WHERE d.del_flag = 0 AND d.type_key = 'grid_party'
AND d.id IN
<if test= "deptIdList!=null and deptIdList.size()>0" >
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
AND d.id IN
#{id}
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
</foreach>
#{id}
</foreach>
</if>
<if test= "deptId != null and deptId != ''" >
<if test= "deptId != null and deptId != ''" >
AND #{deptId} = d.id
AND #{deptId} = d.id
</if>
</if>
@ -233,10 +263,12 @@
u.DEL_FLAG = '0') tmp
u.DEL_FLAG = '0') tmp
GROUP BY tmp.deptId) tt ON tt.deptId = d.id
GROUP BY tmp.deptId) tt ON tt.deptId = d.id
WHERE d.del_flag = 0 AND d.type_key = 'community_party'
WHERE d.del_flag = 0 AND d.type_key = 'community_party'
AND d.ID IN
<if test= "deptIdList!=null and deptIdList.size()>0" >
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
AND d.ID IN
#{id}
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
</foreach>
#{id}
</foreach>
</if>
<if test= "deptId != null and deptId != ''" >
<if test= "deptId != null and deptId != ''" >
AND #{deptId} = d.id
AND #{deptId} = d.id
</if>
</if>
@ -311,10 +343,12 @@
</if>
</if>
GROUP BY io.BE_OVERSEE_DEPT) t4 ON t4.deptId = d.id
GROUP BY io.BE_OVERSEE_DEPT) t4 ON t4.deptId = d.id
WHERE d.del_flag = '0' AND d.type_key = 'grid_party'
WHERE d.del_flag = '0' AND d.type_key = 'grid_party'
AND d.ID IN
<if test= "deptIdList!=null and deptIdList.size()>0" >
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
AND d.ID IN
#{id}
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
</foreach>
#{id}
</foreach>
</if>
<if test= "deptId != null and deptId != ''" >
<if test= "deptId != null and deptId != ''" >
AND #{deptId} = d.id
AND #{deptId} = d.id
</if>
</if>
@ -388,10 +422,12 @@
</if>
</if>
GROUP BY io.BE_OVERSEE_DEPT) t4 ON t4.deptId = d.id
GROUP BY io.BE_OVERSEE_DEPT) t4 ON t4.deptId = d.id
WHERE d.del_flag = '0' AND d.type_key = 'community_party'
WHERE d.del_flag = '0' AND d.type_key = 'community_party'
AND d.ID IN
<if test= "deptIdList!=null and deptIdList.size()>0" >
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
AND d.ID IN
#{id}
<foreach collection= "deptIdList" index= "index" item= "id" open= "(" separator= "," close= ")" >
</foreach>
#{id}
</foreach>
</if>
<if test= "deptId != null and deptId != ''" >
<if test= "deptId != null and deptId != ''" >
AND #{deptId} = d.id
AND #{deptId} = d.id
</if>
</if>