From 689e17c797bf3844f7b6b6f7c086df9bd8f72a0c Mon Sep 17 00:00:00 2001 From: wyu <kknd09321@nate.com> Date: 화, 28 12월 2021 19:45:34 +0900 Subject: [PATCH] Merge branch 'master' of http://192.168.0.25:9001/r/owl-kisa --- src/main/resources/mybatis/query-template/widget-template.xml | 186 +++++++++++++++++++++++++--------------------- 1 files changed, 102 insertions(+), 84 deletions(-) diff --git a/src/main/resources/mybatis/query-template/widget-template.xml b/src/main/resources/mybatis/query-template/widget-template.xml index 6da8334..1f57277 100644 --- a/src/main/resources/mybatis/query-template/widget-template.xml +++ b/src/main/resources/mybatis/query-template/widget-template.xml @@ -15,9 +15,9 @@ WHERE EXISTS(SELECT 1 FROM issue_status iss WHERE iss.issue_status_type != 'CLOSE' AND i.issue_status_id = iss.id) <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -33,9 +33,9 @@ WHERE EXISTS(SELECT 1 FROM issue_status iss WHERE iss.issue_status_type != 'CLOSE' AND i.issue_status_id = iss.id) <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -60,9 +60,9 @@ COUNT(i.id) FROM issue i where exists(select 1 from issue_status iss where iss.id = i.issue_status_id and iss.issue_status_type != 'CLOSE') <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -79,9 +79,9 @@ INNER JOIN user_department ud ON ud.department_id = isd.department_id where exists(select 1 from issue_status iss where iss.id = i.issue_status_id and iss.issue_status_type != 'CLOSE') <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -145,9 +145,9 @@ </choose> ) AND EXISTS(SELECT 1 FROM issue_status iss WHERE iss.id = i.issue_status_id and iss.issue_status_type != 'CLOSE') <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -174,9 +174,9 @@ </choose> ) AND EXISTS(SELECT 1 FROM issue_status iss WHERE iss.id = i.issue_status_id and iss.issue_status_type != 'CLOSE') <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -190,9 +190,9 @@ count(i.id) as todayCount from issue i where i.register_id = #{loginUserId} <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -209,9 +209,9 @@ where i.register_id = #{loginUserId} <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -239,9 +239,9 @@ WHERE EXISTS(select 1 from issue_status iss where iss.id = i.issue_status_id and iss.issue_status_type != 'CLOSE') <choose> - <when test="meAndDownProjectIds.size != 0"> + <when test="projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -258,9 +258,9 @@ WHERE EXISTS(select 1 from issue_status iss where iss.id = i.issue_status_id and iss.issue_status_type != 'CLOSE') <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -276,9 +276,9 @@ WHERE EXISTS(select 1 from issue_status iss where iss.id = i.issue_status_id and iss.issue_status_type != 'CLOSE') <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -302,9 +302,9 @@ inner join issue_status iss on iss.id = i.issue_status_id where iss.issue_status_type = 'CLOSE' <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -320,9 +320,9 @@ INNER JOIN user_department ud ON ud.department_id = isd.department_id where iss.issue_status_type = 'CLOSE' <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -353,9 +353,9 @@ where iss.issue_status_type = 'CLOSE' and i.modify_date between #{searchStartDate} and #{searchEndDate} <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -370,9 +370,9 @@ inner join issue_status iss on iss.id = i.issue_status_id where 1=1 <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -450,9 +450,9 @@ left outer join issue_status iss on iss.id = i.issue_status_id WHERE 1=1 <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND p.id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -564,9 +564,9 @@ and isd.register_date BETWEEN (CURDATE()) AND (CURDATE() + INTERVAL 1 DAY)) <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -604,9 +604,9 @@ inner join issue_status iss on iss.id = i.issue_status_id WHERE 1=1 <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -676,9 +676,9 @@ inner join project p on p.id = i.project_id WHERE 1=1 <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND p.id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -710,9 +710,9 @@ inner join project p on p.id = i.project_id WHERE 1=1 <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND p.id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -770,9 +770,9 @@ inner join issue_status iss on iss.id = i.issue_status_id where iss.issue_status_type != 'CLOSE' <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -824,9 +824,9 @@ inner join project p on p.id = i.project_id where iss.issue_status_type != 'CLOSE' <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND p.id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -847,9 +847,9 @@ inner join issue_status iss on iss.id = i.issue_status_id where iss.issue_status_type != 'CLOSE' <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -886,9 +886,9 @@ WHERE 1=1 AND i.register_id = #{loginUserId} <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -917,9 +917,9 @@ AND EXISTS (SELECT 1 FROM issue_status iss WHERE iss.id = i.issue_status_id AND iss.issue_status_type != 'CLOSE') </if> <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -953,12 +953,21 @@ <if test="page != null and !page.equals('')"> INNER JOIN issue_status iss ON iss.id = i.issue_status_id INNER JOIN project p ON p.id = i.project_id + LEFT OUTER join issue_department isd on isd.issue_id = i.id </if> WHERE 1=1 <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> + #{item} + </foreach> + </when> + </choose> + <choose> + <when test="myDepartmentIds != null and myDepartmentIds.size != 0"> + AND isd.department_id IN + <foreach collection="myDepartmentIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -977,14 +986,23 @@ SELECT COUNT(DISTINCT i.id) FROM issue i INNER JOIN project p ON p.id = i.project_id + LEFT OUTER join issue_department isd on isd.issue_id = i.id <if test="page != null and !page.equals('')"> INNER JOIN issue_status iss ON iss.id = i.issue_status_id </if> WHERE 1=1 <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> + #{item} + </foreach> + </when> + </choose> + <choose> + <when test="myDepartmentIds != null and myDepartmentIds.size != 0"> + AND isd.department_id IN + <foreach collection="myDepartmentIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -1020,9 +1038,9 @@ inner join issue_status iss on iss.id = i.issue_status_id where 1=1 <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -1050,9 +1068,9 @@ INNER JOIN user_department ud ON ud.department_id = isd.department_id where 1=1 <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -1125,9 +1143,9 @@ inner join project p on p.id = pr.project_id WHERE <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> p.id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -1160,9 +1178,9 @@ inner join project p on p.id = pr.project_id WHERE <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> p.id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -1195,9 +1213,9 @@ 'CLOSE') AND i.register_id = #{loginUserId} <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -1213,9 +1231,9 @@ 'CLOSE') AND i.register_id = #{loginUserId} <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -1260,9 +1278,9 @@ </choose> and iss.issue_status_type = 'CLOSE' <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -1307,9 +1325,9 @@ </otherwise> </choose> <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -1327,9 +1345,9 @@ INNER JOIN issue_type ON issue.issue_type_id = issue_type.id WHERE 1=1 <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND issue.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -1376,9 +1394,9 @@ WHERE w.id = #{workspaceId} AND iss.issue_status_type != 'CLOSE' <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -1402,9 +1420,9 @@ WHERE w.id = #{workspaceId} AND iss.issue_status_type != 'CLOSE' <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -1446,9 +1464,9 @@ AND s.id = #{severityId} AND iss.issue_status_type != 'CLOSE' <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -1483,9 +1501,9 @@ AND s.id = #{severityId} AND iss.issue_status_type != 'CLOSE' <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -1519,9 +1537,9 @@ AND s.id = #{severityId} AND iss.issue_status_type != 'CLOSE' <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> @@ -1541,9 +1559,9 @@ AND s.id = #{severityId} AND iss.issue_status_type != 'CLOSE' <choose> - <when test="meAndDownProjectIds != null and meAndDownProjectIds.size != 0"> + <when test="projectIds != null and projectIds.size != 0"> AND i.project_id IN - <foreach collection="meAndDownProjectIds" item="item" index="index" separator="," open="(" close=")"> + <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")"> #{item} </foreach> </when> -- Gitblit v1.8.0