하관우 하관우 04-28
2025-04-28 하관우 커뮤니티관리 추가
@35bcf6a6d41d7fa9f27b33dde3d6ddad895494d1
 
src/main/java/com/takensoft/taken_bi_manager/community/dao/FaqDAO.java (added)
+++ src/main/java/com/takensoft/taken_bi_manager/community/dao/FaqDAO.java
@@ -0,0 +1,58 @@
+package com.takensoft.taken_bi_manager.community.dao;
+
+import com.takensoft.taken_bi_manager.common.vo.SearchVO;
+import com.takensoft.taken_bi_manager.community.vo.FaqVO;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface FaqDAO {
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 목록 조회
+     */
+    public List<FaqVO> selectFaqList(SearchVO searchVO) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 개수 조회
+     */
+    public int selectFaqCount(SearchVO searchVO) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 상세 조회
+     */
+    public FaqVO selectFaqById(String faqId) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 등록
+     */
+    public int insertFaq(FaqVO faqVO) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 수정
+     */
+    public int updateFaq(FaqVO faqVO) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 삭제
+     */
+    public int deleteFaq(FaqVO faqVO) throws Exception;
+}(파일 끝에 줄바꿈 문자 없음)
 
src/main/java/com/takensoft/taken_bi_manager/community/dao/NoticeDAO.java (added)
+++ src/main/java/com/takensoft/taken_bi_manager/community/dao/NoticeDAO.java
@@ -0,0 +1,66 @@
+package com.takensoft.taken_bi_manager.community.dao;
+
+import com.takensoft.taken_bi_manager.common.vo.SearchVO;
+import com.takensoft.taken_bi_manager.community.vo.NoticeVO;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface NoticeDAO {
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 목록 조회
+     */
+    public List<NoticeVO> selectNoticeList(SearchVO searchVO) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 개수 조회
+     */
+    public int selectNoticeCount(SearchVO searchVO) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 상세 조회
+     */
+    public NoticeVO selectNoticeById(String noticeId) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 등록
+     */
+    public int insertNotice(NoticeVO noticeVO) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 수정
+     */
+    public int updateNotice(NoticeVO noticeVO) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 조회수 수정
+     */
+    public int updateNoticeHits(NoticeVO noticeVO) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 삭제
+     */
+    public int deleteNotice(NoticeVO noticeVO) throws Exception;
+}(파일 끝에 줄바꿈 문자 없음)
 
src/main/java/com/takensoft/taken_bi_manager/community/service/FaqService.java (added)
+++ src/main/java/com/takensoft/taken_bi_manager/community/service/FaqService.java
@@ -0,0 +1,48 @@
+package com.takensoft.taken_bi_manager.community.service;
+
+import com.takensoft.taken_bi_manager.common.vo.SearchVO;
+import com.takensoft.taken_bi_manager.community.vo.FaqVO;
+
+import java.util.HashMap;
+
+public interface FaqService {
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 목록 조회
+     */
+    public HashMap<String, Object> selectFaqList(SearchVO searchVO) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 상세 조회
+     */
+    public HashMap<String, Object> selectFaqById(String faqId) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 등록
+     */
+    public HashMap<String, Object> insertFaq(FaqVO faqVO) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 수정
+     */
+    public HashMap<String, Object> updateFaq(FaqVO faqVO) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 삭제
+     */
+    public HashMap<String, Object> deleteFaq(FaqVO faqVO) throws Exception;
+}(파일 끝에 줄바꿈 문자 없음)
 
src/main/java/com/takensoft/taken_bi_manager/community/service/NoticeService.java (added)
+++ src/main/java/com/takensoft/taken_bi_manager/community/service/NoticeService.java
@@ -0,0 +1,56 @@
+package com.takensoft.taken_bi_manager.community.service;
+
+import com.takensoft.taken_bi_manager.common.vo.SearchVO;
+import com.takensoft.taken_bi_manager.community.vo.NoticeVO;
+
+import java.util.HashMap;
+
+public interface NoticeService {
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 목록 조회
+     */
+    public HashMap<String, Object> selectNoticeList(SearchVO searchVO) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 상세 조회
+     */
+    public HashMap<String, Object> selectNoticeById(String noticeId) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 등록
+     */
+    public HashMap<String, Object> insertNotice(NoticeVO noticeVO) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 수정
+     */
+    public HashMap<String, Object> updateNotice(NoticeVO noticeVO) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 조회수 수정
+     */
+    public HashMap<String, Object> updateNoticeHits(NoticeVO noticeVO) throws Exception;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 삭제
+     */
+    public HashMap<String, Object> deleteNotice(NoticeVO noticeVO) throws Exception;
+}(파일 끝에 줄바꿈 문자 없음)
 
