feat: 게시판 관리 진행
parent
1551436822
commit
eb850640d1
@ -0,0 +1,130 @@
|
||||
<?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="kr.xit.framework.biz.mng.bbs.mapper.IBbsCreateMgtMapper">
|
||||
|
||||
<!-- *************************************************************************************************************
|
||||
* xit_bbs_mastr : 게시판 마스터
|
||||
************************************************************************************************************** -->
|
||||
<sql id="sqlBbsMastr">
|
||||
SELECT xbm.bbs_id
|
||||
, xbm.bbs_ty_code
|
||||
, cdc.code_nm AS bbsTyCodeNm
|
||||
, xbm.bbs_intrcn
|
||||
, xbm.bbs_attrb_code
|
||||
, cdc2.code_nm AS bbsAttrbCodeNm
|
||||
, xbm.bbs_nm AS bbsNm
|
||||
, xbm.tmplat_id
|
||||
, xti.tmplat_nm
|
||||
, xti.tmplat_cours
|
||||
, xbm.file_atch_posbl_at
|
||||
, xbm.atch_posbl_file_number
|
||||
, xbm.atch_posbl_file_size
|
||||
, xbm.reply_posbl_at
|
||||
, xbm.frst_register_id
|
||||
, (SELECT sa.user_nm
|
||||
FROM XIT_VW_USER_MASTR SA
|
||||
WHERE sa.esntl_id = xbm.frst_register_id) AS frstRegisterNm
|
||||
, xbm.use_at AS useAt
|
||||
, DATE_FORMAT(xbm.frst_regist_pnttm, '%Y-%m-%d') AS frstRegisterPnttm
|
||||
, (SELECT IFNULL(sa.use_at, 'N')
|
||||
FROM xit_bbs_prcuse sa
|
||||
WHERE sa.bbs_id = xbm.bbs_id
|
||||
AND sa.trget_id IN (#{uniqId}, 'SYSTEM_DEFAULT_BOARD')) AS authFlag
|
||||
FROM xit_bbs_mastr xbm
|
||||
LEFT OUTER JOIN (SELECT code_id
|
||||
, code
|
||||
, code_nm
|
||||
FROM xit_cmmn_detail_code
|
||||
WHERE code_id = 'XIT004'
|
||||
AND use_at = 'Y') cdc
|
||||
ON xbm.bbs_ty_code = cdc.code
|
||||
LEFT OUTER JOIN (SELECT code_id
|
||||
, code
|
||||
, code_nm
|
||||
FROM xit_cmmn_detail_code
|
||||
WHERE code_id = 'XIT009'
|
||||
AND use_at = 'Y') cdc2
|
||||
ON xbm.bbs_attrb_code = cdc2.code
|
||||
LEFT OUTER JOIN xit_tmplat_info xti
|
||||
ON xbm.tmplat_id = xti.tmplat_id
|
||||
AND xti.use_at = 'Y'
|
||||
</sql>
|
||||
|
||||
<select id="selectBbsMastrs" resultType="kr.xit.framework.biz.mng.bbs.model.XitBbsCreateMngVO">
|
||||
/* bbs-mastr-mysql-mapper|selectBbsMastrs-BBS 마스터(생성) 목록 조회|julim */
|
||||
<include refid="sqlBbsMastr"/>
|
||||
<where>
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(useAt)">
|
||||
AND xbm.use_at = #{useAt}
|
||||
</if>
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(bbsNm)">
|
||||
AND INSTR(xbm.bbs_nm, #{bbsNm}) > 0
|
||||
</if>
|
||||
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(bbsTyCodeNm)">
|
||||
AND INSTR(cdc.code_nm, #{bbsTyCodeNm}) > 0
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY xbm.frst_regist_pnttm DESC
|
||||
</select>
|
||||
|
||||
<select id="selectBbsMastr" resultType="kr.xit.framework.biz.mng.bbs.model.XitBbsCreateMngVO">
|
||||
/* bbs-mastr-mysql-mapper|selectBbsMastr-BBS 마스터(생성) 정보 조회|julim */
|
||||
<include refid="sqlBbsMastr"/>
|
||||
WHERE xbm.bbs_id = #{bbsId}
|
||||
</select>
|
||||
|
||||
<insert id="insertBbsMastr">
|
||||
/* bbs-mastr-mysql-mapper|insertBbsMastr-BBS 마스터(생성) 정보 등록|julim */
|
||||
INSERT
|
||||
INTO xit_bbs_mastr (
|
||||
bbs_id
|
||||
, bbs_nm
|
||||
, bbs_intrcn
|
||||
, bbs_ty_code
|
||||
, bbs_attrb_code
|
||||
, atch_posbl_file_number
|
||||
, atch_posbl_file_size
|
||||
, tmplat_id
|
||||
, use_at
|
||||
, frst_regist_pnttm
|
||||
, frst_register_id
|
||||
) VALUES (
|
||||
#{bbsId}
|
||||
, #{bbsNm}
|
||||
, #{bbsIntrcn}
|
||||
, #{bbsTyCode}
|
||||
, #{bbsAttrbCode}
|
||||
, #{atchPosblFileNumber}
|
||||
, #{atchPosblFileSize}
|
||||
, #{tmplatId}
|
||||
, #{useAt}
|
||||
, NOW()
|
||||
, #{frstRegisterId}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateBbsMastr">
|
||||
/* bbs-mastr-mysql-mapper|updateBbsMastr-BBS 마스터(생성) 정보 변경|julim */
|
||||
UPDATE xit_bbs_mastr
|
||||
SET bbs_nm = IF(bbs_nm = #{bbsNm}, bbs_nm, #{bbsNm})
|
||||
, bbs_intrcn = IF(bbs_intrcn = #{bbsIntrcn}, bbs_intrcn, #{bbsIntrcn})
|
||||
, bbs_ty_code = IF(bbs_ty_code = #{bbsTyCode}, bbs_ty_code, #{bbsTyCode})
|
||||
, bbs_attrb_code = IF(bbs_attrb_code = #{bbsAttrbCode}, bbs_attrb_code, #{bbsAttrbCode})
|
||||
, atch_posbl_file_number = IF(atch_posbl_file_number = #{atchPosblFileNumber}, atch_posbl_file_number, #{atchPosblFileNumber})
|
||||
, atch_posbl_file_size = IF(atch_posbl_file_size = #{atchPosblFileSize}, atch_posbl_file_size, #{atchPosblFileSize})
|
||||
, tmplat_id = IF(tmplat_id = #{tmplatId}, tmplat_id, #{tmplatId})
|
||||
, use_at = IF(use_at = #{useAt}, use_at, #{useAt})
|
||||
, last_updt_pnttm = NOW()
|
||||
, last_updusr_id = #{lastUpdusrId}
|
||||
WHERE bbs_id = #{bbsId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBbsMastr">
|
||||
/* bbs-mastr-mysql-mapper|deleteBbsMastr-BBS 마스터(생성) 정보 삭제|julim */
|
||||
DELETE
|
||||
FROM xit_bbs_mastr
|
||||
WHERE bbs_id = #{bbsId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,92 @@
|
||||
<?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="kr.xit.framework.biz.mng.bbs.mapper.IBbsUseMgtMapper">
|
||||
|
||||
<!-- *************************************************************************************************************
|
||||
* xit_bbs_prcuse : 게시판 활용
|
||||
************************************************************************************************************** -->
|
||||
<sql id="sqlBbsPrcuse">
|
||||
SELECT xbp.bbs_id
|
||||
, xbm.bbs_nm
|
||||
, xbp.trget_id
|
||||
, xbp.regist_se_code
|
||||
, cdc.code_nm AS registSeCodeNm
|
||||
, xbp.use_at
|
||||
, xbp.frst_register_id
|
||||
, xbp.frst_regist_pnttm
|
||||
, '시스템 활용' AS cmmntyId
|
||||
, '시스템 활용' AS cmmntyNm
|
||||
, '시스템 활용' AS clbId
|
||||
, '시스템 활용' AS clbNm
|
||||
, '시스템 활용' AS bbsTyCode
|
||||
FROM xit_bbs_prcuse xbp
|
||||
LEFT OUTER JOIN xit_cmmn_detail_code cdc
|
||||
ON cdc.code = xbp.regist_se_code
|
||||
LEFT OUTER JOIN xit_bbs_mastr xbm
|
||||
ON xbp.bbs_id = xbm.bbs_id
|
||||
</sql>
|
||||
|
||||
<select id="selectBbsPrcuseList" resultType="kr.xit.framework.biz.mng.bbs.model.XitBbsUseMngVO">
|
||||
/* bbs-prcuse-mysql-mapper|selectBbsPrcuseList-BBS 활용 목록 조회|julim */
|
||||
<include refid="sqlBbsPrcuse"/>
|
||||
<where>
|
||||
AND cdc.code_id = 'XIT001'
|
||||
AND xbp.regist_se_code != 'REGC07'
|
||||
<choose>
|
||||
<when test="'0'.toString() == searchCnd">
|
||||
AND INSTR(xbm.bbs_nm, #{searchWrd}) > 0
|
||||
</when>
|
||||
</choose>
|
||||
</where>
|
||||
ORDER BY xbp.frst_regist_pnttm DESC
|
||||
</select>
|
||||
|
||||
<select id="selectBbsPrcuse" resultType="kr.xit.framework.biz.mng.bbs.model.XitBbsUseMngVO">
|
||||
/* bbs-prcuse-mysql-mapper|selectBbsPrcuse-BBS 활용 정보 조회|julim */
|
||||
<include refid="sqlBbsPrcuse"/>
|
||||
WHERE cdc.code_id = 'XIT001'
|
||||
AND xbp.bbs_id = #{bbsId}
|
||||
AND xbp.trget_id = #{trgetId}
|
||||
</select>
|
||||
|
||||
<insert id="insertBbsPrcuse">
|
||||
/* bbs-mastr-mysql-mapper|insertBbsMastr-BBS 마스터(생성) 정보 등록|julim */
|
||||
INSERT
|
||||
INTO xit_bbs_prcuse (
|
||||
trget_id
|
||||
, bbs_id
|
||||
, regist_se_code
|
||||
, use_at
|
||||
, frst_regist_pnttm
|
||||
, frst_register_id
|
||||
) VALUES (
|
||||
#{trgetId}
|
||||
, #{bbsId}
|
||||
, #{registSeCode}
|
||||
, #{useAt}
|
||||
, NOW()
|
||||
, #{frstRegisterId}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateBbsPrcuse">
|
||||
/*bbs-prcuse-mysql-mapper|selectBbsPrcuse-BBS 활용 정보 변경|julim */
|
||||
UPDATE xit_bbs_prcuse
|
||||
SET regist_se_code = IF(regist_se_code = #{registSeCode}, regist_se_code, #{registSeCode})
|
||||
, use_at = IF(use_at = #{useAt}, use_at, #{useAt})
|
||||
, last_updt_pnttm = NOW()
|
||||
, last_updusr_id = #{lastUpdusrId}
|
||||
WHERE trget_id = #{trgetId}
|
||||
AND bbs_id = #{bbsId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBbsPrcuse">
|
||||
/* bbs-prcuse-mysql-mapper|selectBbsPrcuse-BBS 활용 정보 삭제|julim */
|
||||
DELETE
|
||||
FROM xit_bbs_prcuse
|
||||
WHERE trget_id = #{trgetId}
|
||||
AND bbs_id = #{bbsId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue