From 8640de04cd67d3fa33ca188d6b45ed1a13d17386 Mon Sep 17 00:00:00 2001
From: wyu <kknd09321@nate.com>
Date: 목, 11 11월 2021 09:25:01 +0900
Subject: [PATCH] 사용자 관리 부서 상세 백앤드 수정

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

diff --git a/src/main/resources/mybatis/query-template/department-template.xml b/src/main/resources/mybatis/query-template/department-template.xml
index abb1f65..98aaf4d 100644
--- a/src/main/resources/mybatis/query-template/department-template.xml
+++ b/src/main/resources/mybatis/query-template/department-template.xml
@@ -8,7 +8,7 @@
         d.id as id,
         d.department_name as departmentName,
         d.department_description as departmentDescription,
-        (SELECT COUNT(d.id) FROM user_department ud WHERE d.id = ud.department_id) AS departmentCount
+        (SELECT COUNT(ud.department_id) FROM user_department ud WHERE d.id = ud.department_id) AS departmentCount
         FROM
         department d
         WHERE 1=1
@@ -36,4 +36,20 @@
             AND d.id like CONCAT('%',#{id},'%')
         </if>
     </select>
+
+    <select id="findByDepartmentIds" resultType="java.util.HashMap" parameterType="kr.wisestone.owl.web.condition.UserCondition">
+        SELECT
+        d.id as id,
+        d.department_name as departmentName,
+        d.department_description as departmentDescription
+        FROM
+        user_department ud
+        INNER JOIN department d ON ud.department_id = d.id
+        WHERE 1=1
+        <if test="id != '' and id != null">
+            AND ud.user_id = #{id}
+        </if>
+    </select>
+
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0