src/main/java/com/takensoft/taken_bi_manager/community/service/impl/FaqServiceImpl.java (added)
+++ src/main/java/com/takensoft/taken_bi_manager/community/service/impl/FaqServiceImpl.java
@@ -0,0 +1,114 @@
+package com.takensoft.taken_bi_manager.community.service.impl;
+
+import com.takensoft.taken_bi_manager.common.util.AuthUtil;
+import com.takensoft.taken_bi_manager.common.util.CommonUtil;
+import com.takensoft.taken_bi_manager.common.vo.SearchVO;
+import com.takensoft.taken_bi_manager.community.dao.FaqDAO;
+import com.takensoft.taken_bi_manager.community.service.FaqService;
+import com.takensoft.taken_bi_manager.community.vo.FaqVO;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+
+@Service
+@RequiredArgsConstructor
+public class FaqServiceImpl implements FaqService {
+    private final FaqDAO faqDAO;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 목록 조회
+     */
+    @Override
+    public HashMap<String, Object> selectFaqList(SearchVO searchVO) throws Exception {
+        // searchVO 수정
+        searchVO.setTotalRows(faqDAO.selectFaqCount(searchVO));
+
+        HashMap<String, Object> result = new HashMap<>();
+        result.put("list", faqDAO.selectFaqList(searchVO));
+        result.put("searchVO", searchVO);
+        return result;
+    }
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 상세 조회
+     */
+    @Override
+    public HashMap<String, Object> selectFaqById(String faqId) throws Exception {
+        FaqVO faqVO = new FaqVO();
+
+        if (faqId != null && faqId != "") {
+            faqVO = faqDAO.selectFaqById(faqId);
+        }
+
+        HashMap<String, Object> result = new HashMap<>();
+        result.put("vo", faqVO);
+        return result;
+    }
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 등록
+     */
+    @Override
+    public HashMap<String, Object> insertFaq(FaqVO faqVO) throws Exception {
+        faqVO.setFaqInsertUserId(AuthUtil.getLoginUserId());
+        faqVO.setFaqId(CommonUtil.getRandKey("NOTICE"));
+
+        int insertCnt = faqDAO.insertFaq(faqVO);
+        if (insertCnt < 1) {
+            throw new RuntimeException("등록 중 오류가 발생했습니다.");
+        }
+
+        HashMap<String, Object> result = new HashMap<>();
+        result.put("insertCnt", insertCnt);
+        result.put("vo", faqVO);
+        return result;
+    }
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 수정
+     */
+    @Override
+    public HashMap<String, Object> updateFaq(FaqVO faqVO) throws Exception {
+        faqVO.setFaqUpdateUserId(AuthUtil.getLoginUserId());
+
+        int updateCnt = faqDAO.updateFaq(faqVO);
+        if (updateCnt < 1) {
+            throw new RuntimeException("수정 중 오류가 발생했습니다.");
+        }
+
+        HashMap<String, Object> result = new HashMap<>();
+        result.put("updateCnt", updateCnt);
+        return result;
+    }
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 삭제
+     */
+    @Override
+    public HashMap<String, Object> deleteFaq(FaqVO faqVO) throws Exception {
+        int updateCnt = faqDAO.deleteFaq(faqVO);
+        if (updateCnt < 1) {
+            throw new RuntimeException("삭제 중 오류가 발생했습니다.");
+        }
+
+        HashMap<String, Object> result = new HashMap<>();
+        result.put("updateCnt", updateCnt);
+        return result;
+    }
+}(파일 끝에 줄바꿈 문자 없음)
 
