File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
<?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="com.takensoft.ai_lms.lms.board.dao.BoardDAO">
<!--
작 성 자 : 박민혁
작 성 일 : 2024.07.25
내 용 : 경로 생성을 위해 만들어 놓은 xml,
CRUD를 이용하는데 삭제하거나 수정해서 사용해주세요
-->
<resultMap id="boardMap" type="BoardVO">
<result property="bbsId" column="bbs_id"/>
<result property="bbsTitle" column="bbs_ttl"/>
<result property="bbsCategory" column="bbs_cls"/>
<result property="bbsContents" column="bbs_cnt"/>
<result property="bbsTime" column="bbs_tm"/>
<result property="fileManageId" column="file_mng_id"/>
<result property="sclsId" column="scls_id"/>
</resultMap>
<!--
작성자 : 박세훈
작성일 : 2024.07.25
내 용 : 게시글 등록 관련
-->
<insert id="insertBoard" parameterType="BoardVO">
INSERT INTO board(bbs_id, bbs_ttl, bbs_cls, bbs_cnt,bbs_tm, file_mng_id, scls_id)
VALUES ( #{bbsId}, #{bbsTitle}, #{bbsCategory}, #{bbsContents}, now(), #{fileManageId}, #{sclsId});
</insert>
<!--
작성자 : 박세훈
작성일 : 2024.07.25
내 용 : 전체 게시물 수 조회
-->
<select id="boardCount" resultType="Integer">
SELECT COUNT(*)
FROM board
WHERE scls_id = #{sclsId}
</select>
<!--
작성자 : 박세훈
작성일 : 2024.07.25
내 용 : 게시글 전체 조회
-->
<select id="findAllBoard" resultMap="boardMap">
SELECT bbs_id, bbs_ttl, bbs_cls, bbs_cnt,bbs_tm, file_mng_id, scls_id
FROM board
WHERE scls_id = #{sclsId}
ORDER BY bbs_id DESC
LIMIT #{pageSize} OFFSET #{startIndex}
</select>
<!--
작성자 : 박세훈
작성일 : 2024.07.25
내 용 : 게시글 상세 조회
-->
<select id="findByBoardId" parameterType="BoardVO" resultMap="boardMap">
SELECT bbs_id, bbs_ttl, bbs_cls, bbs_cnt, file_mng_id
FROM board
WHERE bbs_id = #{bbsId}
ORDER BY bbs_id DESC
</select>
<!--
작성자 : 박세훈
작성일 : 2024.07.25
내 용 : 게시글 수정
-->
<update id="updateBoard" parameterType="BoardVO">
UPDATE board
SET bbs_ttl = #{bbsTitle},
bbs_cls = #{bbsCategory},
bbs_cnt = #{bbsContents},
bbs_tm = now(),
file_mng_id = #{fileManageId}
WHERE
bbs_id = #{bbsId}
</update>
<!--
작성자 : 박세훈
작성일 : 2024.07.25
내 용 : 게시글 삭제
-->
<delete id="deleteBoard" parameterType="String">
DELETE FROM board WHERE bbs_id = #{bbsId}
</delete>
</mapper>