woals 2024-07-26
240726 권민수 학생 정보 조회 api에 푼문제수 조회 기능 추가
@af08b67039a7ce6861f5ae47fc20acbfe7dd7784
src/main/java/com/takensoft/ai_lms/lms/student/vo/StudentInfoVO.java
--- src/main/java/com/takensoft/ai_lms/lms/student/vo/StudentInfoVO.java
+++ src/main/java/com/takensoft/ai_lms/lms/student/vo/StudentInfoVO.java
@@ -12,8 +12,8 @@
  * 학생 불러오는 정보 VO 클래스
  */
 
-@Setter
 @Getter
+@Setter
 public class StudentInfoVO {
 
     private String studentName;
@@ -21,6 +21,7 @@
     private int grade;
     private String className;
     private String studentQuestion;
+    private int totalProblemsSolved;
     private List<HistoryVO> history;
 
 }
src/main/resources/mybatis/mapper/lms/student-SQL.xml
--- src/main/resources/mybatis/mapper/lms/student-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/student-SQL.xml
@@ -13,6 +13,7 @@
         <result property="institutionName" column="institutionName"/>
         <result property="grade" column="grade"/>
         <result property="className" column="className"/>
+        <result property="totalProblemsSolved" column="totalProblemsSolved"/>
         <result property="studentQuestion" column="studentQuestion"/>
         <collection property="history" ofType="com.takensoft.ai_lms.lms.student.vo.HistoryVO">
             <result property="bookName" column="bookName"/>
@@ -29,6 +30,7 @@
             i.ednst_nm AS institutionName,
             ui.grd_no AS grade,
             ui.scls_nm AS className,
+            (SELECT COUNT(*) FROM problem_log pl WHERE pl.std_id = u.user_id) AS totalProblemsSolved,
             uc.stn_qna AS studentQuestion,
             hu.book_id AS bookId,
             hu.book_nm AS bookName,
Add a comment
List