
+++ src/main/java/com/takensoft/taken_bi_manager/community/dao/FaqDAO.java
... | ... | @@ -0,0 +1,58 @@ |
1 | +package com.takensoft.taken_bi_manager.community.dao; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
4 | +import com.takensoft.taken_bi_manager.community.vo.FaqVO; | |
5 | +import org.apache.ibatis.annotations.Mapper; | |
6 | + | |
7 | +import java.util.List; | |
8 | + | |
9 | +@Mapper | |
10 | +public interface FaqDAO { | |
11 | + /** | |
12 | + * @author 박정하 | |
13 | + * @since 2025.01.21 | |
14 | + * | |
15 | + * Faq 목록 조회 | |
16 | + */ | |
17 | + public List<FaqVO> selectFaqList(SearchVO searchVO) throws Exception; | |
18 | + | |
19 | + /** | |
20 | + * @author 박정하 | |
21 | + * @since 2025.01.21 | |
22 | + * | |
23 | + * Faq 개수 조회 | |
24 | + */ | |
25 | + public int selectFaqCount(SearchVO searchVO) throws Exception; | |
26 | + | |
27 | + /** | |
28 | + * @author 박정하 | |
29 | + * @since 2025.01.21 | |
30 | + * | |
31 | + * Faq 상세 조회 | |
32 | + */ | |
33 | + public FaqVO selectFaqById(String faqId) throws Exception; | |
34 | + | |
35 | + /** | |
36 | + * @author 박정하 | |
37 | + * @since 2025.01.21 | |
38 | + * | |
39 | + * Faq 등록 | |
40 | + */ | |
41 | + public int insertFaq(FaqVO faqVO) throws Exception; | |
42 | + | |
43 | + /** | |
44 | + * @author 박정하 | |
45 | + * @since 2025.01.21 | |
46 | + * | |
47 | + * Faq 수정 | |
48 | + */ | |
49 | + public int updateFaq(FaqVO faqVO) throws Exception; | |
50 | + | |
51 | + /** | |
52 | + * @author 박정하 | |
53 | + * @since 2025.01.21 | |
54 | + * | |
55 | + * Faq 삭제 | |
56 | + */ | |
57 | + public int deleteFaq(FaqVO faqVO) throws Exception; | |
58 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/community/dao/NoticeDAO.java
... | ... | @@ -0,0 +1,66 @@ |
1 | +package com.takensoft.taken_bi_manager.community.dao; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
4 | +import com.takensoft.taken_bi_manager.community.vo.NoticeVO; | |
5 | +import org.apache.ibatis.annotations.Mapper; | |
6 | + | |
7 | +import java.util.List; | |
8 | + | |
9 | +@Mapper | |
10 | +public interface NoticeDAO { | |
11 | + /** | |
12 | + * @author 박정하 | |
13 | + * @since 2025.01.21 | |
14 | + * | |
15 | + * 공지사항 목록 조회 | |
16 | + */ | |
17 | + public List<NoticeVO> selectNoticeList(SearchVO searchVO) throws Exception; | |
18 | + | |
19 | + /** | |
20 | + * @author 박정하 | |
21 | + * @since 2025.01.21 | |
22 | + * | |
23 | + * 공지사항 개수 조회 | |
24 | + */ | |
25 | + public int selectNoticeCount(SearchVO searchVO) throws Exception; | |
26 | + | |
27 | + /** | |
28 | + * @author 박정하 | |
29 | + * @since 2025.01.21 | |
30 | + * | |
31 | + * 공지사항 상세 조회 | |
32 | + */ | |
33 | + public NoticeVO selectNoticeById(String noticeId) throws Exception; | |
34 | + | |
35 | + /** | |
36 | + * @author 박정하 | |
37 | + * @since 2025.01.21 | |
38 | + * | |
39 | + * 공지사항 등록 | |
40 | + */ | |
41 | + public int insertNotice(NoticeVO noticeVO) throws Exception; | |
42 | + | |
43 | + /** | |
44 | + * @author 박정하 | |
45 | + * @since 2025.01.21 | |
46 | + * | |
47 | + * 공지사항 수정 | |
48 | + */ | |
49 | + public int updateNotice(NoticeVO noticeVO) throws Exception; | |
50 | + | |
51 | + /** | |
52 | + * @author 박정하 | |
53 | + * @since 2025.01.21 | |
54 | + * | |
55 | + * 공지사항 조회수 수정 | |
56 | + */ | |
57 | + public int updateNoticeHits(NoticeVO noticeVO) throws Exception; | |
58 | + | |
59 | + /** | |
60 | + * @author 박정하 | |
61 | + * @since 2025.01.21 | |
62 | + * | |
63 | + * 공지사항 삭제 | |
64 | + */ | |
65 | + public int deleteNotice(NoticeVO noticeVO) throws Exception; | |
66 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/community/service/FaqService.java
... | ... | @@ -0,0 +1,48 @@ |
1 | +package com.takensoft.taken_bi_manager.community.service; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
4 | +import com.takensoft.taken_bi_manager.community.vo.FaqVO; | |
5 | + | |
6 | +import java.util.HashMap; | |
7 | + | |
8 | +public interface FaqService { | |
9 | + /** | |
10 | + * @author 박정하 | |
11 | + * @since 2025.01.21 | |
12 | + * | |
13 | + * Faq 목록 조회 | |
14 | + */ | |
15 | + public HashMap<String, Object> selectFaqList(SearchVO searchVO) throws Exception; | |
16 | + | |
17 | + /** | |
18 | + * @author 박정하 | |
19 | + * @since 2025.01.21 | |
20 | + * | |
21 | + * Faq 상세 조회 | |
22 | + */ | |
23 | + public HashMap<String, Object> selectFaqById(String faqId) throws Exception; | |
24 | + | |
25 | + /** | |
26 | + * @author 박정하 | |
27 | + * @since 2025.01.21 | |
28 | + * | |
29 | + * Faq 등록 | |
30 | + */ | |
31 | + public HashMap<String, Object> insertFaq(FaqVO faqVO) throws Exception; | |
32 | + | |
33 | + /** | |
34 | + * @author 박정하 | |
35 | + * @since 2025.01.21 | |
36 | + * | |
37 | + * Faq 수정 | |
38 | + */ | |
39 | + public HashMap<String, Object> updateFaq(FaqVO faqVO) throws Exception; | |
40 | + | |
41 | + /** | |
42 | + * @author 박정하 | |
43 | + * @since 2025.01.21 | |
44 | + * | |
45 | + * Faq 삭제 | |
46 | + */ | |
47 | + public HashMap<String, Object> deleteFaq(FaqVO faqVO) throws Exception; | |
48 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/community/service/NoticeService.java
... | ... | @@ -0,0 +1,56 @@ |
1 | +package com.takensoft.taken_bi_manager.community.service; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
4 | +import com.takensoft.taken_bi_manager.community.vo.NoticeVO; | |
5 | + | |
6 | +import java.util.HashMap; | |
7 | + | |
8 | +public interface NoticeService { | |
9 | + /** | |
10 | + * @author 박정하 | |
11 | + * @since 2025.01.21 | |
12 | + * | |
13 | + * 공지사항 목록 조회 | |
14 | + */ | |
15 | + public HashMap<String, Object> selectNoticeList(SearchVO searchVO) throws Exception; | |
16 | + | |
17 | + /** | |
18 | + * @author 박정하 | |
19 | + * @since 2025.01.21 | |
20 | + * | |
21 | + * 공지사항 상세 조회 | |
22 | + */ | |
23 | + public HashMap<String, Object> selectNoticeById(String noticeId) throws Exception; | |
24 | + | |
25 | + /** | |
26 | + * @author 박정하 | |
27 | + * @since 2025.01.21 | |
28 | + * | |
29 | + * 공지사항 등록 | |
30 | + */ | |
31 | + public HashMap<String, Object> insertNotice(NoticeVO noticeVO) throws Exception; | |
32 | + | |
33 | + /** | |
34 | + * @author 박정하 | |
35 | + * @since 2025.01.21 | |
36 | + * | |
37 | + * 공지사항 수정 | |
38 | + */ | |
39 | + public HashMap<String, Object> updateNotice(NoticeVO noticeVO) throws Exception; | |
40 | + | |
41 | + /** | |
42 | + * @author 박정하 | |
43 | + * @since 2025.01.21 | |
44 | + * | |
45 | + * 공지사항 조회수 수정 | |
46 | + */ | |
47 | + public HashMap<String, Object> updateNoticeHits(NoticeVO noticeVO) throws Exception; | |
48 | + | |
49 | + /** | |
50 | + * @author 박정하 | |
51 | + * @since 2025.01.21 | |
52 | + * | |
53 | + * 공지사항 삭제 | |
54 | + */ | |
55 | + public HashMap<String, Object> deleteNotice(NoticeVO noticeVO) throws Exception; | |
56 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/community/service/impl/FaqServiceImpl.java
... | ... | @@ -0,0 +1,114 @@ |
1 | +package com.takensoft.taken_bi_manager.community.service.impl; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.common.util.AuthUtil; | |
4 | +import com.takensoft.taken_bi_manager.common.util.CommonUtil; | |
5 | +import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
6 | +import com.takensoft.taken_bi_manager.community.dao.FaqDAO; | |
7 | +import com.takensoft.taken_bi_manager.community.service.FaqService; | |
8 | +import com.takensoft.taken_bi_manager.community.vo.FaqVO; | |
9 | +import lombok.RequiredArgsConstructor; | |
10 | +import org.springframework.stereotype.Service; | |
11 | + | |
12 | +import java.util.HashMap; | |
13 | + | |
14 | +@Service | |
15 | +@RequiredArgsConstructor | |
16 | +public class FaqServiceImpl implements FaqService { | |
17 | + private final FaqDAO faqDAO; | |
18 | + | |
19 | + /** | |
20 | + * @author 박정하 | |
21 | + * @since 2025.01.21 | |
22 | + * | |
23 | + * Faq 목록 조회 | |
24 | + */ | |
25 | + @Override | |
26 | + public HashMap<String, Object> selectFaqList(SearchVO searchVO) throws Exception { | |
27 | + // searchVO 수정 | |
28 | + searchVO.setTotalRows(faqDAO.selectFaqCount(searchVO)); | |
29 | + | |
30 | + HashMap<String, Object> result = new HashMap<>(); | |
31 | + result.put("list", faqDAO.selectFaqList(searchVO)); | |
32 | + result.put("searchVO", searchVO); | |
33 | + return result; | |
34 | + } | |
35 | + | |
36 | + /** | |
37 | + * @author 박정하 | |
38 | + * @since 2025.01.21 | |
39 | + * | |
40 | + * Faq 상세 조회 | |
41 | + */ | |
42 | + @Override | |
43 | + public HashMap<String, Object> selectFaqById(String faqId) throws Exception { | |
44 | + FaqVO faqVO = new FaqVO(); | |
45 | + | |
46 | + if (faqId != null && faqId != "") { | |
47 | + faqVO = faqDAO.selectFaqById(faqId); | |
48 | + } | |
49 | + | |
50 | + HashMap<String, Object> result = new HashMap<>(); | |
51 | + result.put("vo", faqVO); | |
52 | + return result; | |
53 | + } | |
54 | + | |
55 | + /** | |
56 | + * @author 박정하 | |
57 | + * @since 2025.01.21 | |
58 | + * | |
59 | + * Faq 등록 | |
60 | + */ | |
61 | + @Override | |
62 | + public HashMap<String, Object> insertFaq(FaqVO faqVO) throws Exception { | |
63 | + faqVO.setFaqInsertUserId(AuthUtil.getLoginUserId()); | |
64 | + faqVO.setFaqId(CommonUtil.getRandKey("NOTICE")); | |
65 | + | |
66 | + int insertCnt = faqDAO.insertFaq(faqVO); | |
67 | + if (insertCnt < 1) { | |
68 | + throw new RuntimeException("등록 중 오류가 발생했습니다."); | |
69 | + } | |
70 | + | |
71 | + HashMap<String, Object> result = new HashMap<>(); | |
72 | + result.put("insertCnt", insertCnt); | |
73 | + result.put("vo", faqVO); | |
74 | + return result; | |
75 | + } | |
76 | + | |
77 | + /** | |
78 | + * @author 박정하 | |
79 | + * @since 2025.01.21 | |
80 | + * | |
81 | + * Faq 수정 | |
82 | + */ | |
83 | + @Override | |
84 | + public HashMap<String, Object> updateFaq(FaqVO faqVO) throws Exception { | |
85 | + faqVO.setFaqUpdateUserId(AuthUtil.getLoginUserId()); | |
86 | + | |
87 | + int updateCnt = faqDAO.updateFaq(faqVO); | |
88 | + if (updateCnt < 1) { | |
89 | + throw new RuntimeException("수정 중 오류가 발생했습니다."); | |
90 | + } | |
91 | + | |
92 | + HashMap<String, Object> result = new HashMap<>(); | |
93 | + result.put("updateCnt", updateCnt); | |
94 | + return result; | |
95 | + } | |
96 | + | |
97 | + /** | |
98 | + * @author 박정하 | |
99 | + * @since 2025.01.21 | |
100 | + * | |
101 | + * Faq 삭제 | |
102 | + */ | |
103 | + @Override | |
104 | + public HashMap<String, Object> deleteFaq(FaqVO faqVO) throws Exception { | |
105 | + int updateCnt = faqDAO.deleteFaq(faqVO); | |
106 | + if (updateCnt < 1) { | |
107 | + throw new RuntimeException("삭제 중 오류가 발생했습니다."); | |
108 | + } | |
109 | + | |
110 | + HashMap<String, Object> result = new HashMap<>(); | |
111 | + result.put("updateCnt", updateCnt); | |
112 | + return result; | |
113 | + } | |
114 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/community/service/impl/NoticeServiceImpl.java
... | ... | @@ -0,0 +1,144 @@ |
1 | +package com.takensoft.taken_bi_manager.community.service.impl; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.common.file.dao.FileDAO; | |
4 | +import com.takensoft.taken_bi_manager.common.file.vo.CmmnFile; | |
5 | +import com.takensoft.taken_bi_manager.common.util.AuthUtil; | |
6 | +import com.takensoft.taken_bi_manager.common.util.CommonUtil; | |
7 | +import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
8 | +import com.takensoft.taken_bi_manager.community.dao.NoticeDAO; | |
9 | +import com.takensoft.taken_bi_manager.community.service.NoticeService; | |
10 | +import com.takensoft.taken_bi_manager.community.vo.NoticeVO; | |
11 | +import lombok.RequiredArgsConstructor; | |
12 | +import org.springframework.stereotype.Service; | |
13 | + | |
14 | +import java.util.ArrayList; | |
15 | +import java.util.HashMap; | |
16 | +import java.util.List; | |
17 | + | |
18 | +@Service | |
19 | +@RequiredArgsConstructor | |
20 | +public class NoticeServiceImpl implements NoticeService { | |
21 | + private final NoticeDAO noticeDAO; | |
22 | + private final FileDAO fileDAO; | |
23 | + | |
24 | + /** | |
25 | + * @author 박정하 | |
26 | + * @since 2025.01.21 | |
27 | + * | |
28 | + * 공지사항 목록 조회 | |
29 | + */ | |
30 | + @Override | |
31 | + public HashMap<String, Object> selectNoticeList(SearchVO searchVO) throws Exception { | |
32 | + // searchVO 수정 | |
33 | + searchVO.setTotalRows(noticeDAO.selectNoticeCount(searchVO)); | |
34 | + | |
35 | + HashMap<String, Object> result = new HashMap<>(); | |
36 | + result.put("list", noticeDAO.selectNoticeList(searchVO)); | |
37 | + result.put("searchVO", searchVO); | |
38 | + return result; | |
39 | + } | |
40 | + | |
41 | + /** | |
42 | + * @author 박정하 | |
43 | + * @since 2025.01.21 | |
44 | + * | |
45 | + * 공지사항 상세 조회 | |
46 | + */ | |
47 | + @Override | |
48 | + public HashMap<String, Object> selectNoticeById(String noticeId) throws Exception { | |
49 | + NoticeVO noticeVO = new NoticeVO(); | |
50 | + List<CmmnFile> fileList = new ArrayList<>(); | |
51 | + | |
52 | + if (noticeId != null && noticeId != "") { | |
53 | + noticeVO = noticeDAO.selectNoticeById(noticeId); | |
54 | + | |
55 | + String fileManagerId = noticeVO.getFileManagerId(); | |
56 | + if(fileManagerId != null){ | |
57 | + fileList = fileDAO.cmmnfilesSelect(fileManagerId); | |
58 | + } | |
59 | + } | |
60 | + | |
61 | + HashMap<String, Object> result = new HashMap<>(); | |
62 | + result.put("vo", noticeVO); | |
63 | + result.put("fileList", fileList); | |
64 | + return result; | |
65 | + } | |
66 | + | |
67 | + /** | |
68 | + * @author 박정하 | |
69 | + * @since 2025.01.21 | |
70 | + * | |
71 | + * 공지사항 등록 | |
72 | + */ | |
73 | + @Override | |
74 | + public HashMap<String, Object> insertNotice(NoticeVO noticeVO) throws Exception { | |
75 | + noticeVO.setNoticeInsertUserId(AuthUtil.getLoginUserId()); | |
76 | + noticeVO.setNoticeId(CommonUtil.getRandKey("NOTICE")); | |
77 | + | |
78 | + int insertCnt = noticeDAO.insertNotice(noticeVO); | |
79 | + if (insertCnt < 1) { | |
80 | + throw new RuntimeException("등록 중 오류가 발생했습니다."); | |
81 | + } | |
82 | + | |
83 | + HashMap<String, Object> result = new HashMap<>(); | |
84 | + result.put("insertCnt", insertCnt); | |
85 | + result.put("vo", noticeVO); | |
86 | + return result; | |
87 | + } | |
88 | + | |
89 | + /** | |
90 | + * @author 박정하 | |
91 | + * @since 2025.01.21 | |
92 | + * | |
93 | + * 공지사항 수정 | |
94 | + */ | |
95 | + @Override | |
96 | + public HashMap<String, Object> updateNotice(NoticeVO noticeVO) throws Exception { | |
97 | + noticeVO.setNoticeUpdateUserId(AuthUtil.getLoginUserId()); | |
98 | + | |
99 | + int updateCnt = noticeDAO.updateNotice(noticeVO); | |
100 | + if (updateCnt < 1) { | |
101 | + throw new RuntimeException("수정 중 오류가 발생했습니다."); | |
102 | + } | |
103 | + | |
104 | + HashMap<String, Object> result = new HashMap<>(); | |
105 | + result.put("updateCnt", updateCnt); | |
106 | + return result; | |
107 | + } | |
108 | + | |
109 | + /** | |
110 | + * @author 박정하 | |
111 | + * @since 2025.01.21 | |
112 | + * | |
113 | + * 공지사항 조회수 수정 | |
114 | + */ | |
115 | + @Override | |
116 | + public HashMap<String, Object> updateNoticeHits(NoticeVO noticeVO) throws Exception { | |
117 | + int updateCnt = noticeDAO.updateNoticeHits(noticeVO); | |
118 | + if (updateCnt < 1) { | |
119 | + throw new RuntimeException("조회 중 오류가 발생했습니다."); | |
120 | + } | |
121 | + | |
122 | + HashMap<String, Object> result = new HashMap<>(); | |
123 | + result.put("updateCnt", updateCnt); | |
124 | + return result; | |
125 | + } | |
126 | + | |
127 | + /** | |
128 | + * @author 박정하 | |
129 | + * @since 2025.01.21 | |
130 | + * | |
131 | + * 공지사항 삭제 | |
132 | + */ | |
133 | + @Override | |
134 | + public HashMap<String, Object> deleteNotice(NoticeVO noticeVO) throws Exception { | |
135 | + int updateCnt = noticeDAO.deleteNotice(noticeVO); | |
136 | + if (updateCnt < 1) { | |
137 | + throw new RuntimeException("삭제 중 오류가 발생했습니다."); | |
138 | + } | |
139 | + | |
140 | + HashMap<String, Object> result = new HashMap<>(); | |
141 | + result.put("updateCnt", updateCnt); | |
142 | + return result; | |
143 | + } | |
144 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/community/vo/FaqVO.java
... | ... | @@ -0,0 +1,17 @@ |
1 | +package com.takensoft.taken_bi_manager.community.vo; | |
2 | + | |
3 | +import lombok.Data; | |
4 | + | |
5 | +import java.sql.Timestamp; | |
6 | + | |
7 | +@Data | |
8 | +public class FaqVO { | |
9 | + private String faqId; | |
10 | + private String faqQuestion; | |
11 | + private String faqAnswer; | |
12 | + private String faqInsertUserId; | |
13 | + private Timestamp faqInsertDatetime; | |
14 | + private String faqUpdateUserId; | |
15 | + private Timestamp faqUpdateDatetime; | |
16 | + private int faqIsUse = 1; | |
17 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/community/vo/NoticeVO.java
... | ... | @@ -0,0 +1,20 @@ |
1 | +package com.takensoft.taken_bi_manager.community.vo; | |
2 | + | |
3 | +import lombok.Data; | |
4 | + | |
5 | +import java.sql.Timestamp; | |
6 | + | |
7 | +@Data | |
8 | +public class NoticeVO { | |
9 | + private String noticeId; | |
10 | + private String noticeTitle; | |
11 | + private String noticeContent; | |
12 | + private int noticeIsFix = 0; | |
13 | + private int noticeIsUse = 1; | |
14 | + private int noticeHits; | |
15 | + private String noticeInsertUserId; | |
16 | + private Timestamp noticeInsertDatetime; | |
17 | + private String noticeUpdateUserId; | |
18 | + private Timestamp noticeUpdateDatetime; | |
19 | + private String fileManagerId; | |
20 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/community/web/FaqController.java
... | ... | @@ -0,0 +1,122 @@ |
1 | +package com.takensoft.taken_bi_manager.community.web; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.common.vo.CheckMessage; | |
4 | +import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; | |
5 | +import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
6 | +import com.takensoft.taken_bi_manager.community.service.FaqService; | |
7 | +import com.takensoft.taken_bi_manager.community.vo.FaqVO; | |
8 | +import lombok.RequiredArgsConstructor; | |
9 | +import org.springframework.http.HttpStatus; | |
10 | +import org.springframework.web.bind.annotation.*; | |
11 | + | |
12 | +@RestController | |
13 | +@RequiredArgsConstructor | |
14 | +@RequestMapping(value = "/faq") | |
15 | +public class FaqController { | |
16 | + private final FaqService faqService; | |
17 | + | |
18 | + /** | |
19 | + * @author 박정하 | |
20 | + * @since 2025.01.21 | |
21 | + * | |
22 | + * Faq 목록 조회 | |
23 | + */ | |
24 | + @PostMapping(value = "/list") | |
25 | + public CustomeResultMap selectFaqList(@RequestBody SearchVO searchVO) { | |
26 | + CustomeResultMap resultMap = new CustomeResultMap(); | |
27 | + | |
28 | + try { | |
29 | + resultMap.setResultData(faqService.selectFaqList(searchVO)); | |
30 | + } catch (RuntimeException e) { | |
31 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value())); | |
32 | + } catch (Exception e) { | |
33 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value())); | |
34 | + } | |
35 | + | |
36 | + return resultMap; | |
37 | + } | |
38 | + | |
39 | + /** | |
40 | + * @author 박정하 | |
41 | + * @since 2025.01.21 | |
42 | + * | |
43 | + * Faq 상세 조회 | |
44 | + */ | |
45 | + @GetMapping | |
46 | + public CustomeResultMap selectFaqById(@RequestParam(value = "faqId", required = false) String faqId) { | |
47 | + CustomeResultMap resultMap = new CustomeResultMap(); | |
48 | + | |
49 | + try { | |
50 | + resultMap.setResultData(faqService.selectFaqById(faqId)); | |
51 | + } catch (RuntimeException e) { | |
52 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value())); | |
53 | + } catch (Exception e) { | |
54 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value())); | |
55 | + } | |
56 | + | |
57 | + return resultMap; | |
58 | + } | |
59 | + | |
60 | + /** | |
61 | + * @author 박정하 | |
62 | + * @since 2025.01.21 | |
63 | + * | |
64 | + * Faq 등록 | |
65 | + */ | |
66 | + @PostMapping | |
67 | + public CustomeResultMap insertFaq(@RequestBody FaqVO faqVO) { | |
68 | + CustomeResultMap resultMap = new CustomeResultMap(); | |
69 | + | |
70 | + try { | |
71 | + resultMap.setResultData(faqService.insertFaq(faqVO)); | |
72 | + } catch (RuntimeException e) { | |
73 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value())); | |
74 | + } catch (Exception e) { | |
75 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value())); | |
76 | + } | |
77 | + | |
78 | + return resultMap; | |
79 | + } | |
80 | + | |
81 | + /** | |
82 | + * @author 박정하 | |
83 | + * @since 2025.01.21 | |
84 | + * | |
85 | + * Faq 수정 | |
86 | + */ | |
87 | + @PutMapping | |
88 | + public CustomeResultMap updateFaq(@RequestBody FaqVO faqVO) { | |
89 | + CustomeResultMap resultMap = new CustomeResultMap(); | |
90 | + | |
91 | + try { | |
92 | + resultMap.setResultData(faqService.updateFaq(faqVO)); | |
93 | + } catch (RuntimeException e) { | |
94 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value())); | |
95 | + } catch (Exception e) { | |
96 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value())); | |
97 | + } | |
98 | + | |
99 | + return resultMap; | |
100 | + } | |
101 | + | |
102 | + /** | |
103 | + * @author 박정하 | |
104 | + * @since 2025.01.21 | |
105 | + * | |
106 | + * Faq 삭제 | |
107 | + */ | |
108 | + @PatchMapping | |
109 | + public CustomeResultMap deleteFaq(@RequestBody FaqVO faqVO) throws Exception { | |
110 | + CustomeResultMap resultMap = new CustomeResultMap(); | |
111 | + | |
112 | + try { | |
113 | + resultMap.setResultData(faqService.deleteFaq(faqVO)); | |
114 | + } catch (RuntimeException e) { | |
115 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value())); | |
116 | + } catch (Exception e) { | |
117 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value())); | |
118 | + } | |
119 | + | |
120 | + return resultMap; | |
121 | + } | |
122 | +}(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/java/com/takensoft/taken_bi_manager/community/web/NoticeController.java
... | ... | @@ -0,0 +1,143 @@ |
1 | +package com.takensoft.taken_bi_manager.community.web; | |
2 | + | |
3 | +import com.takensoft.taken_bi_manager.common.vo.CheckMessage; | |
4 | +import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap; | |
5 | +import com.takensoft.taken_bi_manager.common.vo.SearchVO; | |
6 | +import com.takensoft.taken_bi_manager.community.service.NoticeService; | |
7 | +import com.takensoft.taken_bi_manager.community.vo.NoticeVO; | |
8 | +import lombok.RequiredArgsConstructor; | |
9 | +import org.springframework.http.HttpStatus; | |
10 | +import org.springframework.web.bind.annotation.*; | |
11 | + | |
12 | +@RestController | |
13 | +@RequiredArgsConstructor | |
14 | +@RequestMapping(value = "/notice") | |
15 | +public class NoticeController { | |
16 | + private final NoticeService noticeService; | |
17 | + | |
18 | + /** | |
19 | + * @author 박정하 | |
20 | + * @since 2025.01.21 | |
21 | + * | |
22 | + * 공지사항 목록 조회 | |
23 | + */ | |
24 | + @PostMapping(value = "/list") | |
25 | + public CustomeResultMap selectNoticeList(@RequestBody SearchVO searchVO) { | |
26 | + CustomeResultMap resultMap = new CustomeResultMap(); | |
27 | + | |
28 | + try { | |
29 | + resultMap.setResultData(noticeService.selectNoticeList(searchVO)); | |
30 | + } catch (RuntimeException e) { | |
31 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value())); | |
32 | + } catch (Exception e) { | |
33 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value())); | |
34 | + } | |
35 | + | |
36 | + return resultMap; | |
37 | + } | |
38 | + | |
39 | + /** | |
40 | + * @author 박정하 | |
41 | + * @since 2025.01.21 | |
42 | + * | |
43 | + * 공지사항 상세 조회 | |
44 | + */ | |
45 | + @GetMapping | |
46 | + public CustomeResultMap selectNoticeById(@RequestParam(value = "noticeId", required = false) String noticeId) { | |
47 | + CustomeResultMap resultMap = new CustomeResultMap(); | |
48 | + | |
49 | + try { | |
50 | + resultMap.setResultData(noticeService.selectNoticeById(noticeId)); | |
51 | + } catch (RuntimeException e) { | |
52 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value())); | |
53 | + } catch (Exception e) { | |
54 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value())); | |
55 | + } | |
56 | + | |
57 | + return resultMap; | |
58 | + } | |
59 | + | |
60 | + /** | |
61 | + * @author 박정하 | |
62 | + * @since 2025.01.21 | |
63 | + * | |
64 | + * 공지사항 등록 | |
65 | + */ | |
66 | + @PostMapping | |
67 | + public CustomeResultMap insertNotice(@RequestBody NoticeVO noticeVO) { | |
68 | + CustomeResultMap resultMap = new CustomeResultMap(); | |
69 | + | |
70 | + try { | |
71 | + resultMap.setResultData(noticeService.insertNotice(noticeVO)); | |
72 | + } catch (RuntimeException e) { | |
73 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value())); | |
74 | + } catch (Exception e) { | |
75 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value())); | |
76 | + } | |
77 | + | |
78 | + return resultMap; | |
79 | + } | |
80 | + | |
81 | + /** | |
82 | + * @author 박정하 | |
83 | + * @since 2025.01.21 | |
84 | + * | |
85 | + * 공지사항 수정 | |
86 | + */ | |
87 | + @PutMapping | |
88 | + public CustomeResultMap updateNotice(@RequestBody NoticeVO noticeVO) { | |
89 | + CustomeResultMap resultMap = new CustomeResultMap(); | |
90 | + | |
91 | + try { | |
92 | + resultMap.setResultData(noticeService.updateNotice(noticeVO)); | |
93 | + } catch (RuntimeException e) { | |
94 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value())); | |
95 | + } catch (Exception e) { | |
96 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value())); | |
97 | + } | |
98 | + | |
99 | + return resultMap; | |
100 | + } | |
101 | + | |
102 | + /** | |
103 | + * @author 박정하 | |
104 | + * @since 2025.01.21 | |
105 | + * | |
106 | + * 공지사항 조회수 수정 | |
107 | + */ | |
108 | + @PatchMapping(value = "/hits") | |
109 | + public CustomeResultMap updateNoticeHits(@RequestBody NoticeVO noticeVO) throws Exception { | |
110 | + CustomeResultMap resultMap = new CustomeResultMap(); | |
111 | + | |
112 | + try { | |
113 | + resultMap.setResultData(noticeService.updateNoticeHits(noticeVO)); | |
114 | + } catch (RuntimeException e) { | |
115 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value())); | |
116 | + } catch (Exception e) { | |
117 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value())); | |
118 | + } | |
119 | + | |
120 | + return resultMap; | |
121 | + } | |
122 | + | |
123 | + /** | |
124 | + * @author 박정하 | |
125 | + * @since 2025.01.21 | |
126 | + * | |
127 | + * 공지사항 삭제 | |
128 | + */ | |
129 | + @PatchMapping | |
130 | + public CustomeResultMap deleteNotice(@RequestBody NoticeVO noticeVO) throws Exception { | |
131 | + CustomeResultMap resultMap = new CustomeResultMap(); | |
132 | + | |
133 | + try { | |
134 | + resultMap.setResultData(noticeService.deleteNotice(noticeVO)); | |
135 | + } catch (RuntimeException e) { | |
136 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value())); | |
137 | + } catch (Exception e) { | |
138 | + resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value())); | |
139 | + } | |
140 | + | |
141 | + return resultMap; | |
142 | + } | |
143 | +}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/taken_bi_manager/openAPI/service/impl/OpenApiServiceImpl.java
+++ src/main/java/com/takensoft/taken_bi_manager/openAPI/service/impl/OpenApiServiceImpl.java
... | ... | @@ -169,20 +169,23 @@ |
169 | 169 |
|
170 | 170 |
|
171 | 171 |
DataTable dataTable = new DataTable(dataset); |
172 |
- |
|
173 | 172 |
dataTable.setColumnDatas(datasetDAO.selectCoulmnInfo(dataset)); |
174 | 173 |
DBConnectionUtil dbUtil = new DBConnectionUtil(); |
175 | 174 |
connectionDB.decodingData(); |
176 | 175 |
|
177 | 176 |
// param으로 Query 조건문 만들기 |
178 | 177 |
param.remove("serviceKey"); |
179 |
- if (param.get("pageNo") != null && CommonUtil.parseInt(param.get("pageNo")) > 0) { |
|
180 |
- dataTable.setCurrentPage(CommonUtil.parseInt(param.get("pageNo"))); |
|
181 |
- param.remove("pageNo"); |
|
178 |
+ if (param.get("currentPage") != null && CommonUtil.parseInt(param.get("currentPage")) > 0) { |
|
179 |
+ // OFFSET 계산 |
|
180 |
+ int currentPage = CommonUtil.parseInt(param.get("currentPage")); |
|
181 |
+ int perPage = CommonUtil.parseInt(param.get("perPage") != null ? param.get("perPage") : 30); // 기본값 30 |
|
182 |
+ int offset = (currentPage - 1) * perPage; |
|
183 |
+ dataTable.setOffset(offset); // OFFSET 설정 |
|
184 |
+ param.remove("currentPage"); |
|
182 | 185 |
} |
183 |
- if (param.get("numOfRows") != null && CommonUtil.parseInt(param.get("numOfRows")) > 0) { |
|
184 |
- dataTable.setPerPage(CommonUtil.parseInt(param.get("numOfRows"))); |
|
185 |
- param.remove("numOfRows"); |
|
186 |
+ if (param.get("perPage") != null && CommonUtil.parseInt(param.get("perPage")) > 0) { |
|
187 |
+ dataTable.setPerPage(CommonUtil.parseInt(param.get("perPage"))); |
|
188 |
+ param.remove("perPage"); |
|
186 | 189 |
} |
187 | 190 |
String query = buildQueryCondition(param , dataTable.getColumnDatas()); |
188 | 191 |
System.out.println("조건문 쿼리문 " + query); |
+++ src/main/resources/spring/mapper/community/faq-SQL.xml
... | ... | @@ -0,0 +1,128 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="com.takensoft.taken_bi_manager.community.dao.FaqDAO"> | |
4 | + <!-- FaQ resultMap --> | |
5 | + <resultMap id="faqResult" type="FaqVO"> | |
6 | + <result property="faqId" column="faq_id"/> | |
7 | + <result property="faqQuestion" column="faq_question"/> | |
8 | + <result property="faqAnswer" column="faq_answer"/> | |
9 | + <result property="faqInsertUserId" column="faq_insert_user_id"/> | |
10 | + <result property="faqInsertDatetime" column="faq_insert_datetime"/> | |
11 | + <result property="faqUpdateUserId" column="faq_update_user_id"/> | |
12 | + <result property="faqUpdateDatetime" column="faq_update_datetime"/> | |
13 | + <result property="faqIsUse" column="faq_is_use"/> | |
14 | + </resultMap> | |
15 | + | |
16 | + <!-- Faq 목록 조회 --> | |
17 | + <select id="selectFaqList" parameterType="SearchVO" resultMap="faqResult"> | |
18 | + SELECT faq_id | |
19 | + , faq_question | |
20 | + , faq_answer | |
21 | + , faq_insert_user_id | |
22 | + , faq_insert_datetime | |
23 | + , faq_update_user_id | |
24 | + , faq_update_datetime | |
25 | + , faq_is_use | |
26 | + FROM cmmnty_faq | |
27 | + WHERE faq_is_use = 1 | |
28 | + <!-- S.검색 영역 --> | |
29 | + <foreach item="item" index="index" collection="searchObjectList"> | |
30 | + <choose> | |
31 | + <when test="item.type == 'dates'"> | |
32 | + AND #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp | |
33 | + AND ${item.key2}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY | |
34 | + </when> | |
35 | + <when test="item.key != null and item.key !='' and item.value != null and item.value != ''"> | |
36 | + AND ${item.key} LIKE CONCAT('%', #{item.value}, '%') | |
37 | + </when> | |
38 | + <when test="item.key == null and item.value != null and item.value !=''"> | |
39 | + AND ( | |
40 | + faq_question LIKE CONCAT('%', #{item.value}, '%') | |
41 | + OR faq_answer LIKE CONCAT('%', #{item.value}, '%') | |
42 | + ) | |
43 | + </when> | |
44 | + </choose> | |
45 | + </foreach> | |
46 | + <!-- E.검색 영역 --> | |
47 | + ORDER BY faq_insert_datetime DESC | |
48 | + LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage}) | |
49 | + </select> | |
50 | + | |
51 | + <!-- Faq 개수 조회 --> | |
52 | + <select id="selectFaqCount" parameterType="SearchVO"> | |
53 | + SELECT COUNT(*) | |
54 | + FROM cmmnty_faq | |
55 | + WHERE faq_is_use = 1 | |
56 | + <!-- S.검색 영역 --> | |
57 | + <foreach item="item" index="index" collection="searchObjectList"> | |
58 | + <choose> | |
59 | + <when test="item.type == 'dates'"> | |
60 | + AND #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp | |
61 | + AND ${item.key2}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY | |
62 | + </when> | |
63 | + <when test="item.key != null and item.key !='' and item.value != null and item.value != ''"> | |
64 | + AND ${item.key} LIKE CONCAT('%', #{item.value}, '%') | |
65 | + </when> | |
66 | + <when test="item.key == null and item.value != null and item.value !=''"> | |
67 | + AND ( | |
68 | + faq_question LIKE CONCAT('%', #{item.value}, '%') | |
69 | + OR faq_answer LIKE CONCAT('%', #{item.value}, '%') | |
70 | + ) | |
71 | + </when> | |
72 | + </choose> | |
73 | + </foreach> | |
74 | + <!-- E.검색 영역 --> | |
75 | + </select> | |
76 | + | |
77 | + <!-- Faq 상세 조회 --> | |
78 | + <select id="selectFaqById" parameterType="String" resultMap="faqResult"> | |
79 | + SELECT faq_id | |
80 | + , faq_question | |
81 | + , faq_answer | |
82 | + , faq_insert_user_id | |
83 | + , faq_insert_datetime | |
84 | + , faq_update_user_id | |
85 | + , faq_update_datetime | |
86 | + , faq_is_use | |
87 | + FROM cmmnty_faq | |
88 | + WHERE faq_is_use = 1 | |
89 | + AND faq_id = #{faqId} | |
90 | + </select> | |
91 | + | |
92 | + <!-- Faq 등록 --> | |
93 | + <insert id="insertFaq" parameterType="FaqVO"> | |
94 | + INSERT INTO cmmnty_faq ( | |
95 | + faq_id, | |
96 | + faq_question, | |
97 | + faq_answer, | |
98 | + faq_insert_user_id, | |
99 | + faq_insert_datetime, | |
100 | + faq_is_use | |
101 | + ) VALUES ( | |
102 | + #{faqId}, | |
103 | + #{faqQuestion}, | |
104 | + #{faqAnswer}, | |
105 | + #{faqInsertUserId}, | |
106 | + NOW(), | |
107 | + #{faqIsUse} | |
108 | + ) | |
109 | + </insert> | |
110 | + | |
111 | + <!-- Faq 수정 --> | |
112 | + <update id="updateFaq" parameterType="FaqVO"> | |
113 | + UPDATE cmmnty_faq | |
114 | + SET faq_question = #{faqQuestion}, | |
115 | + faq_answer = #{faqAnswer}, | |
116 | + faq_update_user_id = #{faqUpdateUserId}, | |
117 | + faq_update_datetime = NOW(), | |
118 | + faq_is_use = #{faqIsUse} | |
119 | + WHERE faq_id = #{faqId} | |
120 | + </update> | |
121 | + | |
122 | + <!-- Faq 삭제 --> | |
123 | + <update id="deleteFaq" parameterType="FaqVO"> | |
124 | + UPDATE cmmnty_faq | |
125 | + SET faq_is_use = 0 | |
126 | + WHERE faq_id = #{faqId} | |
127 | + </update> | |
128 | +</mapper>(파일 끝에 줄바꿈 문자 없음) |
+++ src/main/resources/spring/mapper/community/notice-SQL.xml
... | ... | @@ -0,0 +1,153 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="com.takensoft.taken_bi_manager.community.dao.NoticeDAO"> | |
4 | + <!-- 공지사항 resultMap --> | |
5 | + <resultMap id="noticeResult" type="NoticeVO"> | |
6 | + <result property="noticeId" column="notice_id"/> | |
7 | + <result property="noticeTitle" column="notice_title"/> | |
8 | + <result property="noticeContent" column="notice_content"/> | |
9 | + <result property="noticeIsFix" column="notice_is_fix"/> | |
10 | + <result property="noticeIsUse" column="notice_is_use"/> | |
11 | + <result property="noticeHits" column="notice_hits"/> | |
12 | + <result property="noticeInsertUserId" column="notice_insert_user_id"/> | |
13 | + <result property="noticeInsertDatetime" column="notice_insert_datetime"/> | |
14 | + <result property="noticeUpdateUserId" column="notice_update_user_id"/> | |
15 | + <result property="noticeUpdateDatetime" column="notice_update_datetime"/> | |
16 | + <result property="fileManagerId" column="file_manager_id"/> | |
17 | + </resultMap> | |
18 | + | |
19 | + <!-- 공지사항 목록 조회 --> | |
20 | + <select id="selectNoticeList" parameterType="SearchVO" resultMap="noticeResult"> | |
21 | + SELECT notice_id | |
22 | + , notice_title | |
23 | + , notice_content | |
24 | + , notice_is_fix | |
25 | + , notice_is_use | |
26 | + , notice_hits | |
27 | + , notice_insert_user_id | |
28 | + , notice_insert_datetime | |
29 | + , notice_update_user_id | |
30 | + , notice_update_datetime | |
31 | + , file_manager_id | |
32 | + FROM cmmnty_notice | |
33 | + WHERE notice_is_use = 1 | |
34 | + <!-- S.검색 영역 --> | |
35 | + <foreach item="item" index="index" collection="searchObjectList"> | |
36 | + <choose> | |
37 | + <when test="item.type == 'dates'"> | |
38 | + AND #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp | |
39 | + AND ${item.key2}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY | |
40 | + </when> | |
41 | + <when test="item.key != null and item.key !='' and item.value != null and item.value != ''"> | |
42 | + AND ${item.key} LIKE CONCAT('%', #{item.value}, '%') | |
43 | + </when> | |
44 | + <when test="item.key == null and item.value != null and item.value !=''"> | |
45 | + AND ( | |
46 | + notice_title LIKE CONCAT('%', #{item.value}, '%') | |
47 | + OR notice_content LIKE CONCAT('%', #{item.value}, '%') | |
48 | + ) | |
49 | + </when> | |
50 | + </choose> | |
51 | + </foreach> | |
52 | + <!-- E.검색 영역 --> | |
53 | + ORDER BY notice_insert_datetime DESC | |
54 | + LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage}) | |
55 | + </select> | |
56 | + | |
57 | + <!-- 공지사항 개수 조회 --> | |
58 | + <select id="selectNoticeCount" parameterType="SearchVO"> | |
59 | + SELECT COUNT(*) | |
60 | + FROM cmmnty_notice | |
61 | + WHERE notice_is_use = 1 | |
62 | + <!-- S.검색 영역 --> | |
63 | + <foreach item="item" index="index" collection="searchObjectList"> | |
64 | + <choose> | |
65 | + <when test="item.type == 'dates'"> | |
66 | + AND #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp | |
67 | + AND ${item.key2}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY | |
68 | + </when> | |
69 | + <when test="item.key != null and item.key !='' and item.value != null and item.value != ''"> | |
70 | + AND ${item.key} LIKE CONCAT('%', #{item.value}, '%') | |
71 | + </when> | |
72 | + <when test="item.key == null and item.value != null and item.value !=''"> | |
73 | + AND ( | |
74 | + notice_title LIKE CONCAT('%', #{item.value}, '%') | |
75 | + OR notice_content LIKE CONCAT('%', #{item.value}, '%') | |
76 | + ) | |
77 | + </when> | |
78 | + </choose> | |
79 | + </foreach> | |
80 | + <!-- E.검색 영역 --> | |
81 | + </select> | |
82 | + | |
83 | + <!-- 공지사항 상세 조회 --> | |
84 | + <select id="selectNoticeById" parameterType="String" resultMap="noticeResult"> | |
85 | + SELECT notice_id | |
86 | + , notice_title | |
87 | + , notice_content | |
88 | + , notice_is_fix | |
89 | + , notice_is_use | |
90 | + , notice_hits | |
91 | + , notice_insert_user_id | |
92 | + , notice_insert_datetime | |
93 | + , notice_update_user_id | |
94 | + , notice_update_datetime | |
95 | + , file_manager_id | |
96 | + FROM cmmnty_notice | |
97 | + WHERE notice_is_use = 1 | |
98 | + AND notice_id = #{noticeId} | |
99 | + </select> | |
100 | + | |
101 | + <!-- 공지사항 등록 --> | |
102 | + <insert id="insertNotice" parameterType="NoticeVO"> | |
103 | + INSERT INTO cmmnty_notice ( | |
104 | + notice_id, | |
105 | + notice_title, | |
106 | + notice_content, | |
107 | + notice_is_fix, | |
108 | + notice_is_use, | |
109 | + notice_hits, | |
110 | + notice_insert_user_id, | |
111 | + notice_insert_datetime, | |
112 | + file_manager_id | |
113 | + ) VALUES ( | |
114 | + #{noticeId}, | |
115 | + #{noticeTitle}, | |
116 | + #{noticeContent}, | |
117 | + #{noticeIsFix}, | |
118 | + #{noticeIsUse}, | |
119 | + #{noticeHits}, | |
120 | + #{noticeInsertUserId}, | |
121 | + NOW(), | |
122 | + #{fileManagerId} | |
123 | + ) | |
124 | + </insert> | |
125 | + | |
126 | + <!-- 공지사항 수정 --> | |
127 | + <update id="updateNotice" parameterType="NoticeVO"> | |
128 | + UPDATE cmmnty_notice | |
129 | + SET notice_title = #{noticeTitle}, | |
130 | + notice_content = #{noticeContent}, | |
131 | + notice_is_fix = #{noticeIsFix}, | |
132 | + notice_is_use = #{noticeIsUse}, | |
133 | + notice_hits = #{noticeHits}, | |
134 | + notice_update_user_id = #{noticeUpdateUserId}, | |
135 | + notice_update_datetime = NOW(), | |
136 | + file_manager_id = #{fileManagerId} | |
137 | + WHERE notice_id = #{noticeId} | |
138 | + </update> | |
139 | + | |
140 | + <!-- 공지사항 조회수 수정 --> | |
141 | + <update id="updateNoticeHits" parameterType="NoticeVO"> | |
142 | + UPDATE cmmnty_notice | |
143 | + SET notice_hits = cmmnty_notice.notice_hits + 1 | |
144 | + WHERE notice_id = #{noticeId} | |
145 | + </update> | |
146 | + | |
147 | + <!-- 공지사항 조회수 수정 --> | |
148 | + <update id="deleteNotice" parameterType="NoticeVO"> | |
149 | + UPDATE cmmnty_notice | |
150 | + SET notice_is_use = 0 | |
151 | + WHERE notice_id = #{noticeId} | |
152 | + </update> | |
153 | +</mapper>(파일 끝에 줄바꿈 문자 없음) |
--- src/main/resources/spring/mapper/mybatis-config.xml
+++ src/main/resources/spring/mapper/mybatis-config.xml
... | ... | @@ -95,5 +95,8 @@ |
95 | 95 |
<typeAlias type="com.takensoft.taken_bi_manager.openAPI.vo.ApiConnectVO" alias="ApiConnectVO"/> |
96 | 96 |
<typeAlias type="com.takensoft.taken_bi_manager.openAPI.vo.ApiParamVO" alias="ApiParamVO"/> |
97 | 97 |
<typeAlias type="com.takensoft.taken_bi_manager.openAPI.vo.OpenApiKeyVO" alias="OpenApiKeyVO"/> |
98 |
+ |
|
99 |
+ <typeAlias type="com.takensoft.taken_bi_manager.community.vo.NoticeVO" alias="NoticeVO"/> |
|
100 |
+ <typeAlias type="com.takensoft.taken_bi_manager.community.vo.FaqVO" alias="FaqVO"/> |
|
98 | 101 |
</typeAliases> |
99 | 102 |
</configuration>(파일 끝에 줄바꿈 문자 없음) |
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?