src/main/java/com/takensoft/taken_bi_manager/community/service/impl/NoticeServiceImpl.java (added)
+++ src/main/java/com/takensoft/taken_bi_manager/community/service/impl/NoticeServiceImpl.java
@@ -0,0 +1,144 @@
+package com.takensoft.taken_bi_manager.community.service.impl;
+
+import com.takensoft.taken_bi_manager.common.file.dao.FileDAO;
+import com.takensoft.taken_bi_manager.common.file.vo.CmmnFile;
+import com.takensoft.taken_bi_manager.common.util.AuthUtil;
+import com.takensoft.taken_bi_manager.common.util.CommonUtil;
+import com.takensoft.taken_bi_manager.common.vo.SearchVO;
+import com.takensoft.taken_bi_manager.community.dao.NoticeDAO;
+import com.takensoft.taken_bi_manager.community.service.NoticeService;
+import com.takensoft.taken_bi_manager.community.vo.NoticeVO;
+import lombok.RequiredArgsConstructor;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+@Service
+@RequiredArgsConstructor
+public class NoticeServiceImpl implements NoticeService {
+    private final NoticeDAO noticeDAO;
+    private final FileDAO fileDAO;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 목록 조회
+     */
+    @Override
+    public HashMap<String, Object> selectNoticeList(SearchVO searchVO) throws Exception {
+        // searchVO 수정
+        searchVO.setTotalRows(noticeDAO.selectNoticeCount(searchVO));
+
+        HashMap<String, Object> result = new HashMap<>();
+        result.put("list", noticeDAO.selectNoticeList(searchVO));
+        result.put("searchVO", searchVO);
+        return result;
+    }
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 상세 조회
+     */
+    @Override
+    public HashMap<String, Object> selectNoticeById(String noticeId) throws Exception {
+        NoticeVO noticeVO = new NoticeVO();
+        List<CmmnFile> fileList = new ArrayList<>();
+
+        if (noticeId != null && noticeId != "") {
+            noticeVO = noticeDAO.selectNoticeById(noticeId);
+
+            String fileManagerId = noticeVO.getFileManagerId();
+            if(fileManagerId != null){
+                fileList = fileDAO.cmmnfilesSelect(fileManagerId);
+            }
+        }
+
+        HashMap<String, Object> result = new HashMap<>();
+        result.put("vo", noticeVO);
+        result.put("fileList", fileList);
+        return result;
+    }
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 등록
+     */
+    @Override
+    public HashMap<String, Object> insertNotice(NoticeVO noticeVO) throws Exception {
+        noticeVO.setNoticeInsertUserId(AuthUtil.getLoginUserId());
+        noticeVO.setNoticeId(CommonUtil.getRandKey("NOTICE"));
+
+        int insertCnt = noticeDAO.insertNotice(noticeVO);
+        if (insertCnt < 1) {
+            throw new RuntimeException("등록 중 오류가 발생했습니다.");
+        }
+
+        HashMap<String, Object> result = new HashMap<>();
+        result.put("insertCnt", insertCnt);
+        result.put("vo", noticeVO);
+        return result;
+    }
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 수정
+     */
+    @Override
+    public HashMap<String, Object> updateNotice(NoticeVO noticeVO) throws Exception {
+        noticeVO.setNoticeUpdateUserId(AuthUtil.getLoginUserId());
+
+        int updateCnt = noticeDAO.updateNotice(noticeVO);
+        if (updateCnt < 1) {
+            throw new RuntimeException("수정 중 오류가 발생했습니다.");
+        }
+
+        HashMap<String, Object> result = new HashMap<>();
+        result.put("updateCnt", updateCnt);
+        return result;
+    }
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 조회수 수정
+     */
+    @Override
+    public HashMap<String, Object> updateNoticeHits(NoticeVO noticeVO) throws Exception {
+        int updateCnt = noticeDAO.updateNoticeHits(noticeVO);
+        if (updateCnt < 1) {
+            throw new RuntimeException("조회 중 오류가 발생했습니다.");
+        }
+
+        HashMap<String, Object> result = new HashMap<>();
+        result.put("updateCnt", updateCnt);
+        return result;
+    }
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 삭제
+     */
+    @Override
+    public HashMap<String, Object> deleteNotice(NoticeVO noticeVO) throws Exception {
+        int updateCnt = noticeDAO.deleteNotice(noticeVO);
+        if (updateCnt < 1) {
+            throw new RuntimeException("삭제 중 오류가 발생했습니다.");
+        }
+
+        HashMap<String, Object> result = new HashMap<>();
+        result.put("updateCnt", updateCnt);
+        return result;
+    }
+}(파일 끝에 줄바꿈 문자 없음)
 
src/main/java/com/takensoft/taken_bi_manager/community/vo/FaqVO.java (added)
+++ src/main/java/com/takensoft/taken_bi_manager/community/vo/FaqVO.java
@@ -0,0 +1,17 @@
+package com.takensoft.taken_bi_manager.community.vo;
+
+import lombok.Data;
+
+import java.sql.Timestamp;
+
+@Data
+public class FaqVO {
+    private String faqId;
+    private String faqQuestion;
+    private String faqAnswer;
+    private String faqInsertUserId;
+    private Timestamp faqInsertDatetime;
+    private String faqUpdateUserId;
+    private Timestamp faqUpdateDatetime;
+    private int faqIsUse = 1;
+}(파일 끝에 줄바꿈 문자 없음)
 
