PsHooN7979 07-26
240726 박세훈 게시판 sql 수정
@4acce3b4e4a860345aed7ac34db83f6f6132f06d
src/main/resources/mybatis/mapper/lms/board-SQL.xml
--- src/main/resources/mybatis/mapper/lms/board-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/board-SQL.xml
@@ -1,19 +1,14 @@
 <?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="bbsTtl" column="bbs_ttl"/>
+        <result property="bbsCls" column="bbs_cls"/>
+        <result property="bbsCnt" column="bbs_cnt"/>
+        <result property="bbsTm" column="bbs_tm"/>
+        <result property="fileMngId" column="file_mng_id"/>
         <result property="sclsId" column="scls_id"/>
     </resultMap>
 
@@ -24,8 +19,20 @@
         내 용 : 게시글 등록 관련
     -->
     <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 INTO board(bbs_id,
+                    bbs_ttl,
+                    bbs_cls,
+                    bbs_cnt,
+                    bbs_tm,
+                    file_mng_id,
+                    scls_id)
+        VALUES (#{bbsId},
+                #{bbsTtl},
+                #{bbsCls},
+                #{bbsCnt},
+                now(),
+                #{fileMngId},
+                #{sclsId});
     </insert>
 
     <!--
@@ -75,10 +82,10 @@
         WHERE 1 = 1
         <if test="option != null and keyword != null">
             <choose>
-                <when test="option == 'bbsTitle'">
+                <when test="option == 'bbsTtl'">
                     AND bbs_ttl LIKE CONCAT('%', #{keyword}, '%')
                 </when>
-                <when test="option == 'bbsCategory'">
+                <when test="option == 'bbsCls'">
                     AND bbs_cls LIKE CONCAT('%', #{keyword}, '%')
                 </when>
                 <otherwise>
@@ -97,11 +104,11 @@
     -->
     <update id="updateBoard" parameterType="BoardVO">
         UPDATE board
-        SET bbs_ttl = #{bbsTitle},
-            bbs_cls = #{bbsCategory},
-            bbs_cnt = #{bbsContents},
+        SET bbs_ttl = #{bbsTtl},
+            bbs_cls = #{bbsCls},
+            bbs_cnt = #{bbsCnt},
             bbs_tm = now(),
-            file_mng_id = #{fileManageId}
+            file_mng_id = #{fileMngId}
         WHERE
             bbs_id = #{bbsId}
     </update>
Add a comment
List