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 |  192 ++++++++++++++++++++++++++----------------------
 1 files changed, 104 insertions(+), 88 deletions(-)

diff --git a/src/main/resources/mybatis/query-template/widget-template.xml b/src/main/resources/mybatis/query-template/widget-template.xml
index 4b94ec0..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>
@@ -695,6 +695,7 @@
         select
         distinct i.id as id,
         i.title as title,
+        i.issue_type_id as issueTypeId,
         p.name as projectName,
         CONCAT(p.project_key, '-', i.issue_number) AS issueKey,
         p.project_key as projectKey,
@@ -709,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>
@@ -769,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>
@@ -815,16 +816,17 @@
         CONCAT(p.project_key, '-', i.issue_number) AS issueKey,
         i.issue_number as issueNumber,
         p.project_key as projectKey,
-        p.name as projectName
+        p.name as projectName,
+        i.issue_type_id as issueTypeId
         from issue i
         inner join issue_risk ir on ir.issue_id = i.id
         inner join issue_status iss on iss.id = i.issue_status_id
         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>
@@ -845,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>
@@ -874,6 +876,7 @@
             , i.issue_number as issueNumber
             , p.project_key as projectKey
             , CONCAT(p.project_key, '-', i.issue_number) AS issueKey
+            , i.issue_type_id as issueTypeId
         </if>
         FROM issue i
         <if test="page != null and !page.equals('')">
@@ -883,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>
@@ -914,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>
@@ -943,6 +946,7 @@
             , iss.name as issueStatusName
             , i.issue_number as issueNumber
             , p.project_key as projectKey
+            , i.issue_type_id as issueTypeId
             , CONCAT(p.project_key, '-', i.issue_number) AS issueKey
         </if>
         FROM issue i
@@ -952,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>
@@ -978,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>
@@ -1009,15 +1013,16 @@
             </when>
         </choose>
         ,p.id,
-        p.name as projectName
+        p.name as projectName,
+        i.issue_type_id as issueTypeId
         from issue i
         inner join project p on p.id = i.project_id
         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>
@@ -1036,7 +1041,8 @@
             </when>
         </choose>
         ,p.id,
-        p.name as projectName
+        p.name as projectName,
+        i.issue_type_id as issueTypeId
         from issue i
         inner join project p on p.id = i.project_id
         inner join issue_status iss on iss.id = i.issue_status_id
@@ -1044,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>
@@ -1119,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>
@@ -1154,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>
@@ -1189,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>
@@ -1207,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>
@@ -1254,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>
@@ -1301,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>
@@ -1319,7 +1325,15 @@
             parameterType="kr.wisestone.owl.web.condition.WidgetCondition">
         SELECT issue_type.name as name, COUNT(issue.id) as issueCount FROM issue
         INNER JOIN issue_type ON issue.issue_type_id = issue_type.id
-        WHERE issue.project_id = #{projectId}
+        WHERE 1=1
+        <choose>
+            <when test="projectIds != null and projectIds.size != 0">
+                AND issue.project_id IN
+                <foreach collection="projectIds" item="item" index="index" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </when>
+        </choose>
         GROUP BY issue_type.name
     </select>
 
@@ -1362,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>
@@ -1388,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>
@@ -1421,7 +1435,8 @@
         p.project_key AS projectKey,
         p.name AS projectName,
         iss.name AS issueStatusName,
-        CONCAT(p.project_key, '-', i.issue_number) AS issueKey
+        CONCAT(p.project_key, '-', i.issue_number) AS issueKey,
+        i.issue_type_id as issueTypeId
         FROM issue i
         INNER JOIN project p ON p.id = i.project_id
         INNER JOIN workspace w ON w.id = p.workspace_id
@@ -1431,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>
@@ -1455,7 +1470,8 @@
         p.project_key AS projectKey,
         p.name AS projectName,
         iss.name AS issueStatusName,
-        CONCAT(p.project_key, '-', i.issue_number) AS issueKey
+        CONCAT(p.project_key, '-', i.issue_number) AS issueKey,
+        i.issue_type_id as issueTypeId
         FROM issue i
         INNER JOIN project p ON p.id = i.project_id
         INNER JOIN workspace w ON w.id = p.workspace_id
@@ -1467,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>
@@ -1503,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>
@@ -1525,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