src/main/java/com/takensoft/taken_bi_manager/community/vo/NoticeVO.java (added)
+++ src/main/java/com/takensoft/taken_bi_manager/community/vo/NoticeVO.java
@@ -0,0 +1,20 @@
+package com.takensoft.taken_bi_manager.community.vo;
+
+import lombok.Data;
+
+import java.sql.Timestamp;
+
+@Data
+public class NoticeVO {
+    private String noticeId;
+    private String noticeTitle;
+    private String noticeContent;
+    private int noticeIsFix = 0;
+    private int noticeIsUse = 1;
+    private int noticeHits;
+    private String noticeInsertUserId;
+    private Timestamp noticeInsertDatetime;
+    private String noticeUpdateUserId;
+    private Timestamp noticeUpdateDatetime;
+    private String fileManagerId;
+}(파일 끝에 줄바꿈 문자 없음)
 
src/main/java/com/takensoft/taken_bi_manager/community/web/FaqController.java (added)
+++ src/main/java/com/takensoft/taken_bi_manager/community/web/FaqController.java
@@ -0,0 +1,122 @@
+package com.takensoft.taken_bi_manager.community.web;
+
+import com.takensoft.taken_bi_manager.common.vo.CheckMessage;
+import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap;
+import com.takensoft.taken_bi_manager.common.vo.SearchVO;
+import com.takensoft.taken_bi_manager.community.service.FaqService;
+import com.takensoft.taken_bi_manager.community.vo.FaqVO;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequiredArgsConstructor
+@RequestMapping(value = "/faq")
+public class FaqController {
+    private final FaqService faqService;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 목록 조회
+     */
+    @PostMapping(value = "/list")
+    public CustomeResultMap selectFaqList(@RequestBody SearchVO searchVO) {
+        CustomeResultMap resultMap = new CustomeResultMap();
+
+        try {
+            resultMap.setResultData(faqService.selectFaqList(searchVO));
+        } catch (RuntimeException e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value()));
+        } catch (Exception e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value()));
+        }
+
+        return resultMap;
+    }
+    
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 상세 조회
+     */
+    @GetMapping
+    public CustomeResultMap selectFaqById(@RequestParam(value = "faqId", required = false) String faqId) {
+        CustomeResultMap resultMap = new CustomeResultMap();
+
+        try {
+            resultMap.setResultData(faqService.selectFaqById(faqId));
+        } catch (RuntimeException e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value()));
+        } catch (Exception e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value()));
+        }
+
+        return resultMap;
+    }
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 등록
+     */
+    @PostMapping
+    public CustomeResultMap insertFaq(@RequestBody FaqVO faqVO) {
+        CustomeResultMap resultMap = new CustomeResultMap();
+
+        try {
+            resultMap.setResultData(faqService.insertFaq(faqVO));
+        } catch (RuntimeException e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value()));
+        } catch (Exception e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value()));
+        }
+
+        return resultMap;
+    }
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 수정
+     */
+    @PutMapping
+    public CustomeResultMap updateFaq(@RequestBody FaqVO faqVO) {
+        CustomeResultMap resultMap = new CustomeResultMap();
+
+        try {
+            resultMap.setResultData(faqService.updateFaq(faqVO));
+        } catch (RuntimeException e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value()));
+        } catch (Exception e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value()));
+        }
+
+        return resultMap;
+    }
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * Faq 삭제
+     */
+    @PatchMapping
+    public CustomeResultMap deleteFaq(@RequestBody FaqVO faqVO) throws Exception  {
+        CustomeResultMap resultMap = new CustomeResultMap();
+
+        try {
+            resultMap.setResultData(faqService.deleteFaq(faqVO));
+        } catch (RuntimeException e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value()));
+        } catch (Exception e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value()));
+        }
+
+        return resultMap;
+    }
+}(파일 끝에 줄바꿈 문자 없음)
 
