dajeong 08-07
240807 정다정 class 조회: 반 별 학생수 추가
@77051a156cfe57dd33e1d1b8e28e2b51f68a6a27
src/main/java/com/takensoft/ai_lms/lms/classes/vo/ClassVO.java
--- src/main/java/com/takensoft/ai_lms/lms/classes/vo/ClassVO.java
+++ src/main/java/com/takensoft/ai_lms/lms/classes/vo/ClassVO.java
@@ -17,4 +17,6 @@
     public String userId;
     // 반 이름
     public String sclsNm;
+    // 반 총 인원
+    public int studentCount;
 }
src/main/resources/mybatis/mapper/lms/classes-SQL.xml
--- src/main/resources/mybatis/mapper/lms/classes-SQL.xml
+++ src/main/resources/mybatis/mapper/lms/classes-SQL.xml
@@ -7,6 +7,7 @@
         <result property="userId" column="user_id"/>
         <result property="sclsNm" column="scls_nm"/>
         <result property="useAt" column="use_at"/>
+        <result property="studentCount" column="student_count"/>
     </resultMap>
 
     <!--
@@ -15,14 +16,17 @@
          내 용 : 반 조회
      -->
     <select id="selectClass" parameterType="String" resultMap="classMap">
-        SELECT scls_id
-             , user_id
-             , scls_nm
-        FROM
-            class
-        WHERE
-            user_id = #{userId}
-            AND use_at = 'Y'
+        SELECT c.scls_id
+               , c.user_id
+               , c.scls_nm
+               , COUNT(uc.std_id) AS student_count
+        FROM class c
+        LEFT JOIN user_class uc ON c.scls_id = uc.scls_id
+        WHERE c.user_id = #{userId} AND c.use_at = 'Y'
+        GROUP BY c.scls_id
+                 , c.user_id
+                 , c.scls_nm
+        ORDER BY c.scls_id ASC;
     </select>
 
     <!--
Add a comment
List