PsHooN7979
07-31
240731 박세훈 설문 조사 간단 수정
@acfee5597a9d06650454ba6087ef5b231d9429ed
--- src/main/java/com/takensoft/ai_lms/lms/board/web/BoardController.java
+++ src/main/java/com/takensoft/ai_lms/lms/board/web/BoardController.java
... | ... | @@ -59,15 +59,9 @@ |
59 | 59 |
public ResponseEntity<?> findAllBoard(@RequestBody HashMap<String, Object> params) throws Exception { |
60 | 60 |
HashMap<String, Object> result = new HashMap<>(); |
61 | 61 |
|
62 |
- // 페이지 번호와 페이지 크기를 파라미터로 전달 |
|
63 |
- int page = Integer.parseInt(params.get("page").toString()); |
|
64 |
- int pageSize = Integer.parseInt(params.get("pageSize").toString()); |
|
65 |
- |
|
66 |
- |
|
67 | 62 |
// 전체 게시물 수 조회 및 추가 |
68 |
- int totalBoard = boardService.boardCount(params); |
|
69 |
- result.put("totalBoard", totalBoard); |
|
70 |
- result.put("list", boardService.findAllBoard(params)); |
|
63 |
+ result.put("totalBoard", boardService.boardCount(params)); |
|
64 |
+ result.put("result", boardService.findAllBoard(params)); |
|
71 | 65 |
|
72 | 66 |
|
73 | 67 |
return new ResponseEntity<>(result, HttpStatus.OK); |
... | ... | @@ -84,7 +78,7 @@ |
84 | 78 |
public ResponseEntity<?> findByBoardId(@RequestBody HashMap<String, Object> params) throws Exception { |
85 | 79 |
HashMap<String, Object> result = new HashMap<>(); |
86 | 80 |
|
87 |
- result.put("list", boardService.findByBoardId(params)); |
|
81 |
+ result.put("result", boardService.findByBoardId(params)); |
|
88 | 82 |
return new ResponseEntity<>(result, HttpStatus.OK); |
89 | 83 |
} |
90 | 84 |
/** |
... | ... | @@ -141,7 +135,7 @@ |
141 | 135 |
HashMap<String, Object> result = new HashMap<>(); |
142 | 136 |
|
143 | 137 |
List<HashMap<String, Object>> boardList = boardService.searchBoard(params); |
144 |
- result.put("list", boardList); |
|
138 |
+ result.put("result", boardList); |
|
145 | 139 |
return new ResponseEntity<>(result, HttpStatus.OK); |
146 | 140 |
} |
147 | 141 |
|
--- src/main/java/com/takensoft/ai_lms/lms/class_book/web/ClassBookController.java
+++ src/main/java/com/takensoft/ai_lms/lms/class_book/web/ClassBookController.java
... | ... | @@ -46,7 +46,7 @@ |
46 | 46 |
public ResponseEntity<?> findByBookId(@RequestBody HashMap<String, Object> params) throws Exception { |
47 | 47 |
HashMap<String, Object> result = new HashMap<>(); |
48 | 48 |
|
49 |
- result.put("list", classBookService.findByBookId(params)); |
|
49 |
+ result.put("result", classBookService.findByBookId(params)); |
|
50 | 50 |
|
51 | 51 |
return new ResponseEntity<>(result, HttpStatus.OK); |
52 | 52 |
} |
... | ... | @@ -65,7 +65,6 @@ |
65 | 65 |
public String deleteClassBook(@RequestBody ClassBookVO classBookVO) throws Exception { |
66 | 66 |
try { |
67 | 67 |
int result = classBookService.deleteClassBook(classBookVO); |
68 |
- System.out.println("result = " + result); |
|
69 | 68 |
if (result > 0) { |
70 | 69 |
return "success"; |
71 | 70 |
} else { |
--- src/main/java/com/takensoft/ai_lms/lms/survey/web/SurveyController.java
+++ src/main/java/com/takensoft/ai_lms/lms/survey/web/SurveyController.java
... | ... | @@ -26,6 +26,8 @@ |
26 | 26 |
|
27 | 27 |
private final SurveyService surveyService; |
28 | 28 |
|
29 |
+ |
|
30 |
+ // 설문 조사 등록 |
|
29 | 31 |
@PostMapping("/insert.json") |
30 | 32 |
public String insertSurvey(@RequestBody SurveyVO surveyVO) throws Exception { |
31 | 33 |
try { |
... | ... | @@ -40,6 +42,7 @@ |
40 | 42 |
} |
41 | 43 |
} |
42 | 44 |
|
45 |
+ // 설문 조사 상세 등록 |
|
43 | 46 |
@PostMapping("/insertDetail.json") |
44 | 47 |
public ResponseEntity<Void> insertDetailSurvey(@RequestBody List<SurveyDetailVO> surveyDetailVO) throws Exception { |
45 | 48 |
surveyService.insertSurveyDetail(surveyDetailVO); |
... | ... | @@ -47,17 +50,20 @@ |
47 | 50 |
} |
48 | 51 |
|
49 | 52 |
|
53 |
+ // 설문 조사 조회 |
|
50 | 54 |
@PostMapping("/list.json") |
51 | 55 |
public List<SurveyVO> surveyList(SurveyVO surveyVO) throws Exception { |
52 | 56 |
return surveyService.surveyList(surveyVO); |
53 | 57 |
} |
54 | 58 |
|
59 |
+ // 설문 조사 상세 조회 |
|
55 | 60 |
@PostMapping("detailList.json") |
56 |
- public List<SurveyDetailVO> surveyDetailVOList(SurveyDetailVO surveyDetailVO) throws Exception { |
|
61 |
+ public List<SurveyDetailVO> surveyDetailVOList(@RequestBody SurveyDetailVO surveyDetailVO) throws Exception { |
|
57 | 62 |
return surveyService.surveyDetailList(surveyDetailVO); |
58 | 63 |
} |
59 | 64 |
|
60 | 65 |
|
66 |
+ // 설문 조사 수정 |
|
61 | 67 |
@PostMapping("/update.json") |
62 | 68 |
public String updateSurvey (@RequestBody SurveyVO surveyVO) throws Exception { |
63 | 69 |
try { |
... | ... | @@ -73,6 +79,7 @@ |
73 | 79 |
} |
74 | 80 |
|
75 | 81 |
|
82 |
+ // 설문 조사 삭제(연관된 설문 조사 상세도 삭제됨) |
|
76 | 83 |
@PostMapping("/delete.json") |
77 | 84 |
public ResponseEntity<Void> deleteSurvey (@RequestBody SurveyVO surveyVO) throws Exception { |
78 | 85 |
surveyService.deleteSurveyWithDetails(surveyVO.getSrvyId()); |
--- src/main/resources/mybatis/mapper/lms/board-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/board-SQL.xml
... | ... | @@ -3,7 +3,7 @@ |
3 | 3 |
<mapper namespace="com.takensoft.ai_lms.lms.board.dao.BoardDAO"> |
4 | 4 |
|
5 | 5 |
<resultMap id="boardMap" type="BoardVO"> |
6 |
- <result property="bbsId" column="bbs_id"/> |
|
6 |
+ <id property="bbsId" column="bbs_id"/> |
|
7 | 7 |
<result property="bbsTtl" column="bbs_ttl"/> |
8 | 8 |
<result property="bbsCls" column="bbs_cls"/> |
9 | 9 |
<result property="bbsCnt" column="bbs_cnt"/> |
... | ... | @@ -13,7 +13,7 @@ |
13 | 13 |
</resultMap> |
14 | 14 |
|
15 | 15 |
<resultMap id="boardResultMap" type="BoardUserVO"> |
16 |
- <result property="userId" column="user_id" /> |
|
16 |
+ <id property="userId" column="user_id" /> |
|
17 | 17 |
<result property="userNm" column="user_nm" /> |
18 | 18 |
<collection property="boardClass" ofType="BoardClassVO"> |
19 | 19 |
<id property="sclsId" column="scls_id" /> |
--- src/main/resources/mybatis/mapper/lms/survey-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/survey-SQL.xml
... | ... | @@ -4,25 +4,14 @@ |
4 | 4 |
|
5 | 5 |
|
6 | 6 |
<resultMap id="surveyMap" type="SurveyVO"> |
7 |
- <result property="srvyId" column="srvy_id"/> |
|
7 |
+ <id property="srvyId" column="srvy_id"/> |
|
8 | 8 |
<result property="srvyType" column="srvy_type"/> |
9 | 9 |
<result property="srvyCnt" column="srvy_cnt"/> |
10 | 10 |
<collection property="surveyDetail" ofType="SurveyDetailVO"> |
11 |
- <result property="srvyDtlId" column="srvy_dtl_id" /> |
|
11 |
+ <id property="srvyDtlId" column="srvy_dtl_id" /> |
|
12 | 12 |
<result property="srvyDtlCnt" column="srvy_dtl_cnt" /> |
13 | 13 |
</collection> |
14 | 14 |
</resultMap> |
15 |
- |
|
16 |
-<!-- <resultMap id="surveyDetailMap" type="SurveyDetailVO">--> |
|
17 |
-<!-- <result property="srvyDtlId" column="srvy_dtl_id" />--> |
|
18 |
-<!-- <result property="srvyDtlCnt" column="srvy_dtl_cnt" />--> |
|
19 |
-<!-- <result property="srvyId" column="srvy_id" />--> |
|
20 |
-<!-- <collection property="survey" ofType="SurveyVO">--> |
|
21 |
-<!-- <result property="srvyId" column="srvy_id"/>--> |
|
22 |
-<!-- <result property="srvyType" column="srvy_type"/>--> |
|
23 |
-<!-- <result property="srvyCnt" column="srvy_cnt"/>--> |
|
24 |
-<!-- </collection>--> |
|
25 |
-<!-- </resultMap>--> |
|
26 | 15 |
|
27 | 16 |
<!-- |
28 | 17 |
작성자 : 박세훈 |
... | ... | @@ -83,6 +72,7 @@ |
83 | 72 |
d.srvy_dtl_id |
84 | 73 |
FROM survey s |
85 | 74 |
LEFT JOIN survey_detail d ON s.srvy_id = d.srvy_id |
75 |
+ WHERE s.srvy_id = #{srvyId} |
|
86 | 76 |
ORDER BY s.srvy_id DESC |
87 | 77 |
</select> |
88 | 78 |
|
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?