diff --git a/src/main/resources/sql/mapper/base/user-mapper.xml b/src/main/resources/sql/mapper/base/user-mapper.xml index aafeedb9..019658eb 100644 --- a/src/main/resources/sql/mapper/base/user-mapper.xml +++ b/src/main/resources/sql/mapper/base/user-mapper.xml @@ -41,49 +41,49 @@ -SELECT USER_ID - , USER_ACNT - , USER_NM - , PASSWD_HINT - , PASSWD_NSR - , EMP_NO - , RSDNT_NO - , GENDER - , BRDT - , AREA_NO - , ZIP - , ADDR - , DADDR - , TELNO - , MBL_TELNO - , FXNO - , EML_ADRS - , POS_NM - , GRP_ID - , ORG_ID - , (SELECT SGG_NM FROM TB_SGG WHERE SGG_CD = A.ORG_ID) AS SGG_NM - , DEPT_CD - , (CASE - WHEN A.DEPT_CD = 'default' - THEN '기본 부서' - ELSE (SELECT DEPT_NM FROM TB_DEPT WHERE DEPT_CD = A.DEPT_CD) - END - ) AS DEPT_NM - , NSTT_CD - , (CASE - WHEN A.NSTT_CD = 'default' - THEN '기본 기관' - ELSE (SELECT INST_NM FROM TB_SGG WHERE INST_CD = A.NSTT_CD AND SGG_CD = A.ORG_ID) - END - ) AS NSTT_NM - , CRTFC_DN - , LOCK_YN - , LOCK_CNT - , LOCK_DT - , REG_DT - , STTS - , (SELECT GET_CODE_NM('CMN004', STTS) FROM DUAL) AS STTS_NM +SELECT A.USER_ID + , A.USER_ACNT + , A.USER_NM + , A.PASSWD_HINT + , A.PASSWD_NSR + , A.EMP_NO + , A.RSDNT_NO + , A.GENDER + , A.BRDT + , A.AREA_NO + , A.ZIP + , A.ADDR + , A.DADDR + , A.TELNO + , A.MBL_TELNO + , A.FXNO + , A.EML_ADRS + , A.POS_NM + , A.GRP_ID + , A.ORG_ID + , A.CRTFC_DN + , A.LOCK_YN + , A.LOCK_CNT + , A.LOCK_DT + , A.REG_DT + , A.STTS + , (SELECT GET_CODE_NM('CMN004', A.STTS) FROM DUAL) AS STTS_NM + , A.NSTT_CD AS NSTT_CD + , (CASE WHEN A.NSTT_CD = 'default' THEN '기본 기관' ELSE B.INST_NM END) AS NSTT_NM + , A.NSTT_CD AS INST_CD + , (CASE WHEN A.NSTT_CD = 'default' THEN '기본 기관' ELSE B.INST_NM END) AS INST_NM + , A.DEPT_CD AS DEPT_CD + , (CASE WHEN A.DEPT_CD = 'default' THEN '기본 부서' ELSE B.DEPT_NM END) AS DEPT_NM + , B.SGG_CD AS SGG_CD + , B.SGG_NM AS SGG_NM FROM TB_USER A + LEFT OUTER JOIN ( + SELECT A.SGG_CD, SGG_NM, A.INST_CD, INST_NM, DEPT_CD, DEPT_NM + FROM TB_SGG A LEFT OUTER JOIN TB_DEPT B + ON A.SGG_CD = B.SGG_CD + AND A.INST_CD = B.INST_CD + AND A.USE_YN = 'Y' AND B.USE_YN = 'Y' + ) B ON A.NSTT_CD = B.INST_CD AND A.DEPT_CD = B.DEPT_CD AND ${by} LIKE CONCAT('%', #{term}, '%') USER_ID IN (#{userID})