Browse Source

deptIdList myabtis校验

master
zhangyongzhangyong 4 years ago
parent
commit
2a2bd5adf1
  1. 40
      epdc-cloud-analysis-pc/src/main/resources/mapper/backstage/EpdcBackstageDao.xml

40
epdc-cloud-analysis-pc/src/main/resources/mapper/backstage/EpdcBackstageDao.xml

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

Loading…
Cancel
Save