feat: 게시판 관리 진행

main
Jonguk. Lim 2 years ago
parent 1551436822
commit eb850640d1

@ -7,6 +7,7 @@ import org.apache.ibatis.session.RowBounds;
import egovframework.rte.psl.dataaccess.mapper.Mapper; import egovframework.rte.psl.dataaccess.mapper.Mapper;
import kr.xit.framework.biz.mng.bbs.model.XitBbsCreateMngVO; import kr.xit.framework.biz.mng.bbs.model.XitBbsCreateMngVO;
import kr.xit.framework.biz.mng.bbs.model.XitBbsTmplateMngVO;
/** /**
* *
@ -18,12 +19,17 @@ import kr.xit.framework.biz.mng.bbs.model.XitBbsCreateMngVO;
* @since 2002. 2. 2. * @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved. * @version 1.0 Copyright(c) XIT All rights reserved.
*/ */
@SuppressWarnings("MybatisXMapperMethodInspection")
@Mapper @Mapper
public interface IBbsCreateMgtMapper { public interface IBbsCreateMgtMapper {
List<XitBbsCreateMngVO> selectBbscreateList(final Map<String, Object> paraMap, final RowBounds rowBounds); List<XitBbsCreateMngVO> selectBbsMastrs(final Map<String, Object> paraMap, final RowBounds rowBounds);
<T> List<XitBbsCreateMngVO> selectBbsCreateList(final T t); <T> List<XitBbsCreateMngVO> selectBbsMastrs(final T t);
<T> XitBbsCreateMngVO selectBbsCreate(final T t); <T> XitBbsCreateMngVO selectBbsMastr(final T t);
int insertBbsMastr(final XitBbsCreateMngVO vo);
int updateBbsMastr(final XitBbsCreateMngVO vo);
<T> int deleteBbsMastr(final T t);
} }

