From de2abff4377c9ee83161c954a51de4c9390fff76 Mon Sep 17 00:00:00 2001
From: 이민희 <mhlee@maprex.co.kr>
Date: 수, 15 12월 2021 18:34:21 +0900
Subject: [PATCH] 프로필에 내 사용자 등급/부서 표시

---
 src/main/resources/mybatis/query-template/user-template.xml |   28 +++++++++++++++++++++++++---
 1 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/src/main/resources/mybatis/query-template/user-template.xml b/src/main/resources/mybatis/query-template/user-template.xml
index a1433b4..e16010d 100644
--- a/src/main/resources/mybatis/query-template/user-template.xml
+++ b/src/main/resources/mybatis/query-template/user-template.xml
@@ -113,8 +113,14 @@
 
     <!--    �씠硫붿씪 �삁�빟 �떆媛� 李얘린    -->
     <select id="findByReservationNotifyTime" resultType="java.util.HashMap" parameterType="java.util.HashMap">
-        select account from user where reservation_notify_time between
-        #{startTime} and #{endTime}
+        select account from user
+        where reservation_notify_time between #{startTime} and #{endTime}
+    </select>
+
+    <!--    �씠硫붿씪 �떎�떆媛� 李얘린    -->
+    <select id="findByRealTimeNotifyTime" resultType="java.util.HashMap" parameterType="java.util.HashMap">
+        select account from user
+        where reservation_notify_time = "realTime"
     </select>
 
     <select id="findByAllWorkspace" resultType="java.util.HashMap" parameterType="kr.wisestone.owl.web.condition.UserCondition">
@@ -170,10 +176,26 @@
         GROUP BY u.id ORDER BY issueCount desc, loginCount DESC;
     </select>
 
-    <select id="findByLevelId" resultType="java.util.HashMap" parameterType="java.lang.Long">
+    <select id="findByLevelId" resultType="java.lang.Long" parameterType="java.lang.Long">
         SELECT count(u.id)
         FROM user u
         WHERE u.level_id = #{id}
     </select>
 
+    <select id="findByMyLevelAndDepartment" resultType="java.util.HashMap" parameterType="java.lang.Long">
+        SELECT
+        DISTINCT u.id as id,
+                 ul.level_name AS levelName,
+                 GROUP_CONCAT(d.department_name) AS departmentName,
+                 u.name as name,
+                 u.account as account,
+                 u.profile as profile,
+                 u.status as STATUS
+        FROM user u
+        LEFT OUTER JOIN user_level ul ON u.level_id = ul.id
+        LEFT OUTER JOIN user_department ud ON ud.user_id = u.id
+        LEFT OUTER JOIN department d ON d.id = ud.department_id
+        WHERE u.id = #{id}
+    </select>
+
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0