Merge branch 'JIWOO'
This commit is contained in:
commit
f07a71b704
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN"
|
||||||
|
"http://www.ibatis.com/dtd/sql-map-config-2.dtd">
|
||||||
|
|
||||||
|
<sqlMapConfig>
|
||||||
|
<sqlMap resource="egovframework/sqlmap/let/sec/ram/EgovAuthorManage_SQL_Oracle.xml"/>
|
||||||
|
<sqlMap resource="egovframework/sqlmap/let/sec/ram/EgovAuthorRoleManage_SQL_Oracle.xml"/>
|
||||||
|
</sqlMapConfig>
|
||||||
@ -0,0 +1,177 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||||
|
|
||||||
|
<sqlMap namespace="AuthorManage">
|
||||||
|
|
||||||
|
<typeAlias alias="egovMap" type="egovframework.rte.psl.dataaccess.util.EgovMap"/>
|
||||||
|
<typeAlias alias="AuthorManageVO" type="kcc.let.sec.ram.service.AuthorManageVO"/>
|
||||||
|
<typeAlias alias="AuthorManage" type="kcc.let.sec.ram.service.AuthorManage"/>
|
||||||
|
|
||||||
|
<resultMap id="author" class="kcc.let.sec.ram.service.AuthorManageVO">
|
||||||
|
<result property="authorCode" column="AUTHOR_CODE" columnIndex="1"/>
|
||||||
|
<result property="authorNm" column="AUTHOR_NM" columnIndex="2"/>
|
||||||
|
<result property="authorDc" column="AUTHOR_DC" columnIndex="3"/>
|
||||||
|
<result property="authorCreatDe" column="AUTHOR_CREAT_DE" columnIndex="4"/>
|
||||||
|
<result property="sortNum" column="SORT_NUM" columnIndex="5"/> <!-- 정렬을 위한 임시 파라미터 -->
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="authorHrc" class="kcc.let.sec.ram.service.AuthorManageVO">
|
||||||
|
<result property="authorCode" column="AUTHOR_CODE" columnIndex="1"/>
|
||||||
|
<result property="authorNm" column="AUTHOR_NM" columnIndex="2"/>
|
||||||
|
<result property="authorDc" column="AUTHOR_DC" columnIndex="3"/>
|
||||||
|
<result property="sortNum" column="SORT_NUM" columnIndex="4"/>
|
||||||
|
<result property="authorCreatDe" column="AUTHOR_CREAT_DE" columnIndex="5"/>
|
||||||
|
<result property="authorPRole" column="PARNTS_ROLE" columnIndex="6"/>
|
||||||
|
<result property="authorCRole" column="CHLDRN_ROLE" columnIndex="7"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="authorManageDAO.selectAuthorList" parameterClass="AuthorManageVO" resultMap="author">
|
||||||
|
SELECT *
|
||||||
|
FROM (
|
||||||
|
SELECT
|
||||||
|
AUTHOR_CODE, AUTHOR_NM, AUTHOR_DC,
|
||||||
|
AUTHOR_CREAT_DE ,
|
||||||
|
SORT_NUM ,
|
||||||
|
ROWNUM AS rnum
|
||||||
|
FROM LETTNAUTHORINFO
|
||||||
|
<![CDATA[
|
||||||
|
WHERE ROWNUM <= (#firstIndex# + #recordCountPerPage#)
|
||||||
|
]]>
|
||||||
|
<isNotEmpty property="authorSet">
|
||||||
|
AND AUTHOR_SET = #authorSet#
|
||||||
|
</isNotEmpty>
|
||||||
|
<isEqual prepend="AND" property="searchCondition" compareValue="1">
|
||||||
|
AUTHOR_NM LIKE CONCAT('%' , #searchKeyword#, '%')
|
||||||
|
</isEqual>
|
||||||
|
|
||||||
|
)
|
||||||
|
WHERE rnum > #firstIndex#
|
||||||
|
ORDER BY 1
|
||||||
|
<isNotEmpty property="searchSortCnd">
|
||||||
|
,$searchSortCnd$
|
||||||
|
</isNotEmpty>
|
||||||
|
<isNotEmpty property="searchSortOrd">
|
||||||
|
$searchSortOrd$
|
||||||
|
</isNotEmpty>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="authorManageDAO.insertAuthor" parameterClass="AuthorManage">
|
||||||
|
<![CDATA[
|
||||||
|
INSERT INTO LETTNAUTHORINFO
|
||||||
|
( AUTHOR_CODE
|
||||||
|
, AUTHOR_NM
|
||||||
|
, AUTHOR_DC
|
||||||
|
, SORT_NUM
|
||||||
|
, AUTHOR_CREAT_DE )
|
||||||
|
VALUES ( #authorCode#
|
||||||
|
, #authorNm#
|
||||||
|
, #authorDc#
|
||||||
|
, (SELECT CAST(MAX(sort_num)+1 AS VARCHAR(2)) FROM LETTNAUTHORINFO)
|
||||||
|
, DATE_FORMAT(NOW(), '%Y-%m-%d'))
|
||||||
|
]]>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="authorManageDAO.updateAuthor" parameterClass="AuthorManage">
|
||||||
|
<![CDATA[
|
||||||
|
UPDATE LETTNAUTHORINFO
|
||||||
|
SET AUTHOR_NM=#authorNm#
|
||||||
|
, AUTHOR_DC=#authorDc#
|
||||||
|
WHERE AUTHOR_CODE=#authorCode#
|
||||||
|
]]>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<delete id="authorManageDAO.deleteAuthor" parameterClass="AuthorManage">
|
||||||
|
<![CDATA[
|
||||||
|
DELETE FROM LETTNAUTHORINFO
|
||||||
|
WHERE AUTHOR_CODE=#authorCode#
|
||||||
|
]]>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="authorManageDAO.selectAuthor" resultMap="author">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT AUTHOR_CODE, AUTHOR_NM, AUTHOR_DC, AUTHOR_CREAT_DE,
|
||||||
|
DATE_FORMAT(AUTHOR_CREAT_DE , '%Y-%m-%d') SORT_NUM
|
||||||
|
FROM LETTNAUTHORINFO
|
||||||
|
WHERE AUTHOR_CODE=#authorCode#
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="authorManageDAO.selectAuthorListTotCnt" parameterClass="AuthorManageVO" resultClass="int">
|
||||||
|
SELECT COUNT(*) totcnt
|
||||||
|
FROM LETTNAUTHORINFO
|
||||||
|
WHERE 1=1
|
||||||
|
<isEqual prepend="AND" property="searchCondition" compareValue="1">
|
||||||
|
AUTHOR_NM LIKE CONCAT('%' , #searchKeyword#, '%')
|
||||||
|
</isEqual>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="authorManageDAO.selectAuthorAllList" parameterClass="AuthorManageVO" resultMap="author">
|
||||||
|
SELECT
|
||||||
|
AUTHOR_CODE, AUTHOR_NM, AUTHOR_DC, AUTHOR_CREAT_DE,
|
||||||
|
SORT_NUM
|
||||||
|
FROM LETTNAUTHORINFO
|
||||||
|
ORDER BY SORT_NUM DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="authorManageDAO.selectAuthorHrcList" parameterClass="AuthorManageVO" resultMap="authorHrc">
|
||||||
|
SELECT
|
||||||
|
A.AUTHOR_CODE, A.AUTHOR_NM, A.AUTHOR_DC, A.AUTHOR_CREAT_DE, A.SORT_NUM, B.PARNTS_ROLE, B.CHLDRN_ROLE
|
||||||
|
FROM LETTNAUTHORINFO A
|
||||||
|
LEFT OUTER JOIN LETTNROLES_HIERARCHY B
|
||||||
|
ON A.AUTHOR_CODE = B.PARNTS_ROLE
|
||||||
|
ORDER BY A.SORT_NUM DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 추가 LETTNAUTHORINFO sort + update -->
|
||||||
|
<update id="authorManageDAO.updateAuthorSort" parameterClass="AuthorManage">
|
||||||
|
UPDATE LETTNAUTHORINFO
|
||||||
|
SET
|
||||||
|
<isEqual property="wkMode" compareValue="I">
|
||||||
|
SORT_NUM = SORT_NUM+1
|
||||||
|
</isEqual>
|
||||||
|
<isEqual property="wkMode" compareValue="D">
|
||||||
|
SORT_NUM = SORT_NUM-1
|
||||||
|
</isEqual>
|
||||||
|
WHERE SORT_NUM > #sortNum#
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 추가 LETTNROLES_HIERARCHY 입력 -->
|
||||||
|
<insert id="authorManageDAO.insertLettnrolesHierarchy" parameterClass="AuthorManage">
|
||||||
|
<![CDATA[
|
||||||
|
INSERT INTO LETTNROLES_HIERARCHY
|
||||||
|
( PARNTS_ROLE
|
||||||
|
, CHLDRN_ROLE)
|
||||||
|
VALUES ( #parntsRole#
|
||||||
|
, #chldrnRole#)
|
||||||
|
]]>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- 추가 LETTNROLES_HIERARCHY PARNTS_ROLE update -->
|
||||||
|
<update id="authorManageDAO.updateLettnrolesHierarchyCCrole" parameterClass="AuthorManage">
|
||||||
|
<![CDATA[
|
||||||
|
UPDATE LETTNROLES_HIERARCHY
|
||||||
|
SET CHLDRN_ROLE = #parntsRole#
|
||||||
|
WHERE CHLDRN_ROLE = #chldrnRole#
|
||||||
|
]]>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 추가 LETTNROLES_HIERARCHY CHLDRN_ROLE update -->
|
||||||
|
<update id="authorManageDAO.updateLettnrolesHierarchyPCrole" parameterClass="AuthorManage">
|
||||||
|
<![CDATA[
|
||||||
|
UPDATE LETTNROLES_HIERARCHY
|
||||||
|
SET CHLDRN_ROLE = #chldrnRole#
|
||||||
|
WHERE PARNTS_ROLE = #parntsRole#
|
||||||
|
]]>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- 추가 LETTNROLES_HIERARCHY ROLE delete -->
|
||||||
|
<delete id="authorManageDAO.deleteLettnrolesHierarchy" parameterClass="AuthorManage">
|
||||||
|
<![CDATA[
|
||||||
|
DELETE FROM LETTNROLES_HIERARCHY
|
||||||
|
WHERE PARNTS_ROLE = #parntsRole#
|
||||||
|
AND CHLDRN_ROLE = #chldrnRole#
|
||||||
|
]]>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</sqlMap>
|
||||||
@ -0,0 +1,118 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-2.dtd">
|
||||||
|
|
||||||
|
<sqlMap namespace="AuthorRoleManage">
|
||||||
|
|
||||||
|
<typeAlias alias="egovMap" type="egovframework.rte.psl.dataaccess.util.EgovMap"/>
|
||||||
|
<typeAlias alias="authorRoleManageVO" type="kcc.let.sec.ram.service.AuthorRoleManageVO"/>
|
||||||
|
<typeAlias alias="authorRoleManage" type="kcc.let.sec.ram.service.AuthorRoleManage"/>
|
||||||
|
|
||||||
|
<resultMap id="authorRole" class="kcc.let.sec.ram.service.AuthorRoleManageVO">
|
||||||
|
<result property="roleCode" column="ROLE_CODE" columnIndex="1"/>
|
||||||
|
<result property="roleNm" column="ROLE_NM" columnIndex="2"/>
|
||||||
|
<result property="rolePtn" column="ROLE_PTTRN" columnIndex="3"/>
|
||||||
|
<result property="roleDc" column="ROLE_DC" columnIndex="4"/>
|
||||||
|
<result property="roleTyp" column="ROLE_TY" columnIndex="5"/>
|
||||||
|
<result property="roleSort" column="ROLE_SORT" columnIndex="6"/>
|
||||||
|
<result property="authorCode" column="AUTHOR_CODE" columnIndex="7"/>
|
||||||
|
<result property="regYn" column="REG_YN" columnIndex="8"/>
|
||||||
|
<result property="creatDt" column="CREAT_DT" columnIndex="9"/>
|
||||||
|
<result property="tempSortNum" column="tempSortNum" columnIndex="10"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- <select id="authorRoleManageDAO.selectAuthorRoleList" parameterClass="authorRoleManageVO" resultMap="authorRole">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT A.ROLE_CODE,
|
||||||
|
A.ROLE_NM,
|
||||||
|
A.ROLE_PTTRN,
|
||||||
|
A.ROLE_DC,
|
||||||
|
A.ROLE_TY,
|
||||||
|
A.ROLE_SORT,
|
||||||
|
B.AUTHOR_CODE,
|
||||||
|
DATE_FORMAT(B.CREAT_DT , '%Y-%m-%d') CREAT_DT,
|
||||||
|
(CASE WHEN B.ROLE_CODE IS NULL THEN 'N'
|
||||||
|
ELSE 'Y'
|
||||||
|
END) AS REG_YN
|
||||||
|
FROM LETTNROLEINFO A
|
||||||
|
LEFT OUTER JOIN (SELECT AUTHOR_CODE , ROLE_CODE, CREAT_DT FROM LETTNAUTHORROLERELATE WHERE AUTHOR_CODE = #searchKeyword#) B
|
||||||
|
ON A.ROLE_CODE = B.ROLE_CODE
|
||||||
|
ORDER BY CAST(ROLE_SORT AS UNSIGNED) DESC
|
||||||
|
LIMIT #recordCountPerPage# OFFSET #firstIndex#
|
||||||
|
]]>
|
||||||
|
</select> -->
|
||||||
|
|
||||||
|
<select id="authorRoleManageDAO.selectAuthorRoleList" parameterClass="authorRoleManageVO" resultMap="authorRole">
|
||||||
|
SELECT A.ROLE_CODE,
|
||||||
|
A.ROLE_NM,
|
||||||
|
A.ROLE_PTTRN,
|
||||||
|
A.ROLE_DC,
|
||||||
|
A.ROLE_TY,
|
||||||
|
A.ROLE_SORT,
|
||||||
|
B.AUTHOR_CODE,
|
||||||
|
DATE_FORMAT(B.CREAT_DT , '%Y-%m-%d') CREAT_DT,
|
||||||
|
(CASE WHEN B.ROLE_CODE IS NULL THEN 'N'
|
||||||
|
ELSE 'Y'
|
||||||
|
END) AS REG_YN,
|
||||||
|
A.ROLE_SORT AS tempSortNum
|
||||||
|
FROM
|
||||||
|
(SELECT * FROM LETTNROLEINFO
|
||||||
|
WHERE 1=1
|
||||||
|
<isNotEmpty property="searchKeyword2">
|
||||||
|
<isNotEqual property="searchKeyword2" compareValue="">
|
||||||
|
AND ( ROLE_NM LIKE CONCAT('%' , #searchKeyword2#, '%') OR ROLE_DC LIKE CONCAT('%' , #searchKeyword2#, '%')
|
||||||
|
OR ROLE_PTTRN LIKE CONCAT('%' , #searchKeyword2#, '%')
|
||||||
|
)
|
||||||
|
</isNotEqual>
|
||||||
|
</isNotEmpty>
|
||||||
|
) A
|
||||||
|
LEFT OUTER JOIN (SELECT AUTHOR_CODE , ROLE_CODE, CREAT_DT FROM LETTNAUTHORROLERELATE WHERE AUTHOR_CODE = #searchKeyword#) B
|
||||||
|
ON A.ROLE_CODE = B.ROLE_CODE
|
||||||
|
ORDER BY 1=1
|
||||||
|
<isNotEmpty property="searchSortCnd">
|
||||||
|
,$searchSortCnd$
|
||||||
|
</isNotEmpty>
|
||||||
|
<isNotEmpty property="searchSortOrd">
|
||||||
|
$searchSortOrd$
|
||||||
|
</isNotEmpty>
|
||||||
|
LIMIT #recordCountPerPage# OFFSET #firstIndex#
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="authorRoleManageDAO.selectAuthorRoleListTotCnt" parameterClass="authorRoleManageVO" resultClass="int">
|
||||||
|
SELECT COUNT(*) totcnt
|
||||||
|
FROM (
|
||||||
|
SELECT * FROM LETTNROLEINFO WHERE 1=1
|
||||||
|
<isNotEmpty property="searchKeyword2">
|
||||||
|
<isNotEqual property="searchKeyword2" compareValue="">
|
||||||
|
AND ( ROLE_NM LIKE CONCAT('%' , #searchKeyword2#, '%') OR ROLE_DC LIKE CONCAT('%' , #searchKeyword2#, '%')
|
||||||
|
OR ROLE_PTTRN LIKE CONCAT('%' , #searchKeyword2#, '%')
|
||||||
|
)
|
||||||
|
</isNotEqual>
|
||||||
|
</isNotEmpty>
|
||||||
|
)A
|
||||||
|
LEFT OUTER JOIN (SELECT AUTHOR_CODE , ROLE_CODE, CREAT_DT FROM LETTNAUTHORROLERELATE WHERE AUTHOR_CODE = #searchKeyword#) B
|
||||||
|
ON A.ROLE_CODE = B.ROLE_CODE
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="authorRoleManageDAO.insertAuthorRole" parameterClass="authorRoleManage">
|
||||||
|
<![CDATA[
|
||||||
|
INSERT INTO LETTNAUTHORROLERELATE
|
||||||
|
( AUTHOR_CODE
|
||||||
|
, ROLE_CODE
|
||||||
|
, CREAT_DT)
|
||||||
|
VALUES ( #authorCode#
|
||||||
|
, #roleCode#
|
||||||
|
, now())
|
||||||
|
ON DUPLICATE KEY UPDATE AUTHOR_CODE=#authorCode#, ROLE_CODE= #roleCode# , CREAT_DT = NOW()
|
||||||
|
]]>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<delete id="authorRoleManageDAO.deleteAuthorRole">
|
||||||
|
<![CDATA[
|
||||||
|
DELETE FROM LETTNAUTHORROLERELATE
|
||||||
|
WHERE AUTHOR_CODE=#authorCode#
|
||||||
|
AND ROLE_CODE=#roleCode#
|
||||||
|
]]>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</sqlMap>
|
||||||
Loading…
Reference in New Issue
Block a user