diff --git a/src/main/resources/sql/mapper/base/actiongroup-mapper.xml b/src/main/resources/sql/mapper/base/actiongroup-mapper.xml index 14ea855d..49c3b1e0 100644 --- a/src/main/resources/sql/mapper/base/actiongroup-mapper.xml +++ b/src/main/resources/sql/mapper/base/actiongroup-mapper.xml @@ -9,22 +9,29 @@ - + + SELECT A.* FROM TB_ACTION_GRP A AND GRP_ID IN (#{groupID}) AND ${by} LIKE CONCAT('%', #{term}, '%') - + + - + - + -/* 기능그룹 등록(actionGroupMapper.insertGroup) */ + +/* 기능그룹 등록(actionGroupMapper.insertGroup) */ INSERT INTO TB_ACTION_GRP ( GRP_ID , GRP_NM @@ -35,27 +42,35 @@ INSERT INTO TB_ACTION_GRP ( , #{name} , #{description} , -) +) + -/* 기능그룹 수정(actionGroupMapper.updateGroup) */ + +/* 기능그룹 수정(actionGroupMapper.updateGroup) */ UPDATE TB_ACTION_GRP SET GRP_NM = #{name} , DSCRP = #{description} - WHERE GRP_ID = #{id} + WHERE GRP_ID = #{id} + -/* 기능그룹 삭제(actionGroupMapper.removeGroups) */ + +/* 기능그룹 삭제(actionGroupMapper.removeGroups) */ DELETE FROM TB_ACTION_GRP - WHERE GRP_ID IN (#{groupID}) + WHERE GRP_ID IN (#{groupID}) + - +/* 그룹별 기능 가져오기(actionGroupMapper.getActionList) */ SELECT * FROM TB_GRP_ACTION WHERE GRP_ID IN (#{groupID}) - + + -/* 그룹별 기능 추가(actionGroupMapper.addActions) */ + +/* 그룹별 기능 추가(actionGroupMapper.addActions) */ INSERT INTO TB_GRP_ACTION (GRP_ID, ACTION, REG_DT, RGTR) SELECT GRP_ID, ACTION,, #{currentUser.id} FROM ( @@ -66,9 +81,11 @@ SELECT GRP_ID, ACTION,, #{currentUser.id} FROM TB_GRP_ACTION B WHERE B.GRP_ID = A.GRP_ID AND B.ACTION = A.ACTION - ) + ) + -/* 그룹별 기능 삭제(actionGroupMapper.removeActions) */ + +/* 그룹별 기능 삭제(actionGroupMapper.removeActions) */ DELETE FROM TB_GRP_ACTION AND GRP_ID IN (#{groupID}) diff --git a/src/main/resources/sql/mapper/base/authority-mapper.xml b/src/main/resources/sql/mapper/base/authority-mapper.xml index 94f295c1..c9d051ab 100644 --- a/src/main/resources/sql/mapper/base/authority-mapper.xml +++ b/src/main/resources/sql/mapper/base/authority-mapper.xml @@ -12,7 +12,8 @@ - + + SELECT * FROM ( SELECT 0 AUTH_TYPE, 'ROLE_ADMIN' AUTH_ID, '시스템 관리자' AUTH_NM, '시스템 관리자' DSCRP, 'all' INF_SCP, 'all' USER_INF_SCP,REG_DT UNION SELECT 1 AUTH_TYPE, 'ROLE_ANONYMOUS' AUTH_ID, '익명 사용자' AUTH_NM, '모든 사용자' DSCRP, 'none' INF_SCP, 'none' USER_INF_SCP,REG_DT UNION @@ -25,15 +26,21 @@ SELECT * FROM ( AND ${by} LIKE CONCAT('%', #{term}, '%') - + + - + - + -/* 권한 등록(authorityMapper.insertAuthority) */ + +/* 권한 등록(authorityMapper.insertAuthority) */ INSERT INTO TB_AUTHORITY ( AUTH_ID , AUTH_NM @@ -48,30 +55,38 @@ INSERT INTO TB_AUTHORITY ( , #{infoScope} , #{userInfoScope} , -) +) + -/* 권한 수정(authorityMapper.updateAuthority) */ + +/* 권한 수정(authorityMapper.updateAuthority) */ UPDATE TB_AUTHORITY SET AUTH_NM = #{name} , DSCRP = #{description} , INF_SCP = #{infoScope} , USER_INF_SCP = #{userInfoScope} - WHERE AUTH_ID = #{id} + WHERE AUTH_ID = #{id} + -/* 권한 삭제(authorityMapper.removeAuthorities) */ + +/* 권한 삭제(authorityMapper.removeAuthorities) */ DELETE FROM TB_AUTHORITY - WHERE AUTH_ID IN (#{authID}) + WHERE AUTH_ID IN (#{authID}) + - +/* 권한-기능그룹 가져오기(authorityMapper.getActionGroups) */ SELECT A.* , (SELECT AG.GRP_NM FROM TB_ACTION_GRP AG WHERE AG.GRP_ID = A.GRP_ID) AS GRP_NM FROM TB_AUTH_ACTION A WHERE AUTH_ID IN (#{authID}) ORDER BY AUTH_ID, GRP_ID - + + -/* 권한-기능그룹 추가(authorityMapper.addActionGroups) */ + +/* 권한-기능그룹 추가(authorityMapper.addActionGroups) */ INSERT INTO TB_AUTH_ACTION (AUTH_ID, GRP_ID, REG_DT) SELECT AUTH_ID, GRP_ID, FROM ( @@ -84,7 +99,8 @@ SELECT AUTH_ID, GRP_ID, AND B.GRP_ID = A.GRP_ID ) -/* 권한-기능그룹 삭제(authorityMapper.removeActionGroups) */ + +/* 권한-기능그룹 삭제(authorityMapper.removeActionGroups) */ DELETE FROM TB_AUTH_ACTION AND AUTH_ID IN (#{authID}) @@ -92,7 +108,8 @@ DELETE FROM TB_AUTH_ACTION - +/* 권한-기능 가져오기(authorityMapper.getActionList) */ SELECT A.AUTH_ID , A.GRP_ID , C.ACTION @@ -101,7 +118,8 @@ SELECT A.AUTH_ID , TB_GRP_ACTION C WHERE A.GRP_ID = B.GRP_ID AND B.GRP_ID = C.GRP_ID - ORDER BY A.AUTH_ID, A.GRP_ID, C.ACTION + ORDER BY A.AUTH_ID, A.GRP_ID, C.ACTION + @@ -122,15 +140,21 @@ SELECT A.* AND A.USER_ID = B.USER_ID - + + - + - + -/* 권한-사용자 추가(authorityMapper.addUsers) */ + +/* 권한-사용자 추가(authorityMapper.addUsers) */ INSERT INTO TB_AUTH_USER (AUTH_ID, USER_ID, REG_DT) SELECT AUTH_ID, USER_ID, FROM ( @@ -141,9 +165,11 @@ SELECT AUTH_ID, USER_ID, FROM TB_AUTH_USER B WHERE B.AUTH_ID = A.AUTH_ID AND B.USER_ID = A.USER_ID - ) + ) + -/* 권한-사용자 삭제(authorityMapper.removeUsers) */ + +/* 권한-사용자 삭제(authorityMapper.removeUsers) */ DELETE FROM TB_AUTH_USER AND AUTH_ID IN (#{authID}) diff --git a/src/main/resources/sql/mapper/base/menu-mapper.xml b/src/main/resources/sql/mapper/base/menu-mapper.xml index 599e1943..38f234f6 100644 --- a/src/main/resources/sql/mapper/base/menu-mapper.xml +++ b/src/main/resources/sql/mapper/base/menu-mapper.xml @@ -20,15 +20,21 @@ SELECT A.* FROM TB_MENU A WHERE MENU_NO = #{menuID} - ORDER BY PRNT_NO, SRT_ORD, MENU_NO + ORDER BY PRNT_NO, SRT_ORD, MENU_NO + - + - + -/* 메뉴 등록(menuMapper.insertMenu) */ + +/* 메뉴 등록(menuMapper.insertMenu) */ SELECT NEW_NO, NEW_ORD FROM (SELECT NVL(MAX(MENU_NO) + 1, 0) NEW_NO FROM TB_MENU) A, @@ -57,9 +63,11 @@ INSERT INTO TB_MENU ( , #{menu.sortOrder} , , #{currentUser.id} -) +) + -/* 메뉴 수정(menuMapper.updateMenu) */ + +/* 메뉴 수정(menuMapper.updateMenu) */ UPDATE TB_MENU SET MENU_NM = #{menu.name} , PGRM_FILE_NM = #{menu.programFilename} @@ -69,24 +77,30 @@ UPDATE TB_MENU SET , IMG_CNF = #{menu.imageConf} WHERE MENU_NO = #{menu.id} -SELECT NVL(MAX(SRT_ORD) + 1, 0) NEW_ORD FROM TB_MENU WHERE PRNT_NO = NVL(#{parentID}, NVL(#{menu.parentID}, 0)) + +SELECT NVL(MAX(SRT_ORD) + 1, 0) NEW_ORD FROM TB_MENU WHERE PRNT_NO = NVL(#{parentID}, NVL(#{menu.parentID}, 0)) + -/* 메뉴 이동(menuMapper.moveMenus) */ + +/* 메뉴 이동(menuMapper.moveMenus) */ UPDATE TB_MENU SET PRNT_NO = #{parentID} , SRT_ORD = SRT_ORD + () WHERE MENU_NO IN (#{menuID}) -/* 메뉴 순서 변경(menuMapper.reorderMenus) */ + +/* 메뉴 순서 변경(menuMapper.reorderMenus) */ UPDATE TB_MENU SET SRT_ORD = CASE MENU_NO WHEN #{menuID} THEN #{index} ELSE MENU_NO END - WHERE MENU_NO IN (#{menuID}) + WHERE MENU_NO IN (#{menuID}) + -/* 메뉴 제거(menuMapper.removeMenus) */ + +/* 메뉴 제거(menuMapper.removeMenus) */ DELETE FROM TB_MENU WHERE MENU_NO IN (#{menuID}) diff --git a/src/main/resources/sql/mapper/base/policy-mapper.xml b/src/main/resources/sql/mapper/base/policy-mapper.xml index ad692385..01fea239 100644 --- a/src/main/resources/sql/mapper/base/policy-mapper.xml +++ b/src/main/resources/sql/mapper/base/policy-mapper.xml @@ -13,7 +13,8 @@ - +/* 로그인 정책 목록 조회(policyMapper.getPolicyList) */ SELECT A.USER_ID , USER_NM @@ -25,15 +26,19 @@ SELECT A.USER_ID FROM TB_USER A LEFT OUTER JOIN TB_LOGIN_POLICY B ON A.USER_ID = B.USER_ID WHERE A.${by} LIKE CONCAT('%', #{term}, '%') - + + - +/* 로그인 정책 가져오기(policyMapper.getPolicies) */ SELECT * FROM TB_LOGIN_POLICY WHERE USER_ID IN (#{userID}) - ORDER BY USER_ID + ORDER BY USER_ID + -/* 로그인 정책 등록(policyMapper.insertPolicy) */ + +/* 로그인 정책 등록(policyMapper.insertPolicy) */ INSERT INTO TB_LOGIN_POLICY ( USER_ID , IP_ADRS @@ -52,19 +57,24 @@ INSERT INTO TB_LOGIN_POLICY ( , #{currentUser.id} , , #{currentUser.id} -) +) + -/* 로그인 정책 수정(policyMapper.updatePolicy) */ + +/* 로그인 정책 수정(policyMapper.updatePolicy) */ UPDATE TB_LOGIN_POLICY SET IP_ADRS = #{policy.ipAddress} , DPLCT_YN = #{policy.duplicateYN} , LIMIT_YN = #{policy.limitYN} , MDFR = #{currentUser.id} , MDFCN_DT = -WHERE USER_ID = #{policy.userID} +WHERE USER_ID = #{policy.userID} + -/* 로그인 정책 삭제(policyMapper.removePolicy) */ + +/* 로그인 정책 삭제(policyMapper.removePolicy) */ DELETE FROM TB_LOGIN_POLICY - WHERE USER_ID IN (#{userID}) + WHERE USER_ID IN (#{userID}) + \ No newline at end of file diff --git a/src/main/resources/sql/mapper/base/syslog-mapper.xml b/src/main/resources/sql/mapper/base/syslog-mapper.xml index 9a2fb533..4b63eb1d 100644 --- a/src/main/resources/sql/mapper/base/syslog-mapper.xml +++ b/src/main/resources/sql/mapper/base/syslog-mapper.xml @@ -16,7 +16,8 @@ - +/* 시스템 로그 조회(loggingMapper.getLogs) */ SELECT LOG_ID , A.LOG_TYPE @@ -46,17 +47,21 @@ SELECT LOG_ID SELECT 'service' LOG_TYPE, '서비스' LOG_TYPE_NM FROM DUAL UNION SELECT 'web' LOG_TYPE, '웹' LOG_TYPE_NM FROM DUAL ) C - AND LOG_ID >= CONCAT(#{fromDate}, LPAD(0, 16, '0')) + + AND LOG_ID >= CONCAT(#{fromDate}, LPAD(0, 16, '0')) AND LOG_ID <= CONCAT(#{toDate}, LPAD(9, 16, '9')) AND A.LOG_TYPE IN (#{logType}) AND USER_ID IN (#{userID}) AND USER_ACNT IN (#{userAccount}) AND USER_NM LIKE CONCAT('%', #{userName}, '%') - AND A.LOG_TYPE = C.LOG_TYPE + AND A.LOG_TYPE = C.LOG_TYPE + - + + -/* 시스템 로그 등록(loggingMapper.insertLog) */ + +/* 시스템 로그 등록(loggingMapper.insertLog) */ SELECT CONCAT(TODAY, LPAD(NVL(SUBSTR(MAX(LOG_ID), 9) + 1, 1), 16, '0')) NEW_ID FROM TB_SYS_LOG A, () B @@ -87,6 +92,7 @@ INSERT INTO TB_SYS_LOG ( , #{userId} , #{ipAddress} , -) +) + \ No newline at end of file diff --git a/src/main/resources/sql/mapper/base/user-mapper.xml b/src/main/resources/sql/mapper/base/user-mapper.xml index 019658eb..32ad53b3 100644 --- a/src/main/resources/sql/mapper/base/user-mapper.xml +++ b/src/main/resources/sql/mapper/base/user-mapper.xml @@ -94,13 +94,16 @@ SELECT A.USER_ID - +/* 사용자 목록 조회(userMapper.getUserList) */ - +/* 사용자 가져오기(userMapper.getUsers) */ - +/* 사용자 계정 가져오기(userMapper.getUser) */ SELECT * FROM TB_USER @@ -111,7 +114,9 @@ SELECT * -SELECT LPAD(NVL(MAX(USER_ID) + 1, 1), 10, '0') NEW_ID FROM TB_USER + +SELECT LPAD(NVL(MAX(USER_ID) + 1, 1), 10, '0') NEW_ID FROM TB_USER + /* 사용자 정보 등록(userMapper.insertUser) */ INSERT INTO TB_USER ( USER_ID @@ -181,7 +186,8 @@ INSERT INTO TB_USER ( , #{createdBy} , 'Y' , #{status} -) +) + /* 사용자 정보 수정(userMapper.updateUser) */