권지수 07-30
240729 권지수 단원 평가 CRUD, 문제 검색 추가
@28a82e8240b4148cf1045389645fbde0fa9ca70f
src/main/java/com/takensoft/ai_lms/common/confing/SecurityConfig.java
--- src/main/java/com/takensoft/ai_lms/common/confing/SecurityConfig.java
+++ src/main/java/com/takensoft/ai_lms/common/confing/SecurityConfig.java
@@ -70,6 +70,9 @@
                 .requestMatchers("/file/**").permitAll() // 파일 정보 진입 허용
                 .requestMatchers("/classes/**").permitAll() // 반 정보 진입 허용
                 .requestMatchers("/classBook/**").permitAll() // 반 - 책 정보 진입 허용
+                .requestMatchers("/problem/**").permitAll() // 문제 정보 진입 허용
+                .requestMatchers("/evaluation/**").permitAll() // 단원 평가 정보 진입 허용
+                .requestMatchers("/evalProblem/**").permitAll() // 단원 평가 문제 진입 허용
                 .requestMatchers("/unitLearning/**").permitAll() // 로드맵 정보 진입 허용
                 .requestMatchers("/unit/**").permitAll()
                 .requestMatchers("/photo/**").permitAll()
 
src/main/java/com/takensoft/ai_lms/lms/eval_problem/dao/EvalProblemDAO.java (added)
+++ src/main/java/com/takensoft/ai_lms/lms/eval_problem/dao/EvalProblemDAO.java
@@ -0,0 +1,32 @@
+package com.takensoft.ai_lms.lms.eval_problem.dao;
+
+import com.takensoft.ai_lms.lms.eval_problem.vo.EvalProblemVO;
+import com.takensoft.ai_lms.lms.evaluation.vo.EvaluationVO;
+import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
+
+/**
+ * @author 권지수
+ * @since 2024.07.29
+ *
+ * 단원 평가 문제 DAO 클래스
+ */
+
+@Mapper("evalProblemDAO")
+public interface EvalProblemDAO {
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 문제 정보 입력
+     */
+    int insertEvalProblem(EvalProblemVO evalProblemVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.07.30
+     *
+     * 특정 단원의 문제 수 조회
+     */
+    int unitProblemNum(EvalProblemVO evalProblemVO) throws Exception;
+}
 
src/main/java/com/takensoft/ai_lms/lms/eval_problem/service/EvalProblemService.java (added)
+++ src/main/java/com/takensoft/ai_lms/lms/eval_problem/service/EvalProblemService.java
@@ -0,0 +1,28 @@
+package com.takensoft.ai_lms.lms.eval_problem.service;
+
+import com.takensoft.ai_lms.lms.eval_problem.vo.EvalProblemVO;
+
+/**
+ * @author 권지수
+ * @since 2024.07.29
+ *
+ * 단원 평가 문제 Service 클래스
+ */
+public interface EvalProblemService {
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 문제 정보 입력
+     */
+    int insertEvalProblem(EvalProblemVO evalProblemVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.07.30
+     *
+     * 특정 단원의 문제 수 조회
+     */
+    int unitProblemNum(EvalProblemVO evalProblemVO) throws Exception;
+}
 
src/main/java/com/takensoft/ai_lms/lms/eval_problem/service/Impl/EvalProblemImpl.java (added)
+++ src/main/java/com/takensoft/ai_lms/lms/eval_problem/service/Impl/EvalProblemImpl.java
@@ -0,0 +1,42 @@
+package com.takensoft.ai_lms.lms.eval_problem.service.Impl;
+
+import com.takensoft.ai_lms.lms.eval_problem.dao.EvalProblemDAO;
+import com.takensoft.ai_lms.lms.eval_problem.service.EvalProblemService;
+import com.takensoft.ai_lms.lms.eval_problem.vo.EvalProblemVO;
+import lombok.RequiredArgsConstructor;
+import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author 권지수
+ * @since 2024.07.29
+ *
+ * 단원 평가 문제 ServiceImpl 클래스
+ */
+
+@Service("evalProblemService")
+@RequiredArgsConstructor
+public class EvalProblemImpl extends EgovAbstractServiceImpl implements EvalProblemService {
+
+    private final EvalProblemDAO evalProblemDAO;
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 문제 정보 입력
+     */
+    public int insertEvalProblem(EvalProblemVO evalProblemVO) throws Exception {
+        return evalProblemDAO.insertEvalProblem(evalProblemVO);
+    }
+
+    /**
+     * @author 권지수
+     * @since 2024.07.30
+     *
+     * 특정 단원의 문제 수 조회
+     */
+    public int unitProblemNum(EvalProblemVO evalProblemVO) throws Exception {
+        return evalProblemDAO.unitProblemNum(evalProblemVO);
+    }
+}
 
src/main/java/com/takensoft/ai_lms/lms/eval_problem/vo/EvalProblemVO.java (added)
+++ src/main/java/com/takensoft/ai_lms/lms/eval_problem/vo/EvalProblemVO.java
@@ -0,0 +1,17 @@
+package com.takensoft.ai_lms.lms.eval_problem.vo;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+public class EvalProblemVO {
+    // 단원 평가 아이디
+    private String evalId;
+    // 문제 아이디
+    private String prblmId;
+}
 
src/main/java/com/takensoft/ai_lms/lms/eval_problem/web/EvalProblemController.java (added)
+++ src/main/java/com/takensoft/ai_lms/lms/eval_problem/web/EvalProblemController.java
@@ -0,0 +1,55 @@
+package com.takensoft.ai_lms.lms.eval_problem.web;
+
+import com.takensoft.ai_lms.lms.eval_problem.service.EvalProblemService;
+import com.takensoft.ai_lms.lms.eval_problem.vo.EvalProblemVO;
+import com.takensoft.ai_lms.lms.evaluation.vo.EvaluationVO;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author 권지수
+ * @since 2024.07.29
+ *
+ * 단원 평가 Controller 클래스
+ */
+
+@RestController
+@RequiredArgsConstructor
+@Slf4j
+@RequestMapping(value = "/evalProblem")
+public class EvalProblemController {
+
+    private final EvalProblemService evalProblemService;
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 문제 입력
+     */
+    @PostMapping(path = "/insertEvalProblem.json")
+    public ResponseEntity<?> insertEvalProblem(@RequestBody EvalProblemVO evalProblemVO) throws Exception {
+        int result = evalProblemService.insertEvalProblem(evalProblemVO);
+
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
+
+    /**
+     * @author 권지수
+     * @since 2024.07.30
+     *
+     * 특정 단원의 문제 수 조회
+     */
+    @PostMapping(path = "/unitProblemNum.json")
+    public ResponseEntity<?> unitProblemNum(@RequestBody EvalProblemVO evalProblemVO) throws Exception {
+        int result = evalProblemService.unitProblemNum(evalProblemVO);
+
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
+}
src/main/java/com/takensoft/ai_lms/lms/evaluation/dao/EvaluationDAO.java
--- src/main/java/com/takensoft/ai_lms/lms/evaluation/dao/EvaluationDAO.java
+++ src/main/java/com/takensoft/ai_lms/lms/evaluation/dao/EvaluationDAO.java
@@ -1,4 +1,59 @@
 package com.takensoft.ai_lms.lms.evaluation.dao;
 
+import com.takensoft.ai_lms.lms.evaluation.vo.EvaluationVO;
+import com.takensoft.ai_lms.lms.problem.vo.SearchVO;
+import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
+
+import java.util.List;
+
+/**
+ * @author 권지수
+ * @since 2024.07.29
+ *
+ * 단원 평가 DAO 클래스
+ */
+
+@Mapper("evaluationDAO")
 public interface EvaluationDAO {
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 정보 입력
+     */
+    int insertEvaluation(EvaluationVO evaluationVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 정보 조회
+     */
+    EvaluationVO evaluationInfo(EvaluationVO evaluationVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 특정 단원 평가 정보 조회
+     */
+    List<EvaluationVO> evaluationUnitList(SearchVO searchVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 정보 수정
+     */
+    int updateEvaluation(EvaluationVO evaluationVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 정보 삭제
+     */
+    int deleteEvaluation(EvaluationVO evaluationVO) throws Exception;
+
 }
src/main/java/com/takensoft/ai_lms/lms/evaluation/service/EvaluationService.java
--- src/main/java/com/takensoft/ai_lms/lms/evaluation/service/EvaluationService.java
+++ src/main/java/com/takensoft/ai_lms/lms/evaluation/service/EvaluationService.java
@@ -1,4 +1,58 @@
 package com.takensoft.ai_lms.lms.evaluation.service;
 
+import com.takensoft.ai_lms.lms.evaluation.vo.EvaluationVO;
+import com.takensoft.ai_lms.lms.problem.vo.SearchVO;
+import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
+
+import java.util.List;
+
+/**
+ * @author 권지수
+ * @since 2024.07.29
+ *
+ * 단원 평가 Service 클래스
+ */
+
 public interface EvaluationService {
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 정보 입력
+     */
+    int insertEvaluation(EvaluationVO evaluationVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 정보 조회
+     */
+    EvaluationVO evaluationInfo(EvaluationVO evaluationVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 특정 단원 평가 정보 조회
+     */
+    List<EvaluationVO> evaluationUnitList(SearchVO searchVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 정보 수정
+     */
+    int updateEvaluation(EvaluationVO evaluationVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 정보 삭제
+     */
+    int deleteEvaluation(EvaluationVO evaluationVO) throws Exception;
+
 }
 
src/main/java/com/takensoft/ai_lms/lms/evaluation/service/Impl/EvaluationService.java (deleted)
--- src/main/java/com/takensoft/ai_lms/lms/evaluation/service/Impl/EvaluationService.java
@@ -1,4 +0,0 @@
-package com.takensoft.ai_lms.lms.evaluation.service.Impl;
-
-public class EvaluationService {
-}
 
src/main/java/com/takensoft/ai_lms/lms/evaluation/service/Impl/EvaluationServiceImpl.java (added)
+++ src/main/java/com/takensoft/ai_lms/lms/evaluation/service/Impl/EvaluationServiceImpl.java
@@ -0,0 +1,81 @@
+package com.takensoft.ai_lms.lms.evaluation.service.Impl;
+
+import com.takensoft.ai_lms.common.idgen.service.IdgenService;
+import com.takensoft.ai_lms.lms.evaluation.dao.EvaluationDAO;
+import com.takensoft.ai_lms.lms.evaluation.service.EvaluationService;
+import com.takensoft.ai_lms.lms.evaluation.vo.EvaluationVO;
+import com.takensoft.ai_lms.lms.problem.vo.SearchVO;
+import lombok.RequiredArgsConstructor;
+import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * @author 권지수
+ * @since 2024.07.29
+ *
+ * 단원 평가 ServiceImpl 클래스
+ */
+
+@Service("evaluationService")
+@RequiredArgsConstructor
+public class EvaluationServiceImpl extends EgovAbstractServiceImpl implements EvaluationService {
+
+    private final EvaluationDAO evaluationDAO;
+    private final IdgenService evalIdgn;
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 정보 입력
+     */
+    public int insertEvaluation(EvaluationVO evaluationVO) throws Exception {
+        String evaluationId = evalIdgn.getNextStringId();
+        evaluationVO.setEvalId(evaluationId);
+
+        return evaluationDAO.insertEvaluation(evaluationVO);
+    }
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 정보 조회
+     */
+    public EvaluationVO evaluationInfo(EvaluationVO evaluationVO) throws Exception {
+        return evaluationDAO.evaluationInfo(evaluationVO);
+    }
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 특정 단원 평가 정보 조회
+     */
+    public List<EvaluationVO> evaluationUnitList(SearchVO searchVO) throws Exception {
+        return evaluationDAO.evaluationUnitList(searchVO);
+    }
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 정보 수정
+     */
+    public int updateEvaluation(EvaluationVO evaluationVO) throws Exception {
+        return evaluationDAO.updateEvaluation(evaluationVO);
+    }
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 정보 삭제
+     */
+    public int deleteEvaluation(EvaluationVO evaluationVO) throws Exception {
+        return evaluationDAO.deleteEvaluation(evaluationVO);
+    }
+
+}
src/main/java/com/takensoft/ai_lms/lms/evaluation/vo/EvaluationVO.java
--- src/main/java/com/takensoft/ai_lms/lms/evaluation/vo/EvaluationVO.java
+++ src/main/java/com/takensoft/ai_lms/lms/evaluation/vo/EvaluationVO.java
@@ -1,4 +1,19 @@
 package com.takensoft.ai_lms.lms.evaluation.vo;
 
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
 public class EvaluationVO {
+    // 단원 평가 아이디
+    private String evalId;
+    // 단원 평가 유형
+    private String evalType;
+    // 단원 아이디
+    private String unitId;
 }
src/main/java/com/takensoft/ai_lms/lms/evaluation/web/EvaluationController.java
--- src/main/java/com/takensoft/ai_lms/lms/evaluation/web/EvaluationController.java
+++ src/main/java/com/takensoft/ai_lms/lms/evaluation/web/EvaluationController.java
@@ -1,4 +1,97 @@
 package com.takensoft.ai_lms.lms.evaluation.web;
 
+import com.takensoft.ai_lms.lms.evaluation.service.EvaluationService;
+import com.takensoft.ai_lms.lms.evaluation.vo.EvaluationVO;
+import com.takensoft.ai_lms.lms.problem.vo.ProblemVO;
+import com.takensoft.ai_lms.lms.problem.vo.SearchVO;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @author 권지수
+ * @since 2024.07.29
+ *
+ * 단원 평가 Controller 클래스
+ */
+
+@RestController
+@RequiredArgsConstructor
+@Slf4j
+@RequestMapping(value = "/evaluation")
 public class EvaluationController {
+
+    private final EvaluationService evaluationService;
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 정보 입력
+     */
+    @PostMapping(path = "/insertEvaluation.json")
+    public ResponseEntity<?> insertEvaluation(@RequestBody EvaluationVO evaluationVO) throws Exception {
+        int result = evaluationService.insertEvaluation(evaluationVO);
+
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 정보 조회
+     */
+    @PostMapping(path = "/evaluationInfo.json")
+    public ResponseEntity<?> evaluationInfo(@RequestBody EvaluationVO evaluationVO) throws Exception {
+        EvaluationVO result = evaluationService.evaluationInfo(evaluationVO);
+
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 특정 단원 평가 정보 조회
+     */
+    @PostMapping(path = "/evaluationUnitList.json")
+    public ResponseEntity<?> evaluationUnitList(@RequestBody SearchVO searchVO) throws Exception {
+        List<EvaluationVO> result = evaluationService.evaluationUnitList(searchVO);
+
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 정보 수정
+     */
+    @PostMapping(path = "/updateEvaluation.json")
+    public ResponseEntity<?> updateEvaluation(@RequestBody EvaluationVO evaluationVO) throws Exception {
+        int result = evaluationService.updateEvaluation(evaluationVO);
+
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
+
+    /**
+     * @author 권지수
+     * @since 2024.07.29
+     *
+     * 단원 평가 정보 삭제
+     */
+    @PostMapping(path = "/deleteEvaluation.json")
+    public ResponseEntity<?> deleteEvaluation(@RequestBody EvaluationVO evaluationVO) throws Exception {
+        int result = evaluationService.deleteEvaluation(evaluationVO);
+
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
 }
src/main/java/com/takensoft/ai_lms/lms/problem/dao/ProblemDAO.java
--- src/main/java/com/takensoft/ai_lms/lms/problem/dao/ProblemDAO.java
+++ src/main/java/com/takensoft/ai_lms/lms/problem/dao/ProblemDAO.java
@@ -1,7 +1,9 @@
 package com.takensoft.ai_lms.lms.problem.dao;
 
+import com.takensoft.ai_lms.lms.eval_problem.vo.EvalProblemVO;
 import com.takensoft.ai_lms.lms.problem.vo.ProblemDetailVO;
 import com.takensoft.ai_lms.lms.problem.vo.ProblemVO;
+import com.takensoft.ai_lms.lms.problem.vo.SearchVO;
 import org.egovframe.rte.psl.dataaccess.mapper.Mapper;
 
 import java.util.List;
@@ -72,4 +74,20 @@
      */
     int deleteProblem(ProblemVO problemVO) throws Exception;
 
+    /**
+     * @author 권지수
+     * @since 2024.07.30
+     *
+     * 전체 문제 목록 조회
+     */
+    List<ProblemVO> problemList(SearchVO searchVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.07.30
+     *
+     * 특정 단원 평가의 문제 목록 조회
+     */
+    List<ProblemVO> evaluationProblemList(SearchVO searchVO) throws Exception;
+
 }
src/main/java/com/takensoft/ai_lms/lms/problem/service/Impl/ProblemServiceImpl.java
--- src/main/java/com/takensoft/ai_lms/lms/problem/service/Impl/ProblemServiceImpl.java
+++ src/main/java/com/takensoft/ai_lms/lms/problem/service/Impl/ProblemServiceImpl.java
@@ -1,10 +1,12 @@
 package com.takensoft.ai_lms.lms.problem.service.Impl;
 
 import com.takensoft.ai_lms.common.idgen.service.IdgenService;
+import com.takensoft.ai_lms.lms.eval_problem.vo.EvalProblemVO;
 import com.takensoft.ai_lms.lms.problem.dao.ProblemDAO;
 import com.takensoft.ai_lms.lms.problem.service.ProblemService;
 import com.takensoft.ai_lms.lms.problem.vo.ProblemDetailVO;
 import com.takensoft.ai_lms.lms.problem.vo.ProblemVO;
+import com.takensoft.ai_lms.lms.problem.vo.SearchVO;
 import lombok.RequiredArgsConstructor;
 import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
 import org.springframework.stereotype.Service;
@@ -106,4 +108,24 @@
     public int deleteProblem(ProblemVO problemVO) throws Exception {
         return problemDAO.deleteProblem(problemVO);
     }
+
+    /**
+     * @author 권지수
+     * @since 2024.07.30
+     *
+     * 전체 문제 목록 조회
+     */
+    public List<ProblemVO> problemList(SearchVO searchVO) throws Exception {
+        return problemDAO.problemList(searchVO);
+    }
+
+    /**
+     * @author 권지수
+     * @since 2024.07.30
+     *
+     * 특정 단원 평가의 문제 목록 조회
+     */
+    public List<ProblemVO> evaluationProblemList(SearchVO searchVO) throws Exception {
+        return problemDAO.evaluationProblemList(searchVO);
+    }
 }
src/main/java/com/takensoft/ai_lms/lms/problem/service/ProblemService.java
--- src/main/java/com/takensoft/ai_lms/lms/problem/service/ProblemService.java
+++ src/main/java/com/takensoft/ai_lms/lms/problem/service/ProblemService.java
@@ -1,7 +1,9 @@
 package com.takensoft.ai_lms.lms.problem.service;
 
+import com.takensoft.ai_lms.lms.eval_problem.vo.EvalProblemVO;
 import com.takensoft.ai_lms.lms.problem.vo.ProblemDetailVO;
 import com.takensoft.ai_lms.lms.problem.vo.ProblemVO;
+import com.takensoft.ai_lms.lms.problem.vo.SearchVO;
 
 import java.util.HashMap;
 import java.util.List;
@@ -70,4 +72,20 @@
      * 문제 정보 삭제
      */
     int deleteProblem(ProblemVO problemVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.07.30
+     *
+     * 전체 문제 목록 조회
+     */
+    List<ProblemVO> problemList(SearchVO searchVO) throws Exception;
+
+    /**
+     * @author 권지수
+     * @since 2024.07.30
+     *
+     * 특정 단원 평가의 문제 목록 조회
+     */
+    List<ProblemVO> evaluationProblemList(SearchVO searchVO) throws Exception;
 }
 
src/main/java/com/takensoft/ai_lms/lms/problem/vo/SearchVO.java (added)
+++ src/main/java/com/takensoft/ai_lms/lms/problem/vo/SearchVO.java
@@ -0,0 +1,25 @@
+package com.takensoft.ai_lms.lms.problem.vo;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+public class SearchVO {
+    // 검색 옵션
+    private String option;
+    // 검색 키워드
+    private String keyword;
+    // 페이지 크기
+    private int pageSize;
+    // 시작 인덱스
+    private int startIndex;
+    // 단원 평가 아이디
+    private String evalId;
+    // 단원 아이디
+    private String unitId;
+}
src/main/java/com/takensoft/ai_lms/lms/problem/web/ProblemController.java
--- src/main/java/com/takensoft/ai_lms/lms/problem/web/ProblemController.java
+++ src/main/java/com/takensoft/ai_lms/lms/problem/web/ProblemController.java
@@ -1,9 +1,11 @@
 package com.takensoft.ai_lms.lms.problem.web;
 
 import com.takensoft.ai_lms.lms.auth.vo.UserVO;
+import com.takensoft.ai_lms.lms.eval_problem.vo.EvalProblemVO;
 import com.takensoft.ai_lms.lms.problem.service.ProblemService;
 import com.takensoft.ai_lms.lms.problem.vo.ProblemDetailVO;
 import com.takensoft.ai_lms.lms.problem.vo.ProblemVO;
+import com.takensoft.ai_lms.lms.problem.vo.SearchVO;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.http.HttpStatus;
@@ -136,4 +138,30 @@
 
         return new ResponseEntity<>(result, HttpStatus.OK);
     }
+
+    /**
+     * @author 권지수
+     * @since 2024.07.26
+     *
+     * 전체 문제 목록 조회
+     */
+    @PostMapping(path = "/problemList.json")
+    public ResponseEntity<?> problemList(@RequestBody SearchVO searchVO) throws Exception {
+        List<ProblemVO> result = problemService.problemList(searchVO);
+
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
+
+    /**
+     * @author 권지수
+     * @since 2024.07.26
+     *
+     * 특정 단원 평가의 문제 목록 조회
+     */
+    @PostMapping(path = "/evaluationProblemList.json")
+    public ResponseEntity<?> evaluationProblemList(@RequestBody SearchVO searchVO) throws Exception {
+        List<ProblemVO> result = problemService.evaluationProblemList(searchVO);
+
+        return new ResponseEntity<>(result, HttpStatus.OK);
+    }
 }
 
src/main/resources/mybatis/mapper/lms/eval_problem-SQL.xml (added)
+++ src/main/resources/mybatis/mapper/lms/eval_problem-SQL.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.takensoft.ai_lms.lms.eval_problem.dao.EvalProblemDAO">
+
+    <!--
+        작 성 자 : 권지수
+        작 성 일 : 2024.07.29
+        내   용 : 단원 평가 문제 insert
+    -->
+    <insert id="insertEvalProblem" parameterType="EvalProblemVO">
+        INSERT INTO eval_problem (
+            eval_id,
+            prblm_id
+        ) VALUES (
+            #{evalId},
+            #{prblmId}
+        )
+    </insert>
+
+    <!--
+        작 성 자 : 권지수
+        작 성 일 : 2024.07.30
+        내   용 : 특정 단원의 문제 수 조회
+    -->
+    <select id="unitProblemNum" parameterType="EvaluationVO" resultType="int">
+        SELECT
+            COUNT(*)
+        FROM eval_problem
+        WHERE eval_id = #{evalId}
+    </select>
+
+</mapper>(파일 끝에 줄바꿈 문자 없음)
src/main/resources/mybatis/mapper/lms/evaluation-SQL.xml
--- src/main/resources/mybatis/mapper/lms/evaluation-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/evaluation-SQL.xml
@@ -2,6 +2,89 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.takensoft.ai_lms.lms.evaluation.dao.EvaluationDAO">
 
+    <!--
+        작 성 자 : 권지수
+        작 성 일 : 2024.07.29
+        내   용 : 단원 평가 정보 insert
+    -->
+    <insert id="insertEvaluation" parameterType="EvaluationVO">
+        INSERT INTO evaluation (
+            eval_id,
+            eval_type,
+            unit_id
+        ) VALUES (
+            #{evalId},
+            #{evalType},
+            #{unitId}
+        )
+    </insert>
+
+    <!--
+        작 성 자 : 권지수
+        작 성 일 : 2024.07.29
+        내   용 : 단원 평가 정보 read
+    -->
+    <select id="evaluationInfo" parameterType="EvaluationVO" resultType="EvaluationVO">
+        SELECT
+            eval_id,
+            eval_type,
+            unit_id
+        FROM evaluation
+        WHERE eval_id = #{evalId}
+    </select>
+
+    <!--
+        작 성 자 : 권지수
+        작 성 일 : 2024.07.29
+        내   용 : 특정 단원 평가 정보 read
+    -->
+    <select id="evaluationUnitList" parameterType="SearchVO" resultType="EvaluationVO">
+        SELECT
+            eval_id,
+            eval_type,
+            unit_id
+        FROM evaluation
+        WHERE unit_id = #{unitId}
+        <if test="option != null and keyword != null">
+            <choose>
+                <when test="option == 'eval_type'">
+                    AND eval_type LIKE CONCAT('%', #{keyword}, '%')
+                </when>
+                <when test="option == 'eval_id'">
+                    AND eval_id = #{keyword}
+                </when>
+                <otherwise>
+                    AND (eval_type LIKE CONCAT('%', #{keyword}, '%')
+                    OR eval_id = #{keyword})
+                </otherwise>
+            </choose>
+        </if>
+        LIMIT #{pageSize} OFFSET #{startIndex}
+    </select>
+
+    <!--
+        작 성 자 : 권지수
+        작 성 일 : 2024.07.29
+        내   용 : 단원 평가 정보 update
+    -->
+    <update id="updateEvaluation" parameterType="EvaluationVO">
+        UPDATE evaluation
+        SET
+            eval_id = #{evalId},
+            eval_type = #{evalType},
+            unit_id = #{unitId}
+        WHERE eval_id = #{evalId}
+    </update>
+
+    <!--
+        작 성 자 : 권지수
+        작 성 일 : 2024.07.29
+        내   용 : 단원 평가 정보 delete
+    -->
+    <delete id="deleteEvaluation" parameterType="EvaluationVO">
+        DELETE FROM evaluation
+        WHERE eval_id = #{evalId}
+    </delete>
 
 
 </mapper>
(파일 끝에 줄바꿈 문자 없음)
src/main/resources/mybatis/mapper/lms/problem-SQL.xml
--- src/main/resources/mybatis/mapper/lms/problem-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/problem-SQL.xml
@@ -2,6 +2,17 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.takensoft.ai_lms.lms.problem.dao.ProblemDAO">
 
+    <!--resultMap id="problemMap" type="ProblemVO">
+        <result property="prblmId" column="prblm_id"/>
+        <result property="prblmExpln" column="prblm_expln"/>
+        <result property="prblmScr" column="prblm_scr"/>
+        <result property="prblmHint" column="prblm_hint"/>
+        <result property="prblmCmmt" column="prblm_cmmt"/>
+        <result property="fileMngId" column="file_mng_id"/>
+        <result property="prblmTypeId" column="prblm_type_id"/>
+        <result property="prblmCtgryId" column="prblm_ctgry_id"/>
+    </resultMap-->
+
     <!--
         작 성 자 : 권지수
         작 성 일 : 2024.07.25
@@ -127,5 +138,85 @@
         WHERE prblm_id = #{prblmId}
     </delete>
 
+    <!--
+        작 성 자 : 권지수
+        작 성 일 : 2024.07.30
+        내   용 : 전체 문제 목록 조회
+    -->
+    <select id="problemList" parameterType="SearchVO" resultType="ProblemVO">
+        SELECT
+            prblm_id,
+            prblm_expln,
+            prblm_scr,
+            prblm_hint,
+            prblm_cmmt,
+            file_mng_id,
+            prblm_type_id,
+            prblm_ctgry_id
+        FROM problem
+        WHERE 1 = 1
+        <if test="option != null and keyword != null">
+            <choose>
+                <when test="option == 'prblm_expln'">
+                    AND prblm_expln LIKE CONCAT('%', #{keyword}, '%')
+                </when>
+                <when test="option == 'prblm_type_id'">
+                    AND prblm_type_id = #{keyword}
+                </when>
+                <when test="option == 'prblm_ctgry_id'">
+                    AND prblm_ctgry_id = #{keyword}
+                </when>
+                <otherwise>
+                    AND (prblm_expln LIKE CONCAT('%', #{keyword}, '%')
+                    OR prblm_type_id = #{keyword}
+                    OR prblm_ctgry_id = #{keyword})
+                </otherwise>
+            </choose>
+        </if>
+        LIMIT #{pageSize} OFFSET #{startIndex}
+
+    </select>
+
+    <!--
+        작 성 자 : 권지수
+        작 성 일 : 2024.07.25
+        내   용 : 특정 단원 평가의 문제 목록 조회
+    -->
+    <select id="evaluationProblemList" parameterType="SearchVO" resultType="ProblemVO">
+        SELECT
+            p.prblm_id AS prblmId,
+            p.prblm_expln AS prblmExpln,
+            p.prblm_scr AS prblmScr,
+            p.prblm_hint AS prblmHint,
+            p.prblm_cmmt AS prblmCmmt,
+            p.file_mng_id AS fileMngId,
+            p.prblm_type_id AS prblmTypeId,
+            p.prblm_ctgry_id AS prblmCtgryId
+        FROM
+            eval_problem ep
+        JOIN
+            problem p ON ep.prblm_id = p.prblm_id
+        WHERE
+            ep.eval_id = #{evalId}
+        <if test="option != null and keyword != null">
+            <choose>
+                <when test="option == 'prblm_expln'">
+                    AND prblm_expln LIKE CONCAT('%', #{keyword}, '%')
+                </when>
+                <when test="option == 'prblm_type_id'">
+                    AND prblm_type_id = #{keyword}
+                </when>
+                <when test="option == 'prblm_ctgry_id'">
+                    AND prblm_ctgry_id = #{keyword}
+                </when>
+                <otherwise>
+                    AND (prblm_expln LIKE CONCAT('%', #{keyword}, '%')
+                    OR prblm_type_id = #{keyword}
+                    OR prblm_ctgry_id = #{keyword})
+                </otherwise>
+            </choose>
+        </if>
+    </select>
+
 
 </mapper>
(파일 끝에 줄바꿈 문자 없음)
Add a comment
List