PsHooN7979
07-26
240726 박세훈 게시판 sql 수정
@4acce3b4e4a860345aed7ac34db83f6f6132f06d
--- src/main/resources/mybatis/mapper/lms/board-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/board-SQL.xml
... | ... | @@ -1,19 +1,14 @@ |
1 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
2 | 2 |
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
3 | 3 |
<mapper namespace="com.takensoft.ai_lms.lms.board.dao.BoardDAO"> |
4 |
- <!-- |
|
5 |
- 작 성 자 : 박민혁 |
|
6 |
- 작 성 일 : 2024.07.25 |
|
7 |
- 내 용 : 경로 생성을 위해 만들어 놓은 xml, |
|
8 |
- CRUD를 이용하는데 삭제하거나 수정해서 사용해주세요 |
|
9 |
- --> |
|
4 |
+ |
|
10 | 5 |
<resultMap id="boardMap" type="BoardVO"> |
11 | 6 |
<result property="bbsId" column="bbs_id"/> |
12 |
- <result property="bbsTitle" column="bbs_ttl"/> |
|
13 |
- <result property="bbsCategory" column="bbs_cls"/> |
|
14 |
- <result property="bbsContents" column="bbs_cnt"/> |
|
15 |
- <result property="bbsTime" column="bbs_tm"/> |
|
16 |
- <result property="fileManageId" column="file_mng_id"/> |
|
7 |
+ <result property="bbsTtl" column="bbs_ttl"/> |
|
8 |
+ <result property="bbsCls" column="bbs_cls"/> |
|
9 |
+ <result property="bbsCnt" column="bbs_cnt"/> |
|
10 |
+ <result property="bbsTm" column="bbs_tm"/> |
|
11 |
+ <result property="fileMngId" column="file_mng_id"/> |
|
17 | 12 |
<result property="sclsId" column="scls_id"/> |
18 | 13 |
</resultMap> |
19 | 14 |
|
... | ... | @@ -24,8 +19,20 @@ |
24 | 19 |
내 용 : 게시글 등록 관련 |
25 | 20 |
--> |
26 | 21 |
<insert id="insertBoard" parameterType="BoardVO"> |
27 |
- INSERT INTO board(bbs_id, bbs_ttl, bbs_cls, bbs_cnt,bbs_tm, file_mng_id, scls_id) |
|
28 |
- VALUES ( #{bbsId}, #{bbsTitle}, #{bbsCategory}, #{bbsContents}, now(), #{fileManageId}, #{sclsId}); |
|
22 |
+ INSERT INTO board(bbs_id, |
|
23 |
+ bbs_ttl, |
|
24 |
+ bbs_cls, |
|
25 |
+ bbs_cnt, |
|
26 |
+ bbs_tm, |
|
27 |
+ file_mng_id, |
|
28 |
+ scls_id) |
|
29 |
+ VALUES (#{bbsId}, |
|
30 |
+ #{bbsTtl}, |
|
31 |
+ #{bbsCls}, |
|
32 |
+ #{bbsCnt}, |
|
33 |
+ now(), |
|
34 |
+ #{fileMngId}, |
|
35 |
+ #{sclsId}); |
|
29 | 36 |
</insert> |
30 | 37 |
|
31 | 38 |
<!-- |
... | ... | @@ -75,10 +82,10 @@ |
75 | 82 |
WHERE 1 = 1 |
76 | 83 |
<if test="option != null and keyword != null"> |
77 | 84 |
<choose> |
78 |
- <when test="option == 'bbsTitle'"> |
|
85 |
+ <when test="option == 'bbsTtl'"> |
|
79 | 86 |
AND bbs_ttl LIKE CONCAT('%', #{keyword}, '%') |
80 | 87 |
</when> |
81 |
- <when test="option == 'bbsCategory'"> |
|
88 |
+ <when test="option == 'bbsCls'"> |
|
82 | 89 |
AND bbs_cls LIKE CONCAT('%', #{keyword}, '%') |
83 | 90 |
</when> |
84 | 91 |
<otherwise> |
... | ... | @@ -97,11 +104,11 @@ |
97 | 104 |
--> |
98 | 105 |
<update id="updateBoard" parameterType="BoardVO"> |
99 | 106 |
UPDATE board |
100 |
- SET bbs_ttl = #{bbsTitle}, |
|
101 |
- bbs_cls = #{bbsCategory}, |
|
102 |
- bbs_cnt = #{bbsContents}, |
|
107 |
+ SET bbs_ttl = #{bbsTtl}, |
|
108 |
+ bbs_cls = #{bbsCls}, |
|
109 |
+ bbs_cnt = #{bbsCnt}, |
|
103 | 110 |
bbs_tm = now(), |
104 |
- file_mng_id = #{fileManageId} |
|
111 |
+ file_mng_id = #{fileMngId} |
|
105 | 112 |
WHERE |
106 | 113 |
bbs_id = #{bbsId} |
107 | 114 |
</update> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?