src/main/java/com/takensoft/taken_bi_manager/community/web/NoticeController.java (added)
+++ src/main/java/com/takensoft/taken_bi_manager/community/web/NoticeController.java
@@ -0,0 +1,143 @@
+package com.takensoft.taken_bi_manager.community.web;
+
+import com.takensoft.taken_bi_manager.common.vo.CheckMessage;
+import com.takensoft.taken_bi_manager.common.vo.CustomeResultMap;
+import com.takensoft.taken_bi_manager.common.vo.SearchVO;
+import com.takensoft.taken_bi_manager.community.service.NoticeService;
+import com.takensoft.taken_bi_manager.community.vo.NoticeVO;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequiredArgsConstructor
+@RequestMapping(value = "/notice")
+public class NoticeController {
+    private final NoticeService noticeService;
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 목록 조회
+     */
+    @PostMapping(value = "/list")
+    public CustomeResultMap selectNoticeList(@RequestBody SearchVO searchVO) {
+        CustomeResultMap resultMap = new CustomeResultMap();
+
+        try {
+            resultMap.setResultData(noticeService.selectNoticeList(searchVO));
+        } catch (RuntimeException e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value()));
+        } catch (Exception e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value()));
+        }
+
+        return resultMap;
+    }
+    
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 상세 조회
+     */
+    @GetMapping
+    public CustomeResultMap selectNoticeById(@RequestParam(value = "noticeId", required = false) String noticeId) {
+        CustomeResultMap resultMap = new CustomeResultMap();
+
+        try {
+            resultMap.setResultData(noticeService.selectNoticeById(noticeId));
+        } catch (RuntimeException e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value()));
+        } catch (Exception e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value()));
+        }
+
+        return resultMap;
+    }
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 등록
+     */
+    @PostMapping
+    public CustomeResultMap insertNotice(@RequestBody NoticeVO noticeVO) {
+        CustomeResultMap resultMap = new CustomeResultMap();
+
+        try {
+            resultMap.setResultData(noticeService.insertNotice(noticeVO));
+        } catch (RuntimeException e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value()));
+        } catch (Exception e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value()));
+        }
+
+        return resultMap;
+    }
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 수정
+     */
+    @PutMapping
+    public CustomeResultMap updateNotice(@RequestBody NoticeVO noticeVO) {
+        CustomeResultMap resultMap = new CustomeResultMap();
+
+        try {
+            resultMap.setResultData(noticeService.updateNotice(noticeVO));
+        } catch (RuntimeException e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value()));
+        } catch (Exception e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value()));
+        }
+
+        return resultMap;
+    }
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 조회수 수정
+     */
+    @PatchMapping(value = "/hits")
+    public CustomeResultMap updateNoticeHits(@RequestBody NoticeVO noticeVO) throws Exception  {
+        CustomeResultMap resultMap = new CustomeResultMap();
+
+        try {
+            resultMap.setResultData(noticeService.updateNoticeHits(noticeVO));
+        } catch (RuntimeException e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value()));
+        } catch (Exception e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value()));
+        }
+
+        return resultMap;
+    }
+
+    /**
+     * @author 박정하
+     * @since 2025.01.21
+     *
+     * 공지사항 삭제
+     */
+    @PatchMapping
+    public CustomeResultMap deleteNotice(@RequestBody NoticeVO noticeVO) throws Exception  {
+        CustomeResultMap resultMap = new CustomeResultMap();
+
+        try {
+            resultMap.setResultData(noticeService.deleteNotice(noticeVO));
+        } catch (RuntimeException e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.BAD_REQUEST.value()));
+        } catch (Exception e) {
+            resultMap.setCheckMessage(new CheckMessage(false, e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value()));
+        }
+
+        return resultMap;
+    }
+}(파일 끝에 줄바꿈 문자 없음)
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
+++ src/main/java/com/takensoft/taken_bi_manager/openAPI/service/impl/OpenApiServiceImpl.java
@@ -169,20 +169,23 @@
 
 
         DataTable dataTable = new DataTable(dataset);
-
         dataTable.setColumnDatas(datasetDAO.selectCoulmnInfo(dataset));
         DBConnectionUtil dbUtil = new DBConnectionUtil();
         connectionDB.decodingData();
 
         // param으로  Query 조건문 만들기
         param.remove("serviceKey");
