|
|
@ -41,21 +41,37 @@
|
|
|
|
<result property="useYN" column="USE_YN"/>
|
|
|
|
<result property="useYN" column="USE_YN"/>
|
|
|
|
</resultMap>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
<sql id="selectCategories"><include refid="utility.paging-prefix" />
|
|
|
|
<sql id="selectCategories">
|
|
|
|
SELECT *
|
|
|
|
<include refid="utility.paging-prefix" />
|
|
|
|
|
|
|
|
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="categoryIDs != null"> AND CTGR_ID IN (<foreach collection="categoryIDs" item="categoryID" separator=",">#{categoryID}</foreach>)</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>
|
|
|
|
<include refid="utility.orderBy" />
|
|
|
|
<include refid="utility.orderBy" />
|
|
|
|
<include refid="utility.paging-suffix" /></sql>
|
|
|
|
<include refid="utility.paging-suffix" />
|
|
|
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getCategoryList" parameterType="map" resultType="dataobject">/* 코드 카테고리 목록 조회(codeMapper.getCategoryList) */
|
|
|
|
<select id="getCategoryList" parameterType="map" resultType="dataobject">
|
|
|
|
<include refid="selectCategories" /></select>
|
|
|
|
/* 코드 카테고리 목록 조회(codeMapper.getCategoryList) */
|
|
|
|
|
|
|
|
<include refid="selectCategories" />
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getCategories" parameterType="map" resultMap="categoryRow">/*코드 카테고리 가져오기(codeMapper.getCategories)*/
|
|
|
|
<select id="getCategories" parameterType="map" resultMap="categoryRow">
|
|
|
|
<include refid="selectCategories" /></select>
|
|
|
|
/*코드 카테고리 가져오기(codeMapper.getCategories)*/
|
|
|
|
|
|
|
|
<include refid="selectCategories" />
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertCategory" parameterType="map">/* 코드 카테고리 등록(codeMapper.insertCategory) */
|
|
|
|
<insert id="insertCategory" parameterType="map">
|
|
|
|
|
|
|
|
/* 코드 카테고리 등록(codeMapper.insertCategory) */
|
|
|
|
INSERT INTO TB_CODE_CTGR (
|
|
|
|
INSERT INTO TB_CODE_CTGR (
|
|
|
|
CTGR_ID
|
|
|
|
CTGR_ID
|
|
|
|
, CTGR_NM
|
|
|
|
, CTGR_NM
|
|
|
@ -76,23 +92,36 @@ INSERT INTO TB_CODE_CTGR (
|
|
|
|
, 'Y'
|
|
|
|
, 'Y'
|
|
|
|
)</insert>
|
|
|
|
)</insert>
|
|
|
|
|
|
|
|
|
|
|
|
<update id="updateCategory" parameterType="map">/* 코드 카테고리 수정(codeMapper.updateCategory) */
|
|
|
|
<update id="updateCategory" parameterType="map">
|
|
|
|
|
|
|
|
/* 코드 카테고리 수정(codeMapper.updateCategory) */
|
|
|
|
UPDATE TB_CODE_CTGR SET
|
|
|
|
UPDATE TB_CODE_CTGR SET
|
|
|
|
CTGR_NM = #{category.name}
|
|
|
|
CTGR_NM = #{category.name}
|
|
|
|
, DSCRP = #{category.description}
|
|
|
|
, DSCRP = #{category.description}
|
|
|
|
, MDFCN_DT =<include refid="utility.now" />
|
|
|
|
, MDFCN_DT =<include refid="utility.now" />
|
|
|
|
, MDFR = #{currentUser.id}
|
|
|
|
, MDFR = #{currentUser.id}
|
|
|
|
WHERE CTGR_ID = #{category.id}</update>
|
|
|
|
WHERE CTGR_ID = #{category.id}
|
|
|
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
<delete id="removeCategories" parameterType="map">/* 코드 카테고리 제거(codeMapper.removeCategories) */
|
|
|
|
<delete id="removeCategories" parameterType="map">
|
|
|
|
|
|
|
|
/* 코드 카테고리 제거(codeMapper.removeCategories) */
|
|
|
|
UPDATE TB_CODE_CTGR SET
|
|
|
|
UPDATE TB_CODE_CTGR SET
|
|
|
|
MDFCN_DT =<include refid="utility.now" />
|
|
|
|
MDFCN_DT =<include refid="utility.now" />
|
|
|
|
, MDFR = #{currentUser.id}
|
|
|
|
, MDFR = #{currentUser.id}
|
|
|
|
, USE_YN = 'N'
|
|
|
|
, USE_YN = 'N'
|
|
|
|
<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">
|
|
|
|
SELECT *
|
|
|
|
<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
|
|
|
|
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>
|
|
|
@ -100,13 +129,18 @@ SELECT *
|
|
|
|
<include refid="utility.orderBy" />
|
|
|
|
<include refid="utility.orderBy" />
|
|
|
|
<include refid="utility.paging-suffix" /></sql>
|
|
|
|
<include refid="utility.paging-suffix" /></sql>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getGroupList" parameterType="dataobject" resultType="dataobject">/* 코드그룹 목록 조회(codeMapper.getGroupList) */
|
|
|
|
<select id="getGroupList" parameterType="dataobject" resultType="dataobject">
|
|
|
|
<include refid="selectGroups" /></select>
|
|
|
|
/* 코드그룹 목록 조회(codeMapper.getGroupList) */
|
|
|
|
|
|
|
|
<include refid="selectGroups" />
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getGroups" parameterType="map" resultMap="groupRow">/* 코드그룹 가져오기(codeMapper.getGroups) */
|
|
|
|
<select id="getGroups" parameterType="map" resultMap="groupRow">
|
|
|
|
<include refid="selectGroups" /></select>
|
|
|
|
/* 코드그룹 가져오기(codeMapper.getGroups) */
|
|
|
|
|
|
|
|
<include refid="selectGroups" />
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertGroup" parameterType="map">/* 코드그룹 등록(codeMapper.insertGroup) */
|
|
|
|
<insert id="insertGroup" parameterType="map">
|
|
|
|
|
|
|
|
/* 코드그룹 등록(codeMapper.insertGroup) */
|
|
|
|
INSERT INTO TB_CODE_GRP (
|
|
|
|
INSERT INTO TB_CODE_GRP (
|
|
|
|
GRP_ID
|
|
|
|
GRP_ID
|
|
|
|
, GRP_NM
|
|
|
|
, GRP_NM
|
|
|
@ -129,16 +163,19 @@ INSERT INTO TB_CODE_GRP (
|
|
|
|
, 'Y'
|
|
|
|
, 'Y'
|
|
|
|
)</insert>
|
|
|
|
)</insert>
|
|
|
|
|
|
|
|
|
|
|
|
<update id="updateGroup" parameterType="map">/* 코드그룹 수정(codeMapper.updateGroup) */
|
|
|
|
<update id="updateGroup" parameterType="map">
|
|
|
|
|
|
|
|
/* 코드그룹 수정(codeMapper.updateGroup) */
|
|
|
|
UPDATE TB_CODE_GRP SET
|
|
|
|
UPDATE TB_CODE_GRP SET
|
|
|
|
GRP_NM = #{group.name}
|
|
|
|
GRP_NM = #{group.name}
|
|
|
|
, CTGR_ID = #{group.categoryID}
|
|
|
|
, CTGR_ID = #{group.categoryID}
|
|
|
|
, DSCRP = #{group.description}
|
|
|
|
, DSCRP = #{group.description}
|
|
|
|
, MDFCN_DT =<include refid="utility.now" />
|
|
|
|
, MDFCN_DT =<include refid="utility.now" />
|
|
|
|
, MDFR = #{currentUser.id}
|
|
|
|
, MDFR = #{currentUser.id}
|
|
|
|
WHERE GRP_ID = #{group.id}</update>
|
|
|
|
WHERE GRP_ID = #{group.id}
|
|
|
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
<update id="removeGroups" parameterType="map">/*코드그룹 제거(codeMapper.removeGroups) */
|
|
|
|
<update id="removeGroups" parameterType="map">
|
|
|
|
|
|
|
|
/*코드그룹 제거(codeMapper.removeGroups) */
|
|
|
|
UPDATE TB_CODE_GRP SET
|
|
|
|
UPDATE TB_CODE_GRP SET
|
|
|
|
USE_YN = 'N'
|
|
|
|
USE_YN = 'N'
|
|
|
|
, MDFCN_DT =<include refid="utility.now" />
|
|
|
|
, MDFCN_DT =<include refid="utility.now" />
|
|
|
@ -146,24 +183,46 @@ UPDATE TB_CODE_GRP SET
|
|
|
|
<where>
|
|
|
|
<where>
|
|
|
|
<if test="categoryIDs != null">CTGR_ID IN (<foreach collection="categoryIDs" item="categoryID" separator=",">#{categoryID}</foreach>)</if>
|
|
|
|
<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>
|
|
|
|
<if test="groupIDs != null">GRP_ID IN (<foreach collection="groupIDs" item="groupID" separator=",">#{groupID}</foreach>)</if>
|
|
|
|
</where></update>
|
|
|
|
</where>
|
|
|
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
<sql id="selectCodes"><include refid="utility.paging-prefix" />
|
|
|
|
<sql id="selectCodes">
|
|
|
|
SELECT *
|
|
|
|
<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
|
|
|
|
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>
|
|
|
|
<if test='codes != null'> AND CODE IN (<foreach collection="codes" item="code" separator=",">#{code}</foreach>)</if></where>
|
|
|
|
<if test='codes != null'> AND CODE IN (<foreach collection="codes" item="code" separator=",">#{code}</foreach>)</if>
|
|
|
|
|
|
|
|
</where>
|
|
|
|
<include refid="utility.orderBy" />
|
|
|
|
<include refid="utility.orderBy" />
|
|
|
|
<include refid="utility.paging-suffix" /></sql>
|
|
|
|
<include refid="utility.paging-suffix" />
|
|
|
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getCodeList" parameterType="map" resultType="dataobject">/* 그룹별 코드 가져오기(codeMapper.getCodeList) */
|
|
|
|
<select id="getCodeList" parameterType="map" resultType="dataobject">
|
|
|
|
<include refid="selectCodes" /></select>
|
|
|
|
/* 그룹별 코드 가져오기(codeMapper.getCodeList) */
|
|
|
|
|
|
|
|
<include refid="selectCodes" />
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getCodes" parameterType="map" resultMap="codeRow">/* 코드 가져오기(codeMapper.getCodes) */
|
|
|
|
<select id="getCodes" parameterType="map" resultMap="codeRow">
|
|
|
|
<include refid="selectCodes" /></select>
|
|
|
|
/* 코드 가져오기(codeMapper.getCodes) */
|
|
|
|
|
|
|
|
<include refid="selectCodes" />
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<insert id="insertCode" parameterType="map">/* 코드 등록(codeMapper.insertCode) */
|
|
|
|
<insert id="insertCode" parameterType="map">
|
|
|
|
|
|
|
|
/* 코드 등록(codeMapper.insertCode) */
|
|
|
|
INSERT INTO TB_CMN_CODE (
|
|
|
|
INSERT INTO TB_CMN_CODE (
|
|
|
|
GRP_ID
|
|
|
|
GRP_ID
|
|
|
|
, CODE
|
|
|
|
, CODE
|
|
|
@ -192,9 +251,11 @@ INSERT INTO TB_CMN_CODE (
|
|
|
|
,<include refid="utility.now" />
|
|
|
|
,<include refid="utility.now" />
|
|
|
|
, #{currentUser.id}
|
|
|
|
, #{currentUser.id}
|
|
|
|
, 'Y'
|
|
|
|
, 'Y'
|
|
|
|
)</insert>
|
|
|
|
)
|
|
|
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
|
|
<update id="updateCode" parameterType="map">/* 코드 수정(codeMapper.updateCode) */
|
|
|
|
<update id="updateCode" parameterType="map">
|
|
|
|
|
|
|
|
/* 코드 수정(codeMapper.updateCode) */
|
|
|
|
UPDATE TB_CMN_CODE SET
|
|
|
|
UPDATE TB_CMN_CODE SET
|
|
|
|
CODE_VAL = #{code.value}
|
|
|
|
CODE_VAL = #{code.value}
|
|
|
|
, DSCRP = #{code.description}
|
|
|
|
, DSCRP = #{code.description}
|
|
|
@ -204,9 +265,11 @@ UPDATE TB_CMN_CODE SET
|
|
|
|
, MDFCN_DT =<include refid="utility.now" />
|
|
|
|
, MDFCN_DT =<include refid="utility.now" />
|
|
|
|
, MDFR = #{currentUser.id}
|
|
|
|
, MDFR = #{currentUser.id}
|
|
|
|
WHERE GRP_ID = #{code.groupID}
|
|
|
|
WHERE GRP_ID = #{code.groupID}
|
|
|
|
AND CODE = #{code.code}</update>
|
|
|
|
AND CODE = #{code.code}
|
|
|
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
<update id="reorderCodes" parameterType="map">/* 코드 정렬순서 변경(codeMapper.reorderCodes) */
|
|
|
|
<update id="reorderCodes" parameterType="map">
|
|
|
|
|
|
|
|
/* 코드 정렬순서 변경(codeMapper.reorderCodes) */
|
|
|
|
UPDATE TB_CMN_CODE SET
|
|
|
|
UPDATE TB_CMN_CODE SET
|
|
|
|
SRT_ORD = CASE CODE<foreach collection="codes" item="code" index="index" separator=" ">
|
|
|
|
SRT_ORD = CASE CODE<foreach collection="codes" item="code" index="index" separator=" ">
|
|
|
|
WHEN #{code} THEN #{index}</foreach>
|
|
|
|
WHEN #{code} THEN #{index}</foreach>
|
|
|
@ -215,9 +278,11 @@ UPDATE TB_CMN_CODE SET
|
|
|
|
, MDFCN_DT =<include refid="utility.now" />
|
|
|
|
, MDFCN_DT =<include refid="utility.now" />
|
|
|
|
, MDFR = #{currentUser.id}
|
|
|
|
, MDFR = #{currentUser.id}
|
|
|
|
WHERE GRP_ID = #{groupID}
|
|
|
|
WHERE GRP_ID = #{groupID}
|
|
|
|
AND CODE IN (<foreach collection="codes" item="code" separator=",">#{code}</foreach>)</update>
|
|
|
|
AND CODE IN (<foreach collection="codes" item="code" separator=",">#{code}</foreach>)
|
|
|
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
<update id="removeCodes" parameterType="map">/* 코드 제거(codeMapper.removeCodes) */
|
|
|
|
<update id="removeCodes" parameterType="map">
|
|
|
|
|
|
|
|
/* 코드 제거(codeMapper.removeCodes) */
|
|
|
|
UPDATE TB_CMN_CODE SET
|
|
|
|
UPDATE TB_CMN_CODE SET
|
|
|
|
MDFCN_DT =<include refid="utility.now" />
|
|
|
|
MDFCN_DT =<include refid="utility.now" />
|
|
|
|
, MDFR = #{currentUser.id}
|
|
|
|
, MDFR = #{currentUser.id}
|
|
|
@ -225,6 +290,7 @@ UPDATE TB_CMN_CODE SET
|
|
|
|
<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>
|
|
|
|
<if test="codes != null">AND CODE IN (<foreach collection="codes" item="code" separator=",">#{code}</foreach>) </if>
|
|
|
|
<if test="codes != null">AND CODE IN (<foreach collection="codes" item="code" separator=",">#{code}</foreach>) </if>
|
|
|
|
</where></update>
|
|
|
|
</where>
|
|
|
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
</mapper>
|