From b8ab6de032d3a6ee029331dbb58d764a5409189b Mon Sep 17 00:00:00 2001
From: 이민희 <mhlee@maprex.co.kr>
Date: 월, 28 2월 2022 15:51:13 +0900
Subject: [PATCH] - api로 하위이슈 추가 시 상위이슈의 파트너 정보 적용

---
 src/main/resources/mybatis/query-template/widget-template.xml |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mybatis/query-template/widget-template.xml b/src/main/resources/mybatis/query-template/widget-template.xml
index 26e1ace..1f57277 100644
--- a/src/main/resources/mybatis/query-template/widget-template.xml
+++ b/src/main/resources/mybatis/query-template/widget-template.xml
@@ -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="projectIds != null and projectIds.size != 0">
                 AND i.project_id IN
                 <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,6 +986,7 @@
         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>
@@ -989,6 +999,14 @@
                 </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>
+        </choose>
         AND i.complete_date IS NOT NULL
         AND i.complete_date <![CDATA[ < ]]> #{completeDate}
         <if test="page != null and !page.equals('')">

--
Gitblit v1.8.0