actionGroup, code, menu, policy 매퍼 참조 경로 변경
parent
9ce3ea357c
commit
3e113c04fb
@ -0,0 +1,106 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cokr.xit.base.security.access.dao.ActionGroupMapper">
|
||||
|
||||
<resultMap id="groupRow" type="cokr.xit.base.security.access.ActionGroup">
|
||||
<result property="id" column="GRP_ID"/>
|
||||
<result property="name" column="GRP_NM"/>
|
||||
<result property="description" column="DSCRP"/>
|
||||
<result property="createdAt" column="REG_DT"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectGroups">
|
||||
<include refid="utility.paging-prefix" />
|
||||
SELECT A.GRP_ID
|
||||
, A.GRP_NM
|
||||
, A.DSCRP
|
||||
, A.REG_DT
|
||||
FROM TB_ACTION_GRP A
|
||||
<where>
|
||||
<if test="groupIDs != null">
|
||||
AND GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)
|
||||
</if>
|
||||
<if test="@org.egovframe.rte.fdl.string.EgovStringUtil@isNotEmpty(by) and @org.egovframe.rte.fdl.string.EgovStringUtil@isNotEmpty(term)">
|
||||
AND ${by} LIKE CONCAT('%', #{term}, '%')
|
||||
</if>
|
||||
</where>
|
||||
<include refid="utility.paging-suffix" />
|
||||
</sql>
|
||||
|
||||
<select id="getGroupList" parameterType="map" resultType="dataobject">
|
||||
/* 기능그룹 목록 조회(actionGroupMapper.getGroupList) */
|
||||
<include refid="selectGroups" />
|
||||
</select>
|
||||
|
||||
<select id="getGroups" parameterType="map" resultMap="groupRow">
|
||||
/* 기능그룹 가져오기(actionGroupMapper.getGroups) */
|
||||
<include refid="selectGroups" />
|
||||
</select>
|
||||
|
||||
<insert id="insertGroup" parameterType="cokr.xit.base.security.access.ActionGroup">
|
||||
/* 기능그룹 등록(actionGroupMapper.insertGroup) */
|
||||
INSERT INTO TB_ACTION_GRP (
|
||||
GRP_ID
|
||||
, GRP_NM
|
||||
, DSCRP
|
||||
, REG_DT
|
||||
) VALUES (
|
||||
#{id}
|
||||
, #{name}
|
||||
, #{description}
|
||||
,<include refid="utility.now" />
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateGroup" parameterType="cokr.xit.base.security.access.ActionGroup">
|
||||
/* 기능그룹 수정(actionGroupMapper.updateGroup) */
|
||||
UPDATE TB_ACTION_GRP SET
|
||||
GRP_NM = #{name}
|
||||
, DSCRP = #{description}
|
||||
WHERE GRP_ID = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="removeGroups" parameterType="map">
|
||||
/* 기능그룹 삭제(actionGroupMapper.removeGroups) */
|
||||
DELETE FROM TB_ACTION_GRP
|
||||
WHERE GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)
|
||||
</delete>
|
||||
|
||||
<select id="getActionList" parameterType="map" resultType="dataobject">
|
||||
/* 그룹별 기능 가져오기(actionGroupMapper.getActionList) */
|
||||
<include refid="utility.paging-prefix" />
|
||||
SELECT GRP_ID
|
||||
, ACTION
|
||||
, REG_DT
|
||||
, RGTR
|
||||
FROM TB_GRP_ACTION
|
||||
<if test="groupIDs != null">WHERE GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if>
|
||||
<include refid="utility.orderBy" />
|
||||
<include refid="utility.paging-suffix" />
|
||||
</select>
|
||||
|
||||
<insert id="addActions" parameterType="map">
|
||||
/* 그룹별 기능 추가(actionGroupMapper.addActions) */
|
||||
INSERT INTO TB_GRP_ACTION (GRP_ID, ACTION, REG_DT, RGTR)
|
||||
SELECT GRP_ID, ACTION,<include refid="utility.now" />, #{currentUser.id}
|
||||
FROM (<foreach collection="actions" item="action" separator="UNION">
|
||||
SELECT #{groupID} GRP_ID, #{action} ACTION FROM DUAL</foreach>
|
||||
) A
|
||||
WHERE NOT EXISTS (
|
||||
SELECT GRP_ID, ACTION
|
||||
FROM TB_GRP_ACTION B
|
||||
WHERE B.GRP_ID = A.GRP_ID
|
||||
AND B.ACTION = A.ACTION
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="removeActions" parameterType="map">
|
||||
/* 그룹별 기능 삭제(actionGroupMapper.removeActions) */
|
||||
DELETE FROM TB_GRP_ACTION
|
||||
<where>
|
||||
<if test="groupIDs != null">AND GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if>
|
||||
<if test="actions != null">AND ACTION IN (<foreach collection="actions" item="action" separator=",">#{action}</foreach>)</if>
|
||||
</where>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,296 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cokr.xit.base.code.dao.CodeMapper">
|
||||
|
||||
<resultMap id="categoryRow" type="cokr.xit.base.code.CodeCategory">
|
||||
<result property="id" column="CTGR_ID"/>
|
||||
<result property="name" column="CTGR_NM"/>
|
||||
<result property="description" column="DSCRP"/>
|
||||
<result property="createdAt" column="REG_DT"/>
|
||||
<result property="createdBy" column="RGTR"/>
|
||||
<result property="lastModified" column="MDFCN_DT"/>
|
||||
<result property="modifiedBy" column="MDFR"/>
|
||||
<result property="useYN" column="USE_YN"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="groupRow" type="cokr.xit.base.code.CodeGroup">
|
||||
<result property="id" column="GRP_ID"/>
|
||||
<result property="name" column="GRP_NM"/>
|
||||
<result property="categoryID" column="CTGR_ID"/>
|
||||
<result property="description" column="DSCRP"/>
|
||||
<result property="createdAt" column="REG_DT"/>
|
||||
<result property="createdBy" column="RGTR"/>
|
||||
<result property="lastModified" column="MDFCN_DT"/>
|
||||
<result property="modifiedBy" column="MDFR"/>
|
||||
<result property="useYN" column="USE_YN"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="codeRow" type="cokr.xit.base.code.CommonCode">
|
||||
<result property="groupID" column="GRP_ID"/>
|
||||
<result property="code" column="CODE"/>
|
||||
<result property="value" column="CODE_VAL"/>
|
||||
<result property="description" column="DSCRP"/>
|
||||
<result property="etc1" column="ETC_1"/>
|
||||
<result property="etc2" column="ETC_2"/>
|
||||
<result property="etc3" column="ETC_3"/>
|
||||
<result property="sortOrder" column="SRT_ORD"/>
|
||||
<result property="createdAt" column="REG_DT"/>
|
||||
<result property="createdBy" column="RGTR"/>
|
||||
<result property="lastModified" column="MDFCN_DT"/>
|
||||
<result property="modifiedBy" column="MDFR"/>
|
||||
<result property="useYN" column="USE_YN"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCategories">
|
||||
<include refid="utility.paging-prefix" />
|
||||
SELECT CTGR_ID
|
||||
, CTGR_NM
|
||||
, DSCRP
|
||||
, USE_YN
|
||||
, REG_DT
|
||||
, RGTR
|
||||
, MDFCN_DT
|
||||
, MDFR
|
||||
FROM TB_CODE_CTGR
|
||||
<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>
|
||||
<include refid="utility.orderBy" />
|
||||
<include refid="utility.paging-suffix" />
|
||||
</sql>
|
||||
|
||||
<select id="getCategoryList" parameterType="map" resultType="dataobject">
|
||||
/* 코드 카테고리 목록 조회(codeMapper.getCategoryList) */
|
||||
<include refid="selectCategories" />
|
||||
</select>
|
||||
|
||||
<select id="getCategories" parameterType="map" resultMap="categoryRow">
|
||||
/*코드 카테고리 가져오기(codeMapper.getCategories)*/
|
||||
<include refid="selectCategories" />
|
||||
</select>
|
||||
|
||||
<insert id="insertCategory" parameterType="map">
|
||||
/* 코드 카테고리 등록(codeMapper.insertCategory) */
|
||||
INSERT INTO TB_CODE_CTGR (
|
||||
CTGR_ID
|
||||
, CTGR_NM
|
||||
, DSCRP
|
||||
, REG_DT
|
||||
, RGTR
|
||||
, MDFCN_DT
|
||||
, MDFR
|
||||
, USE_YN
|
||||
) VALUES (
|
||||
#{category.id}
|
||||
, #{category.name}
|
||||
, #{category.description}
|
||||
,<include refid="utility.now" />
|
||||
, #{currentUser.id}
|
||||
,<include refid="utility.now" />
|
||||
, #{currentUser.id}
|
||||
, 'Y'
|
||||
)</insert>
|
||||
|
||||
<update id="updateCategory" parameterType="map">
|
||||
/* 코드 카테고리 수정(codeMapper.updateCategory) */
|
||||
UPDATE TB_CODE_CTGR SET
|
||||
CTGR_NM = #{category.name}
|
||||
, DSCRP = #{category.description}
|
||||
, MDFCN_DT =<include refid="utility.now" />
|
||||
, MDFR = #{currentUser.id}
|
||||
WHERE CTGR_ID = #{category.id}
|
||||
</update>
|
||||
|
||||
<delete id="removeCategories" parameterType="map">
|
||||
/* 코드 카테고리 제거(codeMapper.removeCategories) */
|
||||
UPDATE TB_CODE_CTGR SET
|
||||
MDFCN_DT =<include refid="utility.now" />
|
||||
, MDFR = #{currentUser.id}
|
||||
, USE_YN = 'N'
|
||||
<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" />
|
||||
SELECT GRP_ID
|
||||
, CTGR_ID
|
||||
, GRP_NM
|
||||
, DSCRP
|
||||
, USE_YN
|
||||
, REG_DT
|
||||
, RGTR
|
||||
, MDFCN_DT
|
||||
, MDFR
|
||||
FROM TB_CODE_GRP
|
||||
<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="groupIDs != null"> AND GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if></where>
|
||||
<include refid="utility.orderBy" />
|
||||
<include refid="utility.paging-suffix" /></sql>
|
||||
|
||||
<select id="getGroupList" parameterType="dataobject" resultType="dataobject">
|
||||
/* 코드그룹 목록 조회(codeMapper.getGroupList) */
|
||||
<include refid="selectGroups" />
|
||||
</select>
|
||||
|
||||
<select id="getGroups" parameterType="map" resultMap="groupRow">
|
||||
/* 코드그룹 가져오기(codeMapper.getGroups) */
|
||||
<include refid="selectGroups" />
|
||||
</select>
|
||||
|
||||
<insert id="insertGroup" parameterType="map">
|
||||
/* 코드그룹 등록(codeMapper.insertGroup) */
|
||||
INSERT INTO TB_CODE_GRP (
|
||||
GRP_ID
|
||||
, GRP_NM
|
||||
, CTGR_ID
|
||||
, DSCRP
|
||||
, REG_DT
|
||||
, RGTR
|
||||
, MDFCN_DT
|
||||
, MDFR
|
||||
, USE_YN
|
||||
) VALUES (
|
||||
#{group.id}
|
||||
, #{group.name}
|
||||
, #{group.categoryID}
|
||||
, #{group.description}
|
||||
,<include refid="utility.now" />
|
||||
, #{currentUser.id}
|
||||
,<include refid="utility.now" />
|
||||
, #{currentUser.id}
|
||||
, 'Y'
|
||||
)</insert>
|
||||
|
||||
<update id="updateGroup" parameterType="map">
|
||||
/* 코드그룹 수정(codeMapper.updateGroup) */
|
||||
UPDATE TB_CODE_GRP SET
|
||||
GRP_NM = #{group.name}
|
||||
, CTGR_ID = #{group.categoryID}
|
||||
, DSCRP = #{group.description}
|
||||
, MDFCN_DT =<include refid="utility.now" />
|
||||
, MDFR = #{currentUser.id}
|
||||
WHERE GRP_ID = #{group.id}
|
||||
</update>
|
||||
|
||||
<update id="removeGroups" parameterType="map">
|
||||
/*코드그룹 제거(codeMapper.removeGroups) */
|
||||
UPDATE TB_CODE_GRP SET
|
||||
USE_YN = 'N'
|
||||
, MDFCN_DT =<include refid="utility.now" />
|
||||
, MDFR = #{currentUser.id}
|
||||
<where>
|
||||
<if test="categoryIDs != null">CTGR_ID IN (<foreach collection="categoryIDs" item="categoryID" separator=",">#{categoryID}</foreach>)</if>
|
||||
<if test="groupIDs != null">GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<sql id="selectCodes">
|
||||
<include refid="utility.paging-prefix" />
|
||||
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
|
||||
<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='codes != null'> AND CODE IN (<foreach collection="codes" item="code" separator=",">#{code}</foreach>)</if>
|
||||
</where>
|
||||
<include refid="utility.orderBy" />
|
||||
<include refid="utility.paging-suffix" />
|
||||
</sql>
|
||||
|
||||
<select id="getCodeList" parameterType="map" resultType="dataobject">
|
||||
/* 그룹별 코드 가져오기(codeMapper.getCodeList) */
|
||||
<include refid="selectCodes" />
|
||||
</select>
|
||||
|
||||
<select id="getCodes" parameterType="map" resultMap="codeRow">
|
||||
/* 코드 가져오기(codeMapper.getCodes) */
|
||||
<include refid="selectCodes" />
|
||||
</select>
|
||||
|
||||
<insert id="insertCode" parameterType="map">
|
||||
/* 코드 등록(codeMapper.insertCode) */
|
||||
INSERT INTO TB_CMN_CODE (
|
||||
GRP_ID
|
||||
, CODE
|
||||
, CODE_VAL
|
||||
, DSCRP
|
||||
, ETC_1
|
||||
, ETC_2
|
||||
, ETC_3
|
||||
, SRT_ORD
|
||||
, REG_DT
|
||||
, RGTR
|
||||
, MDFCN_DT
|
||||
, MDFR
|
||||
, USE_YN
|
||||
) VALUES (
|
||||
#{code.groupID}
|
||||
, #{code.code}
|
||||
, #{code.value}
|
||||
, #{code.description}
|
||||
, #{code.etc1}
|
||||
, #{code.etc2}
|
||||
, #{code.etc3}
|
||||
, #{code.sortOrder}
|
||||
,<include refid="utility.now" />
|
||||
, #{currentUser.id}
|
||||
,<include refid="utility.now" />
|
||||
, #{currentUser.id}
|
||||
, 'Y'
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateCode" parameterType="map">
|
||||
/* 코드 수정(codeMapper.updateCode) */
|
||||
UPDATE TB_CMN_CODE SET
|
||||
CODE_VAL = #{code.value}
|
||||
, DSCRP = #{code.description}
|
||||
, ETC_1 = #{code.etc1}
|
||||
, ETC_2 = #{code.etc2}
|
||||
, ETC_3 = #{code.etc3}
|
||||
, MDFCN_DT =<include refid="utility.now" />
|
||||
, MDFR = #{currentUser.id}
|
||||
WHERE GRP_ID = #{code.groupID}
|
||||
AND CODE = #{code.code}
|
||||
</update>
|
||||
|
||||
<update id="reorderCodes" parameterType="map">
|
||||
/* 코드 정렬순서 변경(codeMapper.reorderCodes) */
|
||||
UPDATE TB_CMN_CODE SET
|
||||
SRT_ORD = CASE CODE<foreach collection="codes" item="code" index="index" separator=" ">
|
||||
WHEN #{code} THEN #{index}</foreach>
|
||||
ELSE SRT_ORD
|
||||
END
|
||||
, MDFCN_DT =<include refid="utility.now" />
|
||||
, MDFR = #{currentUser.id}
|
||||
WHERE GRP_ID = #{groupID}
|
||||
AND CODE IN (<foreach collection="codes" item="code" separator=",">#{code}</foreach>)
|
||||
</update>
|
||||
|
||||
<update id="removeCodes" parameterType="map">
|
||||
/* 코드 제거(codeMapper.removeCodes) */
|
||||
UPDATE TB_CMN_CODE SET
|
||||
MDFCN_DT =<include refid="utility.now" />
|
||||
, MDFR = #{currentUser.id}
|
||||
, USE_YN = 'N'
|
||||
<where>
|
||||
<if test="groupIDs != null">AND GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if>
|
||||
<if test="codes != null">AND CODE IN (<foreach collection="codes" item="code" separator=",">#{code}</foreach>) </if>
|
||||
</where>
|
||||
</update>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cokr.xit.base.menu.dao.MenuMapper">
|
||||
|
||||
<resultMap id="menuRow" type="cokr.xit.base.menu.Menu">
|
||||
<result property="id" column="MENU_NO"/>
|
||||
<result property="name" column="MENU_NM"/>
|
||||
<result property="programFilename" column="PGRM_FILE_NM"/>
|
||||
<result property="action" column="ACTION"/>
|
||||
<result property="description" column="DSCRP"/>
|
||||
<result property="parentID" column="PRNT_NO"/>
|
||||
<result property="imageName" column="IMG_NM"/>
|
||||
<result property="imageConf" column="IMG_CNF"/>
|
||||
<result property="sortOrder" column="SRT_ORD"/>
|
||||
<result property="createdAt" column="REG_DT"/>
|
||||
<result property="createdBy" column="RGTR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMenus">
|
||||
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
|
||||
<if test='menuID != null'>WHERE MENU_NO = #{menuID}</if>
|
||||
ORDER BY PRNT_NO, SRT_ORD, MENU_NO
|
||||
</sql>
|
||||
|
||||
<select id="getMenus" parameterType="map" resultMap="menuRow">
|
||||
/* 메뉴 정보 조회(menuMapper.getMenus) */
|
||||
<include refid="selectMenus" />
|
||||
</select>
|
||||
|
||||
<select id="getMenu" parameterType="int" resultMap="menuRow">
|
||||
/* 메뉴 가져오기(menuMapper.getMenu) */
|
||||
<include refid="selectMenus" />
|
||||
</select>
|
||||
|
||||
<insert id="insertMenu" parameterType="map">
|
||||
/* 메뉴 등록(menuMapper.insertMenu) */
|
||||
<selectKey order="BEFORE" resultType="map" keyColumn="NEW_NO,NEW_ORD" keyProperty="menu.id,menu.sortOrder">
|
||||
SELECT NEW_NO, NEW_ORD
|
||||
FROM (SELECT NVL(MAX(MENU_NO) + 1, 0) NEW_NO FROM TB_MENU) A,
|
||||
(<include refid="newSortOrder" />) B</selectKey>
|
||||
INSERT INTO TB_MENU (
|
||||
MENU_NO
|
||||
, MENU_NM
|
||||
, PRNT_NO
|
||||
, PGRM_FILE_NM
|
||||
, ACTION
|
||||
, DSCRP
|
||||
, IMG_NM
|
||||
, IMG_CNF
|
||||
, SRT_ORD
|
||||
, REG_DT
|
||||
, RGTR
|
||||
) VALUES (
|
||||
#{menu.id}
|
||||
, #{menu.name}
|
||||
, #{menu.parentID}
|
||||
, #{menu.programFilename}
|
||||
, #{menu.action}
|
||||
, #{menu.description}
|
||||
, #{menu.imageName}
|
||||
, #{menu.imageConf}
|
||||
, #{menu.sortOrder}
|
||||
,<include refid="utility.now" />
|
||||
, #{currentUser.id}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateMenu" parameterType="map">
|
||||
/* 메뉴 수정(menuMapper.updateMenu) */
|
||||
UPDATE TB_MENU SET
|
||||
MENU_NM = #{menu.name}
|
||||
, PGRM_FILE_NM = #{menu.programFilename}
|
||||
, ACTION = #{menu.action}
|
||||
, DSCRP = #{menu.description}
|
||||
, IMG_NM = #{menu.imageName}
|
||||
, IMG_CNF = #{menu.imageConf}
|
||||
WHERE MENU_NO = #{menu.id}</update>
|
||||
|
||||
<sql id="newSortOrder">
|
||||
SELECT NVL(MAX(SRT_ORD) + 1, 0) NEW_ORD FROM TB_MENU WHERE PRNT_NO = NVL(#{parentID}, NVL(#{menu.parentID}, 0))
|
||||
</sql>
|
||||
|
||||
<update id="moveMenus" parameterType="map">
|
||||
/* 메뉴 이동(menuMapper.moveMenus) */
|
||||
UPDATE TB_MENU SET
|
||||
PRNT_NO = #{parentID}
|
||||
, SRT_ORD = SRT_ORD + (<include refid="newSortOrder" />)
|
||||
WHERE MENU_NO IN (<foreach collection="menuIDs" item="menuID" separator=",">#{menuID}</foreach>)
|
||||
</update>
|
||||
|
||||
<update id="reorderMenus" parameterType="map">
|
||||
/* 메뉴 순서 변경(menuMapper.reorderMenus) */
|
||||
UPDATE TB_MENU SET
|
||||
SRT_ORD = CASE MENU_NO
|
||||
<foreach collection="menuIDs" item="menuID" index="index">WHEN #{menuID} THEN #{index}
|
||||
</foreach>
|
||||
ELSE MENU_NO END
|
||||
WHERE MENU_NO IN (<foreach collection="menuIDs" item="menuID" separator=",">#{menuID}</foreach>)
|
||||
</update>
|
||||
|
||||
<delete id="removeMenus" parameterType="map">
|
||||
/* 메뉴 제거(menuMapper.removeMenus) */
|
||||
DELETE FROM TB_MENU
|
||||
WHERE MENU_NO IN (<foreach collection="menuIDs" item="menuID" separator=",">#{menuID}</foreach>)
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,88 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cokr.xit.base.security.authentication.dao.PolicyMapper">
|
||||
|
||||
<resultMap id="policyRow" type="cokr.xit.base.security.authentication.AuthenticationPolicy">
|
||||
<result property="userID" column="USER_ID"/>
|
||||
<result property="ipAddress" column="IP_ADRS"/>
|
||||
<result property="duplicateYN" column="DPLCT_YN"/>
|
||||
<result property="limitYN" column="LIMIT_YN"/>
|
||||
<result property="createdBy" column="RGTR"/>
|
||||
<result property="createdAt" column="REG_DT"/>
|
||||
<result property="modifiedBy" column="MDFR"/>
|
||||
<result property="lastModified" column="MDFCN_DT"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="getPolicyList" parameterType="map" resultType="dataobject">
|
||||
/* 로그인 정책 목록 조회(policyMapper.getPolicyList) */
|
||||
<include refid="utility.paging-prefix"/>
|
||||
SELECT A.USER_ID
|
||||
, A.USER_NM
|
||||
, B.IP_ADRS
|
||||
, B.DPLCT_YN
|
||||
, B.LIMIT_YN
|
||||
, B.MDFR
|
||||
, B.MDFCN_DT
|
||||
FROM TB_USER A
|
||||
LEFT OUTER JOIN TB_LOGIN_POLICY B ON (A.USER_ID = B.USER_ID)
|
||||
<if test="term != null">WHERE A.${by} LIKE CONCAT('%', #{term}, '%')</if>
|
||||
<include refid="utility.orderBy" />
|
||||
<include refid="utility.paging-suffix"/>
|
||||
</select>
|
||||
|
||||
<select id="getPolicies" parameterType="map" resultMap="policyRow">
|
||||
/* 로그인 정책 가져오기(policyMapper.getPolicies) */
|
||||
SELECT USER_ID
|
||||
, IP_ADRS
|
||||
, DPLCT_YN
|
||||
, LIMIT_YN
|
||||
, REG_DT
|
||||
, RGTR
|
||||
, MDFCN_DT
|
||||
, MDFR
|
||||
FROM TB_LOGIN_POLICY
|
||||
<if test="userIDs != null">WHERE USER_ID IN (<foreach collection="userIDs" item="userID" separator=",">#{userID}</foreach>)</if>
|
||||
ORDER BY USER_ID
|
||||
</select>
|
||||
|
||||
<insert id="insertPolicy" parameterType="map">
|
||||
/* 로그인 정책 등록(policyMapper.insertPolicy) */
|
||||
INSERT INTO TB_LOGIN_POLICY (
|
||||
USER_ID
|
||||
, IP_ADRS
|
||||
, DPLCT_YN
|
||||
, LIMIT_YN
|
||||
, REG_DT
|
||||
, RGTR
|
||||
, MDFCN_DT
|
||||
, MDFR
|
||||
) VALUES (
|
||||
#{policy.userID}
|
||||
, #{policy.ipAddress}
|
||||
, #{policy.duplicateYN}
|
||||
, #{policy.limitYN}
|
||||
,<include refid="utility.now" />
|
||||
, #{currentUser.id}
|
||||
,<include refid="utility.now" />
|
||||
, #{currentUser.id}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updatePolicy" parameterType="map">
|
||||
/* 로그인 정책 수정(policyMapper.updatePolicy) */
|
||||
UPDATE TB_LOGIN_POLICY SET
|
||||
IP_ADRS = #{policy.ipAddress}
|
||||
, DPLCT_YN = #{policy.duplicateYN}
|
||||
, LIMIT_YN = #{policy.limitYN}
|
||||
, MDFR = #{currentUser.id}
|
||||
, MDFCN_DT =<include refid="utility.now" />
|
||||
WHERE USER_ID = #{policy.userID}
|
||||
</update>
|
||||
|
||||
<delete id="removePolicy" parameterType="map">
|
||||
/* 로그인 정책 삭제(policyMapper.removePolicy) */
|
||||
DELETE FROM TB_LOGIN_POLICY
|
||||
WHERE USER_ID IN (<foreach collection="userIDs" item="userID" separator=",">#{userID}</foreach>)
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue