From 331fa1aa562297b3e0f0cce3b244d187f32910bd Mon Sep 17 00:00:00 2001
From: 이민희 <mhlee@maprex.co.kr>
Date: 화, 28 12월 2021 17:59:08 +0900
Subject: [PATCH] 하위프로젝트 가져오는 코드 롤백 및 상위 프로젝트는 추가 못하도록 수정

---
 src/main/resources/mybatis/query-template/widget-template.xml |  168 ++++++++++++++++++++++++++++----------------------------
 1 files changed, 84 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..26e1ace 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>
@@ -956,9 +956,9 @@
         </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>
@@ -982,9 +982,9 @@
         </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>
@@ -1020,9 +1020,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 +1050,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 +1125,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 +1160,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 +1195,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 +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>
@@ -1260,9 +1260,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 +1307,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 +1327,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 +1376,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 +1402,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 +1446,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 +1483,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 +1519,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 +1541,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