no message
parent
9632754bdf
commit
fe8794c8a4
@ -1,78 +0,0 @@
|
|||||||
<?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.*
|
|
||||||
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="by != null and term != null">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) */
|
|
||||||
SELECT *
|
|
||||||
FROM TB_GRP_ACTION
|
|
||||||
<if test="groupIDs != null">WHERE GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if>
|
|
||||||
ORDER BY GRP_ID, ACTION
|
|
||||||
</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>
|
|
@ -1,145 +0,0 @@
|
|||||||
<?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.AuthorityMapper">
|
|
||||||
|
|
||||||
<resultMap id="authRow" type="cokr.xit.base.security.Authority">
|
|
||||||
<result property="type" column="AUTH_TYPE"/>
|
|
||||||
<result property="id" column="AUTH_ID"/>
|
|
||||||
<result property="name" column="AUTH_NM"/>
|
|
||||||
<result property="infoScope" column="INF_SCP"/>
|
|
||||||
<result property="userInfoScope" column="USER_INF_SCP"/>
|
|
||||||
<result property="description" column="DSCRP"/>
|
|
||||||
<result property="createdAt" column="REG_DT"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<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
|
|
||||||
SELECT 1 AUTH_TYPE, 'ROLE_USER' AUTH_ID, '시스템 사용자' AUTH_NM, '로그인한 사용자' DSCRP, 'self' INF_SCP, 'self' USER_INF_SCP,<include refid="utility.now"/>REG_DT UNION
|
|
||||||
SELECT 2 AUTH_TYPE, AUTH_ID, AUTH_NM, DSCRP, INF_SCP, USER_INF_SCP, REG_DT
|
|
||||||
FROM TB_AUTHORITY
|
|
||||||
) A
|
|
||||||
<where>
|
|
||||||
<if test="authIDs != null">AND AUTH_ID IN (<foreach collection="authIDs" item="authID" separator=",">#{authID}</foreach>)</if>
|
|
||||||
<if test="by != null and term != null">AND ${by} LIKE CONCAT('%', #{term}, '%')</if>
|
|
||||||
</where>
|
|
||||||
<include refid="utility.orderBy"/>
|
|
||||||
<include refid="utility.paging-suffix" /></sql>
|
|
||||||
|
|
||||||
<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>
|
|
||||||
|
|
||||||
<insert id="insertAuthority" parameterType="cokr.xit.base.security.Authority">/* 권한 등록(authorityMapper.insertAuthority) */
|
|
||||||
INSERT INTO TB_AUTHORITY (
|
|
||||||
AUTH_ID
|
|
||||||
, AUTH_NM
|
|
||||||
, DSCRP
|
|
||||||
, INF_SCP
|
|
||||||
, USER_INF_SCP
|
|
||||||
, REG_DT
|
|
||||||
) VALUES (
|
|
||||||
#{id}
|
|
||||||
, #{name}
|
|
||||||
, #{description}
|
|
||||||
, #{infoScope}
|
|
||||||
, #{userInfoScope}
|
|
||||||
,<include refid="utility.now" />
|
|
||||||
)</insert>
|
|
||||||
|
|
||||||
<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>
|
|
||||||
|
|
||||||
<delete id="removeAuthorities" parameterType="map">/* 권한 삭제(authorityMapper.removeAuthorities) */
|
|
||||||
DELETE FROM TB_AUTHORITY
|
|
||||||
WHERE AUTH_ID IN (<foreach collection="authIDs" item="authID" separator=",">#{authID}</foreach>)</delete>
|
|
||||||
|
|
||||||
<select id="getActionGroupList" parameterType="map" resultType="dataobject">/* 권한-기능그룹 가져오기(authorityMapper.getActionGroups) */
|
|
||||||
<include refid="utility.paging-prefix" />
|
|
||||||
SELECT *
|
|
||||||
FROM TB_AUTH_ACTION
|
|
||||||
<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>
|
|
||||||
|
|
||||||
<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">
|
|
||||||
SELECT #{authID} AUTH_ID, #{groupID} GRP_ID FROM DUAL</foreach>
|
|
||||||
) A
|
|
||||||
WHERE NOT EXISTS (
|
|
||||||
SELECT AUTH_ID, GRP_ID
|
|
||||||
FROM TB_AUTH_ACTION B
|
|
||||||
WHERE B.AUTH_ID = A.AUTH_ID
|
|
||||||
AND B.GRP_ID = A.GRP_ID
|
|
||||||
)</insert>
|
|
||||||
|
|
||||||
<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>
|
|
||||||
<if test="groupIDs != null">AND GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if>
|
|
||||||
</where>
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<select id="getActionList" resultType="dataobject">/* 권한-기능 가져오기(authorityMapper.getActionList) */
|
|
||||||
SELECT A.AUTH_ID
|
|
||||||
, A.GRP_ID
|
|
||||||
, C.ACTION
|
|
||||||
FROM TB_AUTH_ACTION A
|
|
||||||
, TB_ACTION_GRP B
|
|
||||||
, 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>
|
|
||||||
|
|
||||||
<sql id="selectAuthUser">
|
|
||||||
<include refid="utility.paging-prefix" />
|
|
||||||
SELECT A.*, USER_ACNT
|
|
||||||
FROM TB_AUTH_USER A
|
|
||||||
, TB_USER B
|
|
||||||
<where>
|
|
||||||
<if test="authIDs != null">AND AUTH_ID IN (<foreach collection="authIDs" item="authID" separator=",">#{authID}</foreach>)</if>
|
|
||||||
<if test="userIDs != null">AND A.USER_ID IN (<foreach collection="userIDs" item="userID" separator=",">#{userID}</foreach>)</if>
|
|
||||||
AND A.USER_ID = B.USER_ID
|
|
||||||
</where>
|
|
||||||
<include refid="utility.orderBy"/>
|
|
||||||
<include refid="utility.paging-suffix" /></sql>
|
|
||||||
|
|
||||||
<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>
|
|
||||||
|
|
||||||
<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">
|
|
||||||
SELECT #{authID} AUTH_ID, #{userID} USER_ID FROM DUAL</foreach>
|
|
||||||
) A
|
|
||||||
WHERE NOT EXISTS (
|
|
||||||
SELECT AUTH_ID, USER_ID
|
|
||||||
FROM TB_AUTH_USER B
|
|
||||||
WHERE B.AUTH_ID = A.AUTH_ID
|
|
||||||
AND B.USER_ID = A.USER_ID
|
|
||||||
)</insert>
|
|
||||||
|
|
||||||
<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>
|
|
||||||
<if test="userIDs != null">AND USER_ID IN (<foreach collection="userIDs" item="userID" separator=",">#{userID}</foreach>)</if>
|
|
||||||
</where>
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
</mapper>
|
|
@ -1,230 +0,0 @@
|
|||||||
<?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 *
|
|
||||||
FROM TB_CODE_CTGR
|
|
||||||
WHERE USE_YN = 'Y'
|
|
||||||
<if test="categoryIDs != null"> AND CTGR_ID IN (<foreach collection="categoryIDs" item="categoryID" separator=",">#{categoryID}</foreach>)</if>
|
|
||||||
<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 *
|
|
||||||
FROM TB_CODE_GRP
|
|
||||||
WHERE USE_YN = 'Y'
|
|
||||||
<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>
|
|
||||||
<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 *
|
|
||||||
FROM TB_CMN_CODE
|
|
||||||
WHERE USE_YN = 'Y'
|
|
||||||
<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>
|
|
||||||
<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>
|
|
@ -1,130 +0,0 @@
|
|||||||
<?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.file.dao.FileMapper">
|
|
||||||
|
|
||||||
<resultMap id="fileRow" type="cokr.xit.base.file.FileInfo">
|
|
||||||
<result property="id" column="FILE_ID"/>
|
|
||||||
<result property="infoType" column="INF_TYPE"/>
|
|
||||||
<result property="infoKey" column="INF_KEY"/>
|
|
||||||
<result property="subType" column="SUB_TYPE"/>
|
|
||||||
<result property="name" column="FILE_NM"/>
|
|
||||||
<result property="path" column="FILE_PATH"/>
|
|
||||||
<result property="url" column="URL"/>
|
|
||||||
<result property="mimeType" column="MIME_TYPE"/>
|
|
||||||
<result property="size" column="FILE_SIZE"/>
|
|
||||||
<result property="downloadCount" column="DNLD_CNT"/>
|
|
||||||
<result property="sortOrder" column="SRT_ORD"/>
|
|
||||||
<result property="createdAt" column="REG_DT"/>
|
|
||||||
<result property="createdBy" column="RGTR"/>
|
|
||||||
<result property="useYN" column="USE_YN"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="fileDirs">SELECT INF_TYPE
|
|
||||||
, CONCAT('files/', DIR, DATE_FORMAT(CURRENT_DATE, '/%Y/%m/%d/')) DIR
|
|
||||||
FROM (
|
|
||||||
SELECT '010' INF_TYPE, 'interface/attachment/smg' DIR UNION <!-- 국민 신문고 -->
|
|
||||||
SELECT '020' INF_TYPE, 'interface/attachment/saeol' DIR UNION <!-- 세올 -->
|
|
||||||
SELECT '030' INF_TYPE, 'interface/attachment/epost' DIR UNION <!-- epost -->
|
|
||||||
|
|
||||||
SELECT '100' INF_TYPE, 'attachment/violation' DIR UNION <!-- 단속 정보 -->
|
|
||||||
SELECT '110' INF_TYPE, 'attachment/opinion' DIR UNION <!-- 의견 진술 -->
|
|
||||||
SELECT '190' INF_TYPE, 'attachment/capture' DIR <!-- 캡쳐용 동영상 -->
|
|
||||||
) FILE_DIRS</sql>
|
|
||||||
|
|
||||||
<sql id="selectFiles">
|
|
||||||
<if test="fileIDs != null">
|
|
||||||
SELECT A.*, FILE_PATH URL
|
|
||||||
FROM TB_FILE A
|
|
||||||
WHERE FILE_ID IN (<foreach collection="fileIDs" item="fileID" separator=",">#{fileID}</foreach>)
|
|
||||||
ORDER BY FILE_ID</if>
|
|
||||||
<if test="fileIDs == null"><include refid="utility.paging-prefix" />
|
|
||||||
SELECT A.*, FILE_PATH URL
|
|
||||||
FROM TB_FILE A
|
|
||||||
<where>
|
|
||||||
<if test="infoType != null"> AND A.INF_TYPE = #{infoType}</if>
|
|
||||||
<if test="infoKeys != null"> AND INF_KEY IN (<foreach collection="infoKeys" item="infoKey" separator=",">#{infoKey}</foreach>)</if>
|
|
||||||
AND USE_YN = 'Y'
|
|
||||||
</where>
|
|
||||||
<include refid="utility.orderBy" />
|
|
||||||
<include refid="utility.paging-suffix" /></if></sql>
|
|
||||||
|
|
||||||
<select id="getFileList" parameterType="map" resultType="dataobject">/* 파일 목록 조회(fileMapper.getFileList) */
|
|
||||||
<include refid="selectFiles" /></select>
|
|
||||||
|
|
||||||
<select id="getFilesOf" parameterType="map" resultMap="fileRow">/* 파일 가져오기(fileMapper.getFilesOf) */
|
|
||||||
<include refid="selectFiles" /></select>
|
|
||||||
|
|
||||||
<select id="getFiles" parameterType="map" resultMap="fileRow">/* 파일 가져오기(fileMapper.getFiles) */
|
|
||||||
<include refid="selectFiles" /></select>
|
|
||||||
|
|
||||||
<insert id="insertFile" parameterType="map">/* 파일 등록(fileMapper.insertFile) */
|
|
||||||
<selectKey keyProperty="file.id,file.path" keyColumn="NEW_ID,PATH" resultType="map" order="BEFORE">
|
|
||||||
SELECT NEW_ID, CONCAT(DIR, NEW_ID, '.', #{file.extension}) PATH
|
|
||||||
FROM (
|
|
||||||
SELECT IFNULL(MAX(FILE_ID) + 1, CONCAT(THIS_DAY, '00001')) NEW_ID
|
|
||||||
FROM TB_FILE A, (<include refid="utility.selectThisDay" />) B
|
|
||||||
WHERE FILE_ID LIKE CONCAT(THIS_DAY, '%')
|
|
||||||
) T1, (
|
|
||||||
<include refid="fileDirs" />
|
|
||||||
WHERE INF_TYPE = #{file.infoType}
|
|
||||||
) T2</selectKey>
|
|
||||||
INSERT INTO TB_FILE (
|
|
||||||
FILE_ID
|
|
||||||
, INF_TYPE
|
|
||||||
, INF_KEY
|
|
||||||
, SUB_TYPE
|
|
||||||
, FILE_NM
|
|
||||||
, FILE_PATH
|
|
||||||
, MIME_TYPE
|
|
||||||
, FILE_SIZE
|
|
||||||
, DNLD_CNT
|
|
||||||
, SRT_ORD
|
|
||||||
, RGTR
|
|
||||||
, REG_DT
|
|
||||||
, USE_YN
|
|
||||||
) VALUES (
|
|
||||||
#{file.id}
|
|
||||||
, #{file.infoType}
|
|
||||||
, #{file.infoKey}
|
|
||||||
, #{file.subType}
|
|
||||||
, #{file.name}
|
|
||||||
, #{file.path}
|
|
||||||
, #{file.mimeType}
|
|
||||||
, #{file.size}
|
|
||||||
, #{file.downloadCount}
|
|
||||||
, #{file.sortOrder}
|
|
||||||
, #{currentUser.id}
|
|
||||||
,<include refid="utility.now" />
|
|
||||||
, 'Y'
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="reorder" parameterType="map">/* 파일 순서 변경(fileMapper.reorder) */
|
|
||||||
UPDATE TB_FILE SET
|
|
||||||
SRT_ORD = CASE FILE_ID
|
|
||||||
<foreach collection="fileIDs" item="fileID" index="index" separator=" ">WHEN #{fileID} THEN #{index}
|
|
||||||
</foreach>
|
|
||||||
ELSE SRT_ORD END
|
|
||||||
WHERE FILE_ID IN (<foreach collection="fileIDs" item="fileID" separator=",">#{fileID}</foreach>)</update>
|
|
||||||
|
|
||||||
<update id="updateDownloadCount" parameterType="map">/* 다운로드 횟수 증가(fileMapper.updateDownloadCount) */
|
|
||||||
UPDATE TB_FILE SET
|
|
||||||
DNLD_CNT = DNLD_CNT + 1
|
|
||||||
WHERE USE_YN = 'Y'
|
|
||||||
AND FILE_ID IN (<foreach collection="fileIDs" item="fileID" separator=",">#{fileID}</foreach>)</update>
|
|
||||||
|
|
||||||
<update id="removeFiles" parameterType="map">/* 파일 제거(fileMapper.removeFiles) */
|
|
||||||
UPDATE TB_FILE SET
|
|
||||||
USE_YN = 'N'
|
|
||||||
WHERE USE_YN = 'Y'
|
|
||||||
<if test="fileIDs != null"> AND FILE_ID IN (<foreach collection="fileIDs" item="fileID" separator=",">#{fileID}</foreach>)</if>
|
|
||||||
<if test="infoKeys != null">
|
|
||||||
AND INF_TYPE = #{infoType}
|
|
||||||
AND INF_KEY IN (<foreach collection="infoKeys" item="infoKey" separator=",">#{infoKey}</foreach>)</if></update>
|
|
||||||
|
|
||||||
<delete id="deleteFiles" parameterType="map">/* 파일 삭제(fileMapper.deleteFiles) */
|
|
||||||
DELETE FROM TB_FILE
|
|
||||||
<if test="fileIDs != null">WHERE FILE_ID IN (<foreach collection="fileIDs" item="fileID" separator=",">#{fileID}</foreach>)</if>
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
</mapper>
|
|
@ -1,94 +0,0 @@
|
|||||||
<?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.*
|
|
||||||
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 IFNULL(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 IFNULL(MAX(SRT_ORD) + 1, 0) NEW_ORD FROM TB_MENU WHERE PRNT_NO = IFNULL(#{parentID}, IFNULL(#{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>
|
|
@ -1,70 +0,0 @@
|
|||||||
<?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
|
|
||||||
, USER_NM
|
|
||||||
, IP_ADRS
|
|
||||||
, DPLCT_YN
|
|
||||||
, LIMIT_YN
|
|
||||||
, MDFR
|
|
||||||
, 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 *
|
|
||||||
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>
|
|
@ -1,135 +0,0 @@
|
|||||||
<?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="program">
|
|
||||||
|
|
||||||
<resultMap id="programRow" type="cokr.xit.base.menu.Program">
|
|
||||||
<result property="filename" column="PGRM_FILE_NM"/>
|
|
||||||
<result property="location" column="PGRM_FILE_PATH"/>
|
|
||||||
<result property="name" column="PGRM_NM"/>
|
|
||||||
<result property="description" column="DSCRP"/>
|
|
||||||
<result property="url" column="URL"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<resultMap id="reqRow" type="cokr.xit.base.menu.ChangeRequest">
|
|
||||||
<result property="filename" column="PGRM_FILE_NM"/>
|
|
||||||
<result property="id" column="REQ_ID"/>
|
|
||||||
<result property="subject" column="SUBJECT"/>
|
|
||||||
<result property="requestorID" column="REQ_USER"/>
|
|
||||||
<result property="requestDate" column="REQ_DT"/>
|
|
||||||
<result property="requestDetail" column="REQ_CNTNT"/>
|
|
||||||
<result property="processorID" column="PRSC_USER"/>
|
|
||||||
<result property="processDate" column="PRCS_DT"/>
|
|
||||||
<result property="processDetail" column="PRCS_CNTNT"/>
|
|
||||||
<result property="status" column="PRCS_STATUS"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="selectPrograms">
|
|
||||||
<include refid="utility.paging-prefix"/>
|
|
||||||
SELECT A.*
|
|
||||||
FROM TB_PROGRAM A
|
|
||||||
<where>
|
|
||||||
<if test="by != null and term != null">${by} LIKE CONCAT('%', #{term}, '%')</if>
|
|
||||||
<if test='filenames != null'>PGRM_FILE_NM IN (<foreach collection="filenames" item="filename" separator=",">#{filename}</foreach>)</if>
|
|
||||||
</where>
|
|
||||||
ORDER BY<if test='by != null'>${by}</if><if test='by == null'>PGRM_FILE_NM</if>
|
|
||||||
<include refid="utility.paging-suffix"/></sql>
|
|
||||||
|
|
||||||
<select id="getProgramList" parameterType="map" resultType="dataobject">/* 프로그램 목록 조회(program.getProgramList) */
|
|
||||||
<include refid="selectPrograms"/></select>
|
|
||||||
|
|
||||||
<select id="getPrograms" parameterType="map" resultMap="programRow">/* 프로그램 가져오기(program.getPrograms) */
|
|
||||||
<include refid="selectPrograms"/></select>
|
|
||||||
|
|
||||||
<insert id="insertProgram" parameterType="cokr.xit.base.menu.Program">/* 프로그램 등록(program.insertProgram) */
|
|
||||||
INSERT INTO TB_PROGRAM (
|
|
||||||
PGRM_FILE_NM
|
|
||||||
, PGRM_FILE_PATH
|
|
||||||
, PGRM_NM
|
|
||||||
, DSCRP
|
|
||||||
, URL
|
|
||||||
) VALUES (
|
|
||||||
#{filename}
|
|
||||||
, #{location}
|
|
||||||
, #{name}
|
|
||||||
, #{description}
|
|
||||||
, #{url}
|
|
||||||
)</insert>
|
|
||||||
|
|
||||||
<update id="updateProgram" parameterType="cokr.xit.base.menu.Program">/* 프로그램 수정(program.updateProgram) */
|
|
||||||
UPDATE TB_PROGRAM SET
|
|
||||||
PGRM_FILE_PATH = #{location}
|
|
||||||
, PGRM_NM = #{name}
|
|
||||||
, DSCRP = #{description}
|
|
||||||
, URL = #{url}
|
|
||||||
WHERE PGRM_FILE_NM = #{filename}</update>
|
|
||||||
|
|
||||||
<delete id="removePrograms" parameterType="map">/* 프로그램 삭제(program.removePrograms) */
|
|
||||||
DELETE FROM TB_PROGRAM
|
|
||||||
WHERE PGRM_FILE_NM IN (<foreach collection="filenames" item="filename" separator=",">#{filename}</foreach>)</delete>
|
|
||||||
|
|
||||||
<delete id="clearPrograms" parameterType="map">/* 프로그램 비우기(program.clearPrograms) */
|
|
||||||
DELETE FROM TB_PROGRAM
|
|
||||||
WHERE PGRM_FILE_NM NOT IN (SELECT PGRM_FILE_NM FROM TB_MENU)</delete>
|
|
||||||
|
|
||||||
<sql id="selectRequests">
|
|
||||||
SELECT A.*
|
|
||||||
FROM TB_PGRM_CHNG_REQ A
|
|
||||||
<where>
|
|
||||||
<if test='fromReqDate != null'>REQ_DT >= #{fromReqDate}</if>
|
|
||||||
<if test='toReqDate != null'>REQ_DT <= #{toReqDate}</if>
|
|
||||||
<if test="by != null and term != null">${by} LIKE CONCAT('%', #{term}, '%')</if>
|
|
||||||
<if test='filenames != null'>PGRM_FILE_NAME IN (<foreach collection="filenames" item="filename" separator=",">#{filename}</foreach>)</if>
|
|
||||||
<if test='reqIDs != null'>REQ_ID IN (<foreach collection="reqIDs" item="reqID" separator=",">#{reqID}</foreach>)</if>
|
|
||||||
</where>
|
|
||||||
ORDER BY PGRM_FILE_NM,<if test='by != null'>${by}</if><if test='by == null'>REQ_ID DESC</if></sql>
|
|
||||||
|
|
||||||
<select id="getRequestList" parameterType="map" resultType="dataobject">/* 변경요청 목록 조회(program.getRequestList) */
|
|
||||||
<include refid="selectRequests" /></select>
|
|
||||||
|
|
||||||
<select id="getRequests" parameterType="map" resultType="dataobject">/* 프로그램별 변경요청 목록 조회(program.getRequests) */
|
|
||||||
<include refid="selectRequests" /></select>
|
|
||||||
|
|
||||||
<insert id="insertRequest" parameterType="cokr.xit.base.menu.ChangeRequest">/* 프로그램 변경요청 등록(program.insertRequest) */
|
|
||||||
INSERT INTO TB_PGRM_CHNG_REQ (
|
|
||||||
PGRM_FILE_NM
|
|
||||||
, REQ_ID
|
|
||||||
, SUBJECT
|
|
||||||
, REQ_USER
|
|
||||||
, REQ_DT
|
|
||||||
, REQ_CNTNT
|
|
||||||
, PRSC_USER
|
|
||||||
, PRCS_DT
|
|
||||||
, PRCS_CNTNT
|
|
||||||
, PRCS_STATUS
|
|
||||||
) VALUES (
|
|
||||||
#{filename}
|
|
||||||
, #{id}
|
|
||||||
, #{subject}
|
|
||||||
, #{requestorID}
|
|
||||||
, #{requestDate}
|
|
||||||
, #{requestDetail}
|
|
||||||
, #{processorID}
|
|
||||||
, #{processDate}
|
|
||||||
, #{processDetail}
|
|
||||||
, #{status}
|
|
||||||
)</insert>
|
|
||||||
|
|
||||||
<update id="updateRequest" parameterType="cokr.xit.base.menu.ChangeRequest">/* 프로그램 변경요청 수정(program.updateRequest) */
|
|
||||||
UPDATE TB_PGRM_CHNG_REQ SET
|
|
||||||
SUBJECT = #{subject}
|
|
||||||
, REQ_USER = #{requestorID}
|
|
||||||
, REQ_DT = #{requestDate}
|
|
||||||
, REQ_CNTNT = #{requestDetail}
|
|
||||||
, PRSC_USER = #{processorID}
|
|
||||||
, PRCS_DT = #{processDate}
|
|
||||||
, PRCS_CNTNT = #{processDetail}
|
|
||||||
WHERE PGRM_FILE_NM = #{filename}
|
|
||||||
AND REQ_ID = #{id}</update>
|
|
||||||
|
|
||||||
<update id="setRequestStatus" parameterType="map">/* 프로그램 변경요청 상태 변경(program.setRequestStatus) */
|
|
||||||
UPDATE TB_PGRM_CHNG_REQ SET
|
|
||||||
PRCS_STATUS = #{status}
|
|
||||||
WHERE PGRM_FILE_NM = #{filename}
|
|
||||||
AND REQ_ID = #{id}</update>
|
|
||||||
|
|
||||||
</mapper>
|
|
@ -1,234 +0,0 @@
|
|||||||
<?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.user.dao.UserMapper">
|
|
||||||
|
|
||||||
<resultMap id="userRow" type="cokr.xit.base.user.ManagedUser">
|
|
||||||
<result property="id" column="USER_ID"/>
|
|
||||||
<result property="account" column="USER_ACNT"/>
|
|
||||||
<result property="name" column="USER_NM"/>
|
|
||||||
<result property="password" column="PASSWD"/>
|
|
||||||
<result property="passwordHint" column="PASSWD_HINT"/>
|
|
||||||
<result property="passwordHintAnswer" column="PASSWD_NSR"/>
|
|
||||||
<result property="empNo" column="EMP_NO"/>
|
|
||||||
<result property="residentRegNo" column="RSDNT_NO"/>
|
|
||||||
<result property="gender" column="GENDER"/>
|
|
||||||
<result property="birthday" column="BRDT"/>
|
|
||||||
<result property="areaNo" column="AREA_NO"/>
|
|
||||||
<result property="zipCode" column="ZIP"/>
|
|
||||||
<result property="address" column="ADDR"/>
|
|
||||||
<result property="addressDetail" column="DADDR"/>
|
|
||||||
<result property="phoneNo" column="TELNO"/>
|
|
||||||
<result property="mobilePhoneNo" column="MBL_TELNO"/>
|
|
||||||
<result property="faxNo" column="FXNO"/>
|
|
||||||
<result property="emailAddress" column="EML_ADRS"/>
|
|
||||||
<result property="positionName" column="POS_NM"/>
|
|
||||||
<result property="groupID" column="GRP_ID"/>
|
|
||||||
<result property="orgID" column="ORG_ID"/>
|
|
||||||
<result property="deptCode" column="DEPT_CD"/>
|
|
||||||
<result property="institute" column="NSTT_CD"/>
|
|
||||||
<result property="certificateDn" column="CRTFC_DN"/>
|
|
||||||
<result property="locked" column="LOCK_YN"/>
|
|
||||||
<result property="lockCount" column="LOCK_CNT"/>
|
|
||||||
<result property="lockedDate" column="LOCK_DT"/>
|
|
||||||
<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"/>
|
|
||||||
<result property="status" column="STTS"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="selectUsers"><include refid="utility.paging-prefix" />
|
|
||||||
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
|
|
||||||
, DEPT_CD
|
|
||||||
, (CASE
|
|
||||||
WHEN A.DEPT_CD = 'default'
|
|
||||||
THEN '기본 부서'
|
|
||||||
ELSE (SELECT DEPT_NM FROM TB_DEPT_INFO 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_INFO WHERE INST_CD = A.NSTT_CD)
|
|
||||||
END
|
|
||||||
) AS NSTT_NM
|
|
||||||
, CRTFC_DN
|
|
||||||
, LOCK_YN
|
|
||||||
, LOCK_CNT
|
|
||||||
, LOCK_DT
|
|
||||||
, REG_DT
|
|
||||||
, STTS
|
|
||||||
FROM TB_USER A
|
|
||||||
<where><if test="by != null and term != null">AND ${by} LIKE CONCAT('%', #{term}, '%')</if>
|
|
||||||
<if test="userIDs != null">USER_ID IN (<foreach collection="userIDs" item="userID" separator=",">#{userID}</foreach>)</if>
|
|
||||||
<if test="status == null and userIDs == null">AND STTS != 'D'</if>
|
|
||||||
<if test="status != null">AND STTS = #{status}</if></where>
|
|
||||||
<include refid="utility.orderBy" />
|
|
||||||
<include refid="utility.paging-suffix" /></sql>
|
|
||||||
|
|
||||||
<select id="getUserList" parameterType="map" resultType="dataobject">/* 사용자 목록 조회(userMapper.getUserList) */
|
|
||||||
<include refid="selectUsers"/></select>
|
|
||||||
|
|
||||||
<select id="getUsers" parameterType="map" resultMap="userRow">/* 사용자 가져오기(userMapper.getUsers) */
|
|
||||||
<include refid="selectUsers"/></select>
|
|
||||||
|
|
||||||
<select id="getUser" parameterType="map" resultMap="userRow">/* 사용자 계정 가져오기(userMapper.getUser) */
|
|
||||||
SELECT *
|
|
||||||
FROM TB_USER
|
|
||||||
WHERE USER_ACNT = #{account}
|
|
||||||
AND NSTT_CD = #{institute}</select>
|
|
||||||
|
|
||||||
<insert id="insertUser" parameterType="cokr.xit.base.user.ManagedUser">
|
|
||||||
<selectKey resultType="string" keyProperty="id" keyColumn="NEW_ID" order="BEFORE">SELECT LPAD(IFNULL(MAX(USER_ID) + 1, 1), 10, '0') NEW_ID FROM TB_USER</selectKey>
|
|
||||||
/* 사용자 정보 등록(userMapper.insertUser) */
|
|
||||||
INSERT INTO TB_USER (
|
|
||||||
USER_ID
|
|
||||||
, USER_ACNT
|
|
||||||
, USER_NM
|
|
||||||
, PASSWD
|
|
||||||
, 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
|
|
||||||
, NSTT_CD
|
|
||||||
, CRTFC_DN
|
|
||||||
, LOCK_YN
|
|
||||||
, LOCK_CNT
|
|
||||||
, LOCK_DT
|
|
||||||
, REG_DT
|
|
||||||
, RGTR
|
|
||||||
, MDFCN_DT
|
|
||||||
, MDFR
|
|
||||||
, USE_YN
|
|
||||||
, STTS
|
|
||||||
) VALUES (
|
|
||||||
#{id}
|
|
||||||
, #{account}
|
|
||||||
, #{name}
|
|
||||||
, #{password}
|
|
||||||
, #{passwordHint}
|
|
||||||
, #{passwordHintAnswer}
|
|
||||||
, #{empNo}
|
|
||||||
, #{residentRegNo}
|
|
||||||
, #{gender}
|
|
||||||
, #{birthday}
|
|
||||||
, #{areaNo}
|
|
||||||
, #{zipCode}
|
|
||||||
, #{address}
|
|
||||||
, #{addressDetail}
|
|
||||||
, #{phoneNo}
|
|
||||||
, #{mobilePhoneNo}
|
|
||||||
, #{faxNo}
|
|
||||||
, #{emailAddress}
|
|
||||||
, #{positionName}
|
|
||||||
, #{groupID}
|
|
||||||
, #{orgID}
|
|
||||||
, #{institute}
|
|
||||||
, #{certificateDn}
|
|
||||||
, 'N'
|
|
||||||
, 0
|
|
||||||
, NULL
|
|
||||||
,<include refid="utility.now" />
|
|
||||||
, #{createdBy}
|
|
||||||
,<include refid="utility.now" />
|
|
||||||
, #{createdBy}
|
|
||||||
, 'Y'
|
|
||||||
, #{status}
|
|
||||||
)</insert>
|
|
||||||
|
|
||||||
<update id="updateUser" parameterType="cokr.xit.base.user.ManagedUser">/* 사용자 정보 수정(userMapper.updateUser) */
|
|
||||||
UPDATE TB_USER SET
|
|
||||||
USER_NM = #{name}
|
|
||||||
, PASSWD_HINT = #{passwordHint}
|
|
||||||
, PASSWD_NSR = #{passwordHintAnswer}
|
|
||||||
, EMP_NO = #{empNo}
|
|
||||||
, RSDNT_NO = #{residentRegNo}
|
|
||||||
, GENDER = #{gender}
|
|
||||||
, BRDT = #{birthday}
|
|
||||||
, AREA_NO = #{areaNo}
|
|
||||||
, ZIP = #{zipCode}
|
|
||||||
, ADDR = #{address}
|
|
||||||
, DADDR = #{addressDetail}
|
|
||||||
, TELNO = #{phoneNo}
|
|
||||||
, MBL_TELNO = #{mobilePhoneNo}
|
|
||||||
, FXNO = #{faxNo}
|
|
||||||
, EML_ADRS = #{emailAddress}
|
|
||||||
, POS_NM = #{positionName}
|
|
||||||
, GRP_ID = #{groupID}
|
|
||||||
, ORG_ID = #{orgID}
|
|
||||||
, NSTT_CD = #{institute}
|
|
||||||
, DEPT_CD = #{deptCode}
|
|
||||||
, CRTFC_DN = #{certificateDn}
|
|
||||||
, MDFCN_DT =<include refid="utility.now" />
|
|
||||||
, MDFR = #{modifiedBy}
|
|
||||||
WHERE USER_ID = #{id}</update>
|
|
||||||
|
|
||||||
<update id="changePassword" parameterType="map">/* 비밀번호 변경(userMapper.changePassword) */
|
|
||||||
UPDATE TB_USER SET
|
|
||||||
PASSWD = CASE USER_ID<foreach collection="userPasswords" item="userPassword" separator=" ">
|
|
||||||
WHEN #{userPassword.userID} THEN #{userPassword.password}</foreach>
|
|
||||||
ELSE PASSWD END
|
|
||||||
, MDFCN_DT =<include refid="utility.now" />
|
|
||||||
, MDFR = #{currentUser.id}
|
|
||||||
WHERE USER_ID IN (<foreach collection="userIDs" item="userID" separator=",">#{userID}</foreach>)
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<update id="lockUsers" parameterType="map">/* 사용자 잠김 해제(userMapper.lockUsers) */
|
|
||||||
UPDATE TB_USER SET
|
|
||||||
<if test='lock == true'> LOCK_YN = 'Y'
|
|
||||||
, LOCK_CNT = LOCK_CNT + 1
|
|
||||||
, LOCK_DT =<include refid="utility.now" /></if>
|
|
||||||
<if test='lock == false'> LOCK_YN = 'N'
|
|
||||||
, LOCK_CNT = 0
|
|
||||||
, LOCK_DT = NULL</if>
|
|
||||||
, MDFCN_DT =<include refid="utility.now" />
|
|
||||||
, MDFR = #{currentUser.id}
|
|
||||||
WHERE USER_ID IN (<foreach collection="userIDs" item="userID" separator=",">#{userID}</foreach>)
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<update id="setStatus" parameterType="map">/* 사용자 상태 변경(userMapper.setStatus) */
|
|
||||||
UPDATE TB_USER SET
|
|
||||||
STTS = #{status}
|
|
||||||
<if test='"D" == status'>, USE_YN = 'N'</if>
|
|
||||||
, MDFCN_DT =<include refid="utility.now" />
|
|
||||||
, MDFR = #{currentUser.id}
|
|
||||||
WHERE USER_ID IN (<foreach collection="userIDs" item="userID" separator=",">#{userID}</foreach>)
|
|
||||||
AND STTS != #{status}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
</mapper>
|
|
Loading…
Reference in New Issue