SELECT 쿼리 애스터리스크(*) 제거

dev
이범준 5 months ago
parent 8c81591418
commit d6bd49c472

@ -10,7 +10,10 @@
</resultMap> </resultMap>
<sql id="selectGroups"><include refid="utility.paging-prefix" /> <sql id="selectGroups"><include refid="utility.paging-prefix" />
SELECT A.* SELECT A.GRP_ID
, A.GRP_NM
, A.DSCRP
, A.REG_DT
FROM TB_ACTION_GRP A FROM TB_ACTION_GRP A
<where> <where>
<if test="groupIDs != null">AND GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if> <if test="groupIDs != null">AND GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if>

@ -13,11 +13,42 @@
</resultMap> </resultMap>
<sql id="selectAuthorities"><include refid="utility.paging-prefix" /> <sql id="selectAuthorities"><include refid="utility.paging-prefix" />
SELECT * FROM ( SELECT *
SELECT 0 AUTH_TYPE, 'ROLE_ADMIN' AUTH_ID, '시스템 관리자' AUTH_NM, '시스템 관리자' DSCRP, 'all' INF_SCP, 'all' USER_INF_SCP,<include refid="utility.now"/>REG_DT FROM DUAL UNION FROM (
SELECT 1 AUTH_TYPE, 'ROLE_ANONYMOUS' AUTH_ID, '익명 사용자' AUTH_NM, '모든 사용자' DSCRP, 'none' INF_SCP, 'none' USER_INF_SCP,<include refid="utility.now"/>REG_DT FROM DUAL UNION SELECT 0 AS AUTH_TYPE
SELECT 1 AUTH_TYPE, 'ROLE_USER' AUTH_ID, '시스템 사용자' AUTH_NM, '로그인한 사용자' DSCRP, 'self' INF_SCP, 'self' USER_INF_SCP,<include refid="utility.now"/>REG_DT FROM DUAL UNION , 'ROLE_ADMIN' AS AUTH_ID
SELECT 2 AUTH_TYPE, AUTH_ID, AUTH_NM, DSCRP, INF_SCP, USER_INF_SCP, REG_DT , '시스템 관리자' AS AUTH_NM
, '시스템 관리자' AS DSCRP
, 'all' AS INF_SCP
, 'all' AS USER_INF_SCP
, <include refid="utility.now"/> AS REG_DT
FROM DUAL
UNION
SELECT 1 AS AUTH_TYPE
, 'ROLE_ANONYMOUS' AS AUTH_ID
, '익명 사용자' AS AUTH_NM
, '모든 사용자' AS DSCRP
, 'none' AS INF_SCP
, 'none' AS USER_INF_SCP
, <include refid="utility.now"/> AS REG_DT
FROM DUAL
UNION
SELECT 1 AS AUTH_TYPE
, 'ROLE_USER' AS AUTH_ID
, '시스템 사용자' AS AUTH_NM
, '로그인한 사용자' AS DSCRP
, 'self' AS INF_SCP
, 'self' AS USER_INF_SCP
, <include refid="utility.now"/> AS REG_DT
FROM DUAL
UNION
SELECT 2 AS AUTH_TYPE
, AUTH_ID
, AUTH_NM
, DSCRP
, INF_SCP
, USER_INF_SCP
, REG_DT
FROM TB_AUTHORITY FROM TB_AUTHORITY
) A ) A
<where> <where>

@ -42,7 +42,14 @@
</resultMap> </resultMap>
<sql id="selectCategories"><include refid="utility.paging-prefix" /> <sql id="selectCategories"><include refid="utility.paging-prefix" />
SELECT * SELECT CTGR_ID
, CTGR_NM
, DSCRP
, USE_YN
, REG_DT
, RGTR
, MDFCN_DT
, MDFR
FROM TB_CODE_CTGR FROM TB_CODE_CTGR
<where><if test="!includeAll"> AND USE_YN = 'Y'</if> <where><if test="!includeAll"> AND USE_YN = 'Y'</if>
<if test="categoryIDs != null"> AND CTGR_ID IN (<foreach collection="categoryIDs" item="categoryID" separator=",">#{categoryID}</foreach>)</if></where> <if test="categoryIDs != null"> AND CTGR_ID IN (<foreach collection="categoryIDs" item="categoryID" separator=",">#{categoryID}</foreach>)</if></where>
@ -92,7 +99,15 @@ UPDATE TB_CODE_CTGR SET
<if test='categoryIDs != null'>WHERE CTGR_ID IN (<foreach collection="categoryIDs" item="categoryID" separator=",">#{categoryID}</foreach>)</if></delete> <if test='categoryIDs != null'>WHERE CTGR_ID IN (<foreach collection="categoryIDs" item="categoryID" separator=",">#{categoryID}</foreach>)</if></delete>
<sql id="selectGroups"><include refid="utility.paging-prefix" /> <sql id="selectGroups"><include refid="utility.paging-prefix" />
SELECT * SELECT GRP_ID
, CTGR_ID
, GRP_NM
, DSCRP
, USE_YN
, REG_DT
, RGTR
, MDFCN_DT
, MDFR
FROM TB_CODE_GRP FROM TB_CODE_GRP
<where><if test="!includeAll"> AND USE_YN = 'Y'</if> <where><if test="!includeAll"> AND USE_YN = 'Y'</if>
<if test="categoryIDs != null"> AND CTGR_ID IN (<foreach collection="categoryIDs" item="categoryID" separator=",">#{categoryID}</foreach>)</if> <if test="categoryIDs != null"> AND CTGR_ID IN (<foreach collection="categoryIDs" item="categoryID" separator=",">#{categoryID}</foreach>)</if>
@ -149,7 +164,19 @@ UPDATE TB_CODE_GRP SET
</where></update> </where></update>
<sql id="selectCodes"><include refid="utility.paging-prefix" /> <sql id="selectCodes"><include refid="utility.paging-prefix" />
SELECT * SELECT GRP_ID
, CODE
, CODE_VAL
, DSCRP
, ETC_1
, ETC_2
, ETC_3
, SRT_ORD
, USE_YN
, REG_DT
, RGTR
, MDFCN_DT
, MDFR
FROM TB_CMN_CODE FROM TB_CMN_CODE
<where><if test="!includeAll"> AND USE_YN = 'Y'</if> <where><if test="!includeAll"> AND USE_YN = 'Y'</if>
<if test='groupIDs != null'> AND GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if> <if test='groupIDs != null'> AND GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if>

@ -17,7 +17,17 @@
</resultMap> </resultMap>
<sql id="selectMenus"> <sql id="selectMenus">
SELECT A.* SELECT A.MENU_NO
, A.MENU_NM
, A.PRNT_NO
, A.PGRM_FILE_NM
, A.ACTION
, A.DSCRP
, A.IMG_NM
, A.IMG_CNF
, A.SRT_ORD
, A.REG_DT
, A.RGTR
FROM TB_MENU A FROM TB_MENU A
<if test='menuID != null'>WHERE MENU_NO = #{menuID}</if> <if test='menuID != null'>WHERE MENU_NO = #{menuID}</if>
ORDER BY PRNT_NO, SRT_ORD, MENU_NO</sql> ORDER BY PRNT_NO, SRT_ORD, MENU_NO</sql>

Loading…
Cancel
Save