From 71a5ce92795fb1a4fbff5fceab8135ec98a691e5 Mon Sep 17 00:00:00 2001 From: 박지현 <jhpark@maprex.co.kr> Date: 월, 07 3월 2022 18:07:52 +0900 Subject: [PATCH] 이슈 목록 조회 방식 - 전체이슈 보기 / 상위 이슈만 보기 / 하위 이슈만 보기로 수정 --- src/main/resources/mybatis/query-template/widget-template.xml | 275 +++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 185 insertions(+), 90 deletions(-) diff --git a/src/main/resources/mybatis/query-template/widget-template.xml b/src/main/resources/mybatis/query-template/widget-template.xml index 22cd788..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> @@ -47,6 +47,9 @@ #{item} </foreach> </when> + <otherwise> + AND 1 != 1 + </otherwise> </choose> </select> @@ -57,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> @@ -76,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> @@ -90,6 +93,9 @@ #{item} </foreach> </when> + <otherwise> + AND 1 != 1 + </otherwise> </choose> AND i.complete_date IS NOT NULL AND i.complete_date <![CDATA[ < ]]> #{completeDate} @@ -139,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> @@ -168,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> @@ -184,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> @@ -203,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> @@ -217,6 +223,9 @@ #{item} </foreach> </when> + <otherwise> + AND 1 != 1 + </otherwise> </choose> AND i.register_date BETWEEN (CURDATE()) AND (CURDATE() + INTERVAL 1 DAY) </select> @@ -230,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> @@ -249,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> @@ -267,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> @@ -293,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> @@ -311,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> @@ -325,6 +334,9 @@ #{item} </foreach> </when> + <otherwise> + AND 1 != 1 + </otherwise> </choose> </select> @@ -341,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> @@ -358,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> @@ -438,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> @@ -539,19 +551,22 @@ INNER JOIN user_department ud ON ud.department_id = isd.department_id where isd.issue_id = i.id <choose> - <when test="myDepartmentIds.size != 0"> + <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> + <otherwise> + AND 1 != 1 + </otherwise> </choose> 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> @@ -589,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> @@ -603,6 +618,9 @@ #{item} </foreach> </when> + <otherwise> + AND 1 != 1 + </otherwise> </choose> And iss.issue_status_type != 'CLOSE' </select> @@ -658,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> @@ -677,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, @@ -691,20 +710,23 @@ 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> </choose> <choose> - <when test="myDepartmentIds.size != 0"> + <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> + <otherwise> + AND 1 != 1 + </otherwise> </choose> and iss.issue_status_type != 'CLOSE' GROUP by i.id @@ -748,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> @@ -794,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> @@ -824,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> @@ -853,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('')"> @@ -862,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> @@ -893,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> @@ -922,18 +946,28 @@ , 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 <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> @@ -952,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> @@ -988,15 +1031,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> @@ -1015,7 +1059,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 @@ -1023,12 +1068,23 @@ 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> + </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> + <otherwise> + AND 1 != 1 + </otherwise> </choose> group by p.id </select> @@ -1087,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> @@ -1122,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> @@ -1136,6 +1192,9 @@ #{item} </foreach> </when> + <otherwise> + AND 1 != 1 + </otherwise> </choose> and p.status = '02'; </select> @@ -1154,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> @@ -1172,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> @@ -1213,12 +1272,15 @@ #{item} </foreach> </when> + <otherwise> + AND 1 != 1 + </otherwise> </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> @@ -1258,11 +1320,14 @@ #{item} </foreach> </when> + <otherwise> + AND 1 != 1 + </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> @@ -1278,7 +1343,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> @@ -1289,6 +1362,17 @@ INNER JOIN issue_department isd ON isd.issue_id = issue.id INNER JOIN user_department ud ON ud.department_id = isd.department_id WHERE issue.project_id = #{projectId} + <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> + <otherwise> + AND 1 != 1 + </otherwise> + </choose> GROUP BY issue_type.name </select> @@ -1310,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> @@ -1336,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> @@ -1350,6 +1434,9 @@ #{item} </foreach> </when> + <otherwise> + AND 1 != 1 + </otherwise> </choose> </select> @@ -1366,7 +1453,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 @@ -1376,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> @@ -1400,7 +1488,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 @@ -1412,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> @@ -1426,6 +1515,9 @@ #{item} </foreach> </when> + <otherwise> + AND 1 != 1 + </otherwise> </choose> <if test="page != null and !page.equals('')"> limit #{pageSize} offset #{page}; @@ -1445,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> @@ -1467,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> @@ -1481,6 +1573,9 @@ #{item} </foreach> </when> + <otherwise> + AND 1 != 1 + </otherwise> </choose> </select> -- Gitblit v1.8.0