@ -18,7 +18,6 @@ import kr.xit.framework.biz.mng.bbs.model.XitBbsUseMngVO;
* @since 2002. 2. 2. * @since 2002. 2. 2.
* @version 1.0 Copyright(c) XIT All rights reserved. * @version 1.0 Copyright(c) XIT All rights reserved.
*/ */
@SuppressWarnings("MybatisXMapperMethodInspection")
@Mapper @Mapper
public interface IBbsUseMgtMapper { public interface IBbsUseMgtMapper {

@ -65,7 +65,8 @@ public class XitBbsCreateMngVO {
private String lastUpdusrPnttm; private String lastUpdusrPnttm;
/** 첨부가능파일숫자 */ /** 첨부가능파일숫자 */
private int posblAtchFileNumber = 0; private int atchPosblFileNumber;
private int atchPosblFileSize;
/** 첨부가능파일사이즈 */ /** 첨부가능파일사이즈 */
private String posblAtchFileSize; private String posblAtchFileSize;

@ -18,31 +18,33 @@ public class BbsCreateMgtService implements IBbsCreateMgtService{
@Override @Override
public List<XitBbsCreateMngVO> findBbsCreateList(final Map<String, Object> paraMap, final RowBounds rowBounds) { public List<XitBbsCreateMngVO> findBbsCreateList(final Map<String, Object> paraMap, final RowBounds rowBounds) {
return mapper.selectBbscreateList(paraMap, rowBounds); return mapper.selectBbsMastrs(paraMap, rowBounds);
} }
@Override @Override
public <T> List<XitBbsCreateMngVO> findBbsCreateList(final T t) { public <T> List<XitBbsCreateMngVO> findBbsCreateList(final T t) {
return mapper.selectBbsCreateList(t); return mapper.selectBbsMastrs(t);
} }
@Override @Override
public <T> XitBbsCreateMngVO findBbsCreate(final T t) { public <T> XitBbsCreateMngVO findBbsCreate(final T t) {
return mapper.selectBbsCreate(t); return mapper.selectBbsMastr(t);
} }
@Override @Override
public void addBbsCreate(final XitBbsCreateMngVO vo) { public void addBbsCreate(final XitBbsCreateMngVO vo) {
vo.setFrstRegisterId(getUserUniqId());
mapper.insertBbsMastr(vo);
} }
@Override @Override
public void modifyBbsCreate(final XitBbsCreateMngVO vo) { public void modifyBbsCreate(final XitBbsCreateMngVO vo) {
vo.setLastUpdusrId(getUserUniqId());
mapper.updateBbsMastr(vo);
} }
@Override @Override
public <T> void removeBbsCreate(final T t) { public <T> void removeBbsCreate(final T t) {
mapper.deleteBbsMastr(t);
} }
} }

@ -33,11 +33,13 @@ public class BbsUseMgtService implements IBbsUseMgtService{
@Override @Override
public void addBbsPrcuse(XitBbsUseMngVO vo) { public void addBbsPrcuse(XitBbsUseMngVO vo) {
vo.setFrstRegisterId(getUserUniqId());
mapper.insertBbsPrcuse(vo); mapper.insertBbsPrcuse(vo);
} }
@Override @Override
public void modifyBbsPrcuse(XitBbsUseMngVO vo) { public void modifyBbsPrcuse(XitBbsUseMngVO vo) {
vo.setLastUpdusrId(getUserUniqId());
mapper.updateBbsPrcuse(vo); mapper.updateBbsPrcuse(vo);
} }

@ -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>

@ -39,6 +39,7 @@
<select id="selectBbsTmpls" resultType="kr.xit.framework.biz.mng.bbs.model.XitBbsTmplateMngVO"> <select id="selectBbsTmpls" resultType="kr.xit.framework.biz.mng.bbs.model.XitBbsTmplateMngVO">
/* bbs-tmpl-mysql-mapper|selectBbsTmpls-템플릿 목록 조회|julim */ /* bbs-tmpl-mysql-mapper|selectBbsTmpls-템플릿 목록 조회|julim */
<include refid="sqlTmplInfo"/> <include refid="sqlTmplInfo"/>
ORDER BY xti.frst_regist_pnttm DESC
</select> </select>
<select id="selectBbsTmpl" resultType="kr.xit.framework.biz.mng.bbs.model.XitBbsTmplateMngVO"> <select id="selectBbsTmpl" resultType="kr.xit.framework.biz.mng.bbs.model.XitBbsTmplateMngVO">
@ -74,7 +75,7 @@
SET tmplat_nm = IF(tmplat_nm = #{tmplatNm}, tmplat_nm, #{tmplatNm}) SET tmplat_nm = IF(tmplat_nm = #{tmplatNm}, tmplat_nm, #{tmplatNm})
, tmplat_cours = IF(tmplat_cours = #{tmplatCours}, tmplat_cours, #{tmplatCours}) , tmplat_cours = IF(tmplat_cours = #{tmplatCours}, tmplat_cours, #{tmplatCours})
, tmplat_se_code = IF(tmplat_se_code = #{tmplatSeCode}, tmplat_se_code, #{tmplatSeCode}) , tmplat_se_code = IF(tmplat_se_code = #{tmplatSeCode}, tmplat_se_code, #{tmplatSeCode})
, use_at = #{useAt} , use_at = IF(use_at = #{useAt}, use_at, #{useAt})
, last_updt_pnttm = NOW() , last_updt_pnttm = NOW()
, last_updusr_id = #{lastUpdusrId} , last_updusr_id = #{lastUpdusrId}
WHERE tmplat_id = #{tmplatId} WHERE tmplat_id = #{tmplatId}

@ -61,7 +61,7 @@
UPDATE xit_cmmn_cl_code UPDATE xit_cmmn_cl_code
SET cl_code_nm = IF(cl_code_nm = #{clCodeNm}, cl_code_nm, #{clCodeNm}) SET cl_code_nm = IF(cl_code_nm = #{clCodeNm}, cl_code_nm, #{clCodeNm})
, cl_code_dc = IF(cl_code_dc = #{clCodeDc}, cl_code_dc, #{clCodeDc}) , cl_code_dc = IF(cl_code_dc = #{clCodeDc}, cl_code_dc, #{clCodeDc})
, use_at = #{useAt} , use_at = IF(use_at = #{useAt}, use_at, #{useAt})
, last_updt_pnttm = NOW() , last_updt_pnttm = NOW()
, last_updusr_id = #{lastUpdusrId} , last_updusr_id = #{lastUpdusrId}
WHERE cl_code = #{clCode} WHERE cl_code = #{clCode}

@ -74,7 +74,7 @@
UPDATE xit_cmmn_code UPDATE xit_cmmn_code
SET code_id_nm = IF(code_id_nm = #{codeIdNm}, code_id_nm, #{codeIdNm}) SET code_id_nm = IF(code_id_nm = #{codeIdNm}, code_id_nm, #{codeIdNm})
, code_id_dc = IF(code_id_dc = #{codeIdDc}, code_id_dc, #{codeIdDc}) , code_id_dc = IF(code_id_dc = #{codeIdDc}, code_id_dc, #{codeIdDc})
, use_at = #{useAt} , use_at = IF(use_at = #{useAt}, use_at, #{useAt})
, last_updt_pnttm = NOW() , last_updt_pnttm = NOW()
, last_updusr_id = #{lastUpdusrId} , last_updusr_id = #{lastUpdusrId}
WHERE cl_code = #{clCode} WHERE cl_code = #{clCode}

Loading…
Cancel
Save