|
|
|
@ -12,7 +12,8 @@
|
|
|
|
|
<result property="createdAt" column="REG_DT"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectAuthorities"><include refid="utility.paging-prefix" />
|
|
|
|
|
<sql id="selectAuthorities">
|
|
|
|
|
<include refid="utility.paging-prefix" />
|
|
|
|
|
SELECT * FROM (
|
|
|
|
|
SELECT 0 AUTH_TYPE, 'ROLE_ADMIN' AUTH_ID, '시스템 관리자' AUTH_NM, '시스템 관리자' DSCRP, 'all' INF_SCP, 'all' USER_INF_SCP,<include refid="utility.now"/>REG_DT UNION
|
|
|
|
|
SELECT 1 AUTH_TYPE, 'ROLE_ANONYMOUS' AUTH_ID, '익명 사용자' AUTH_NM, '모든 사용자' DSCRP, 'none' INF_SCP, 'none' USER_INF_SCP,<include refid="utility.now"/>REG_DT UNION
|
|
|
|
@ -25,15 +26,21 @@ SELECT * FROM (
|
|
|
|
|
<if test="by != null and term != null">AND ${by} LIKE CONCAT('%', #{term}, '%')</if>
|
|
|
|
|
</where>
|
|
|
|
|
<include refid="utility.orderBy"/>
|
|
|
|
|
<include refid="utility.paging-suffix" /></sql>
|
|
|
|
|
<include refid="utility.paging-suffix" />
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="getAuthorityList" parameterType="map" resultType="dataobject">/* 권한 목록 조회(authorityMapper.getAuthorityList) */
|
|
|
|
|
<include refid="selectAuthorities" /></select>
|
|
|
|
|
<select id="getAuthorityList" parameterType="map" resultType="dataobject">
|
|
|
|
|
/* 권한 목록 조회(authorityMapper.getAuthorityList) */
|
|
|
|
|
<include refid="selectAuthorities" />
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getAuthorities" parameterType="map" resultMap="authRow">/* 권한 가져오기(authorityMapper.getAuthorities) */
|
|
|
|
|
<include refid="selectAuthorities" /></select>
|
|
|
|
|
<select id="getAuthorities" parameterType="map" resultMap="authRow">
|
|
|
|
|
/* 권한 가져오기(authorityMapper.getAuthorities) */
|
|
|
|
|
<include refid="selectAuthorities" />
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertAuthority" parameterType="cokr.xit.base.security.Authority">/* 권한 등록(authorityMapper.insertAuthority) */
|
|
|
|
|
<insert id="insertAuthority" parameterType="cokr.xit.base.security.Authority">
|
|
|
|
|
/* 권한 등록(authorityMapper.insertAuthority) */
|
|
|
|
|
INSERT INTO TB_AUTHORITY (
|
|
|
|
|
AUTH_ID
|
|
|
|
|
, AUTH_NM
|
|
|
|
@ -48,30 +55,38 @@ INSERT INTO TB_AUTHORITY (
|
|
|
|
|
, #{infoScope}
|
|
|
|
|
, #{userInfoScope}
|
|
|
|
|
,<include refid="utility.now" />
|
|
|
|
|
)</insert>
|
|
|
|
|
)
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateAuthority" parameterType="cokr.xit.base.security.Authority">/* 권한 수정(authorityMapper.updateAuthority) */
|
|
|
|
|
<update id="updateAuthority" parameterType="cokr.xit.base.security.Authority">
|
|
|
|
|
/* 권한 수정(authorityMapper.updateAuthority) */
|
|
|
|
|
UPDATE TB_AUTHORITY SET
|
|
|
|
|
AUTH_NM = #{name}
|
|
|
|
|
, DSCRP = #{description}
|
|
|
|
|
, INF_SCP = #{infoScope}
|
|
|
|
|
, USER_INF_SCP = #{userInfoScope}
|
|
|
|
|
WHERE AUTH_ID = #{id}</update>
|
|
|
|
|
WHERE AUTH_ID = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="removeAuthorities" parameterType="map">/* 권한 삭제(authorityMapper.removeAuthorities) */
|
|
|
|
|
<delete id="removeAuthorities" parameterType="map">
|
|
|
|
|
/* 권한 삭제(authorityMapper.removeAuthorities) */
|
|
|
|
|
DELETE FROM TB_AUTHORITY
|
|
|
|
|
WHERE AUTH_ID IN (<foreach collection="authIDs" item="authID" separator=",">#{authID}</foreach>)</delete>
|
|
|
|
|
WHERE AUTH_ID IN (<foreach collection="authIDs" item="authID" separator=",">#{authID}</foreach>)
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<select id="getActionGroupList" parameterType="map" resultType="dataobject">/* 권한-기능그룹 가져오기(authorityMapper.getActionGroups) */
|
|
|
|
|
<select id="getActionGroupList" parameterType="map" resultType="dataobject">
|
|
|
|
|
/* 권한-기능그룹 가져오기(authorityMapper.getActionGroups) */
|
|
|
|
|
<include refid="utility.paging-prefix" />
|
|
|
|
|
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
|
|
|
|
|
<if test="authIDs != null">WHERE AUTH_ID IN (<foreach collection="authIDs" item="authID" separator=",">#{authID}</foreach>)</if>
|
|
|
|
|
ORDER BY AUTH_ID, GRP_ID
|
|
|
|
|
<include refid="utility.paging-suffix" /></select>
|
|
|
|
|
<include refid="utility.paging-suffix" />
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="addActionGroups" parameterType="map">/* 권한-기능그룹 추가(authorityMapper.addActionGroups) */
|
|
|
|
|
<insert id="addActionGroups" parameterType="map">
|
|
|
|
|
/* 권한-기능그룹 추가(authorityMapper.addActionGroups) */
|
|
|
|
|
INSERT INTO TB_AUTH_ACTION (AUTH_ID, GRP_ID, REG_DT)
|
|
|
|
|
SELECT AUTH_ID, GRP_ID,<include refid="utility.now" />
|
|
|
|
|
FROM (<foreach collection="groupIDs" item="groupID" separator=" UNION">
|
|
|
|
@ -84,7 +99,8 @@ SELECT AUTH_ID, GRP_ID,<include refid="utility.now" />
|
|
|
|
|
AND B.GRP_ID = A.GRP_ID
|
|
|
|
|
)</insert>
|
|
|
|
|
|
|
|
|
|
<delete id="removeActionGroups" parameterType="map">/* 권한-기능그룹 삭제(authorityMapper.removeActionGroups) */
|
|
|
|
|
<delete id="removeActionGroups" parameterType="map">
|
|
|
|
|
/* 권한-기능그룹 삭제(authorityMapper.removeActionGroups) */
|
|
|
|
|
DELETE FROM TB_AUTH_ACTION
|
|
|
|
|
<where>
|
|
|
|
|
<if test="authIDs != null">AND AUTH_ID IN (<foreach collection="authIDs" item="authID" separator=",">#{authID}</foreach>)</if>
|
|
|
|
@ -92,7 +108,8 @@ DELETE FROM TB_AUTH_ACTION
|
|
|
|
|
</where>
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<select id="getActionList" resultType="dataobject">/* 권한-기능 가져오기(authorityMapper.getActionList) */
|
|
|
|
|
<select id="getActionList" resultType="dataobject">
|
|
|
|
|
/* 권한-기능 가져오기(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</select>
|
|
|
|
|
ORDER BY A.AUTH_ID, A.GRP_ID, C.ACTION
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<sql id="selectAuthUser">
|
|
|
|
|
<include refid="utility.paging-prefix" />
|
|
|
|
@ -122,15 +140,21 @@ SELECT A.*
|
|
|
|
|
AND A.USER_ID = B.USER_ID
|
|
|
|
|
</where>
|
|
|
|
|
<include refid="utility.orderBy"/>
|
|
|
|
|
<include refid="utility.paging-suffix" /></sql>
|
|
|
|
|
<include refid="utility.paging-suffix" />
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="getUserList" parameterType="map" resultType="dataobject">/* 권한-사용자 가져오기(authorityMapper.getUserList) */
|
|
|
|
|
<include refid="selectAuthUser" /></select>
|
|
|
|
|
<select id="getUserList" parameterType="map" resultType="dataobject">
|
|
|
|
|
/* 권한-사용자 가져오기(authorityMapper.getUserList) */
|
|
|
|
|
<include refid="selectAuthUser" />
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getUserAuths" parameterType="map" resultType="dataobject">/* 사용자-권한 가져오기(authorityMapper.getUserAuths) */
|
|
|
|
|
<include refid="selectAuthUser" /></select>
|
|
|
|
|
<select id="getUserAuths" parameterType="map" resultType="dataobject">
|
|
|
|
|
/* 사용자-권한 가져오기(authorityMapper.getUserAuths) */
|
|
|
|
|
<include refid="selectAuthUser" />
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="addUsers" parameterType="map">/* 권한-사용자 추가(authorityMapper.addUsers) */
|
|
|
|
|
<insert id="addUsers" parameterType="map">
|
|
|
|
|
/* 권한-사용자 추가(authorityMapper.addUsers) */
|
|
|
|
|
INSERT INTO TB_AUTH_USER (AUTH_ID, USER_ID, REG_DT)
|
|
|
|
|
SELECT AUTH_ID, USER_ID,<include refid="utility.now" />
|
|
|
|
|
FROM (<foreach collection="userIDs" item="userID" separator="UNION">
|
|
|
|
@ -141,9 +165,11 @@ SELECT AUTH_ID, USER_ID,<include refid="utility.now" />
|
|
|
|
|
FROM TB_AUTH_USER B
|
|
|
|
|
WHERE B.AUTH_ID = A.AUTH_ID
|
|
|
|
|
AND B.USER_ID = A.USER_ID
|
|
|
|
|
)</insert>
|
|
|
|
|
)
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<delete id="removeUsers" parameterType="map">/* 권한-사용자 삭제(authorityMapper.removeUsers) */
|
|
|
|
|
<delete id="removeUsers" parameterType="map">
|
|
|
|
|
/* 권한-사용자 삭제(authorityMapper.removeUsers) */
|
|
|
|
|
DELETE FROM TB_AUTH_USER
|
|
|
|
|
<where>
|
|
|
|
|
<if test="authIDs != null">AND AUTH_ID IN (<foreach collection="authIDs" item="authID" separator=",">#{authID}</foreach>)</if>
|
|
|
|
|