-        if (param.get("pageNo") != null && CommonUtil.parseInt(param.get("pageNo")) > 0) {
-            dataTable.setCurrentPage(CommonUtil.parseInt(param.get("pageNo")));
-            param.remove("pageNo");
+        if (param.get("currentPage") != null && CommonUtil.parseInt(param.get("currentPage")) > 0) {
+            // OFFSET 계산
+            int currentPage = CommonUtil.parseInt(param.get("currentPage"));
+            int perPage = CommonUtil.parseInt(param.get("perPage") != null ? param.get("perPage") : 30); // 기본값 30
+            int offset = (currentPage - 1) * perPage;
+            dataTable.setOffset(offset); // OFFSET 설정
+            param.remove("currentPage");
         }
-        if (param.get("numOfRows") != null && CommonUtil.parseInt(param.get("numOfRows")) > 0) {
-            dataTable.setPerPage(CommonUtil.parseInt(param.get("numOfRows")));
-            param.remove("numOfRows");
+        if (param.get("perPage") != null && CommonUtil.parseInt(param.get("perPage")) > 0) {
+            dataTable.setPerPage(CommonUtil.parseInt(param.get("perPage")));
+            param.remove("perPage");
         }
         String query = buildQueryCondition(param , dataTable.getColumnDatas());
         System.out.println("조건문 쿼리문 " + query);
 
src/main/resources/spring/mapper/community/faq-SQL.xml (added)
+++ src/main/resources/spring/mapper/community/faq-SQL.xml
@@ -0,0 +1,128 @@
+<?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.taken_bi_manager.community.dao.FaqDAO">
+    <!-- FaQ resultMap -->
+    <resultMap id="faqResult" type="FaqVO">
+        <result property="faqId" column="faq_id"/>
+        <result property="faqQuestion" column="faq_question"/>
+        <result property="faqAnswer" column="faq_answer"/>
+        <result property="faqInsertUserId" column="faq_insert_user_id"/>
+        <result property="faqInsertDatetime" column="faq_insert_datetime"/>
+        <result property="faqUpdateUserId" column="faq_update_user_id"/>
+        <result property="faqUpdateDatetime" column="faq_update_datetime"/>
+        <result property="faqIsUse" column="faq_is_use"/>
+    </resultMap>
+
+    <!-- Faq 목록 조회 -->
+    <select id="selectFaqList" parameterType="SearchVO" resultMap="faqResult">
+        SELECT faq_id
+             , faq_question
+             , faq_answer
+             , faq_insert_user_id
+             , faq_insert_datetime
+             , faq_update_user_id
+             , faq_update_datetime
+             , faq_is_use
+        FROM cmmnty_faq
+        WHERE faq_is_use = 1
+        <!-- S.검색 영역 -->
+        <foreach item="item" index="index" collection="searchObjectList">
+            <choose>
+                <when test="item.type == 'dates'">
+                    AND #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp
+                    AND ${item.key2}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY
+                </when>
+                <when test="item.key != null and item.key !='' and item.value != null and item.value != ''">
+                    AND ${item.key} LIKE CONCAT('%', #{item.value}, '%')
+                </when>
+                <when test="item.key == null and item.value != null and item.value !=''">
+                    AND (
+                        faq_question LIKE CONCAT('%', #{item.value}, '%')
+                        OR faq_answer LIKE CONCAT('%', #{item.value}, '%')
+                    )
+                </when>
+            </choose>
+        </foreach>
+        <!-- E.검색 영역 -->
+        ORDER BY faq_insert_datetime DESC
+        LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage})
+    </select>
+
+    <!-- Faq 개수 조회 -->
+    <select id="selectFaqCount" parameterType="SearchVO">
+        SELECT COUNT(*)
+        FROM cmmnty_faq
+        WHERE faq_is_use = 1
+        <!-- S.검색 영역 -->
+        <foreach item="item" index="index" collection="searchObjectList">
+            <choose>
+                <when test="item.type == 'dates'">
+                    AND #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp
+                    AND ${item.key2}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY
+                </when>
+                <when test="item.key != null and item.key !='' and item.value != null and item.value != ''">
+                    AND ${item.key} LIKE CONCAT('%', #{item.value}, '%')
+                </when>
+                <when test="item.key == null and item.value != null and item.value !=''">
+                    AND (
+                        faq_question LIKE CONCAT('%', #{item.value}, '%')
+                        OR faq_answer LIKE CONCAT('%', #{item.value}, '%')
+                    )
+                </when>
+            </choose>
+        </foreach>
+        <!-- E.검색 영역 -->
+    </select>
+
+    <!-- Faq 상세 조회 -->
+    <select id="selectFaqById" parameterType="String" resultMap="faqResult">
+        SELECT faq_id
+             , faq_question
+             , faq_answer
+             , faq_insert_user_id
+             , faq_insert_datetime
+             , faq_update_user_id
+             , faq_update_datetime
+             , faq_is_use
+          FROM cmmnty_faq
+         WHERE faq_is_use = 1
+           AND faq_id = #{faqId}
+    </select>
+
+    <!-- Faq 등록 -->
+    <insert id="insertFaq" parameterType="FaqVO">
+        INSERT INTO cmmnty_faq (
+            faq_id,
+            faq_question,
+            faq_answer,
+            faq_insert_user_id,
+            faq_insert_datetime,
+            faq_is_use
+        ) VALUES (
+            #{faqId},
+            #{faqQuestion},
+            #{faqAnswer},
+            #{faqInsertUserId},
+            NOW(),
+            #{faqIsUse}
+        )
+    </insert>
+
+    <!-- Faq 수정 -->
+    <update id="updateFaq" parameterType="FaqVO">
+        UPDATE cmmnty_faq
+        SET faq_question = #{faqQuestion},
+            faq_answer = #{faqAnswer},
+            faq_update_user_id = #{faqUpdateUserId},
+            faq_update_datetime = NOW(),
+            faq_is_use = #{faqIsUse}
+        WHERE faq_id = #{faqId}
+    </update>
+
+    <!-- Faq 삭제 -->
+    <update id="deleteFaq" parameterType="FaqVO">
+        UPDATE cmmnty_faq
+        SET faq_is_use = 0
+        WHERE faq_id = #{faqId}
+    </update>
+</mapper>(파일 끝에 줄바꿈 문자 없음)
 
src/main/resources/spring/mapper/community/notice-SQL.xml (added)
+++ src/main/resources/spring/mapper/community/notice-SQL.xml
@@ -0,0 +1,153 @@
+<?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.taken_bi_manager.community.dao.NoticeDAO">
+    <!-- 공지사항 resultMap -->
+    <resultMap id="noticeResult" type="NoticeVO">
+        <result property="noticeId" column="notice_id"/>
+        <result property="noticeTitle" column="notice_title"/>
+        <result property="noticeContent" column="notice_content"/>
+        <result property="noticeIsFix" column="notice_is_fix"/>
+        <result property="noticeIsUse" column="notice_is_use"/>
+        <result property="noticeHits" column="notice_hits"/>
+        <result property="noticeInsertUserId" column="notice_insert_user_id"/>
+        <result property="noticeInsertDatetime" column="notice_insert_datetime"/>
+        <result property="noticeUpdateUserId" column="notice_update_user_id"/>
+        <result property="noticeUpdateDatetime" column="notice_update_datetime"/>
+        <result property="fileManagerId" column="file_manager_id"/>
+    </resultMap>
+
+    <!-- 공지사항 목록 조회 -->
+    <select id="selectNoticeList" parameterType="SearchVO" resultMap="noticeResult">
+        SELECT notice_id
+             , notice_title
+             , notice_content
+             , notice_is_fix
+             , notice_is_use
+             , notice_hits
+             , notice_insert_user_id
+             , notice_insert_datetime
+             , notice_update_user_id
+             , notice_update_datetime
+             , file_manager_id
+        FROM cmmnty_notice
+        WHERE notice_is_use = 1
+        <!-- S.검색 영역 -->
+        <foreach item="item" index="index" collection="searchObjectList">
+            <choose>
+                <when test="item.type == 'dates'">
+                    AND #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp
+                    AND ${item.key2}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY
+                </when>
+                <when test="item.key != null and item.key !='' and item.value != null and item.value != ''">
+                    AND ${item.key} LIKE CONCAT('%', #{item.value}, '%')
+                </when>
+                <when test="item.key == null and item.value != null and item.value !=''">
+                    AND (
+                        notice_title LIKE CONCAT('%', #{item.value}, '%')
+                        OR notice_content LIKE CONCAT('%', #{item.value}, '%')
+                    )
+                </when>
+            </choose>
+        </foreach>
+        <!-- E.검색 영역 -->
+        ORDER BY notice_insert_datetime DESC
+        LIMIT #{perPage} OFFSET ((#{currentPage} - 1) * #{perPage})
+    </select>
+
+    <!-- 공지사항 개수 조회 -->
+    <select id="selectNoticeCount" parameterType="SearchVO">
+        SELECT COUNT(*)
+        FROM cmmnty_notice
+        WHERE notice_is_use = 1
+        <!-- S.검색 영역 -->
+        <foreach item="item" index="index" collection="searchObjectList">
+            <choose>
+                <when test="item.type == 'dates'">
+                    AND #{item.value}::timestamp <![CDATA[<=]]> ${item.key}::timestamp
+                    AND ${item.key2}::timestamp <![CDATA[<]]> #{item.value2}::timestamp + INTERVAL '1' DAY
+                </when>
+                <when test="item.key != null and item.key !='' and item.value != null and item.value != ''">
+                    AND ${item.key} LIKE CONCAT('%', #{item.value}, '%')
+                </when>
+                <when test="item.key == null and item.value != null and item.value !=''">
+                    AND (
+                        notice_title LIKE CONCAT('%', #{item.value}, '%')
+                        OR notice_content LIKE CONCAT('%', #{item.value}, '%')
+                    )
+                </when>
+            </choose>
+        </foreach>
+        <!-- E.검색 영역 -->
+    </select>
+
+    <!-- 공지사항 상세 조회 -->
+    <select id="selectNoticeById" parameterType="String" resultMap="noticeResult">
+        SELECT notice_id
+             , notice_title
+             , notice_content
+             , notice_is_fix
+             , notice_is_use
+             , notice_hits
+             , notice_insert_user_id
+             , notice_insert_datetime
+             , notice_update_user_id
+             , notice_update_datetime
+             , file_manager_id
+          FROM cmmnty_notice
+         WHERE notice_is_use = 1
+           AND notice_id = #{noticeId}
+    </select>
+
+    <!-- 공지사항 등록 -->
+    <insert id="insertNotice" parameterType="NoticeVO">
+        INSERT INTO cmmnty_notice (
+            notice_id,
+            notice_title,
+            notice_content,
+            notice_is_fix,
+            notice_is_use,
+            notice_hits,
+            notice_insert_user_id,
+            notice_insert_datetime,
+            file_manager_id
+        ) VALUES (
+            #{noticeId},
+            #{noticeTitle},
+            #{noticeContent},
+            #{noticeIsFix},
+            #{noticeIsUse},
+            #{noticeHits},
+            #{noticeInsertUserId},
+            NOW(),
+            #{fileManagerId}
+        )
+    </insert>
+
+    <!-- 공지사항 수정 -->
+    <update id="updateNotice" parameterType="NoticeVO">
+        UPDATE cmmnty_notice
+        SET notice_title = #{noticeTitle},
+            notice_content = #{noticeContent},
+            notice_is_fix = #{noticeIsFix},
+            notice_is_use = #{noticeIsUse},
+            notice_hits = #{noticeHits},
+            notice_update_user_id = #{noticeUpdateUserId},
+            notice_update_datetime = NOW(),
+            file_manager_id = #{fileManagerId}
+        WHERE notice_id = #{noticeId}
+    </update>
+
+    <!-- 공지사항 조회수 수정 -->
+    <update id="updateNoticeHits" parameterType="NoticeVO">
+        UPDATE cmmnty_notice
+        SET notice_hits = cmmnty_notice.notice_hits + 1
+        WHERE notice_id = #{noticeId}
+    </update>
+
+    <!-- 공지사항 조회수 수정 -->
+    <update id="deleteNotice" parameterType="NoticeVO">
+        UPDATE cmmnty_notice
+        SET notice_is_use = 0
+        WHERE notice_id = #{noticeId}
+    </update>
+</mapper>(파일 끝에 줄바꿈 문자 없음)
src/main/resources/spring/mapper/mybatis-config.xml
--- src/main/resources/spring/mapper/mybatis-config.xml
+++ src/main/resources/spring/mapper/mybatis-config.xml
@@ -95,5 +95,8 @@
         <typeAlias type="com.takensoft.taken_bi_manager.openAPI.vo.ApiConnectVO" alias="ApiConnectVO"/>
         <typeAlias type="com.takensoft.taken_bi_manager.openAPI.vo.ApiParamVO" alias="ApiParamVO"/>
         <typeAlias type="com.takensoft.taken_bi_manager.openAPI.vo.OpenApiKeyVO" alias="OpenApiKeyVO"/>
+
+        <typeAlias type="com.takensoft.taken_bi_manager.community.vo.NoticeVO" alias="NoticeVO"/>
+        <typeAlias type="com.takensoft.taken_bi_manager.community.vo.FaqVO" alias="FaqVO"/>
     </typeAliases>
 </configuration>
(파일 끝에 줄바꿈 문자 없음)
Add a comment
List