Browse Source

班级学生列表

tags/正式3.13.3
雍文秀 1 year ago
parent
commit
1abfb2bb63

+ 8
- 0
suser/src/main/java/com/xhkjedu/suser/controller/gradeclass/GradeController.java View File

73
         return new ResultVo(0,"获取班级列表成功",list);
73
         return new ResultVo(0,"获取班级列表成功",list);
74
     }
74
     }
75
 
75
 
76
+    @PostMapping("/list_class_stu")
77
+    public ResultVo listClassStu(@RequestBody TGrade tGrade) {
78
+        Integer schoolid = tGrade.getSchoolid();
79
+        N_Utils.validation(new Object[]{schoolid, "学校id", 1});
80
+        List<Map> list = gradeService.listClassStu(schoolid, tGrade.getClasstype());
81
+        return new ResultVo(0, "获取班级学生列表成功", list);
82
+    }
83
+
76
     //教师设置班级权限
84
     //教师设置班级权限
77
     @PostMapping("/lct")
85
     @PostMapping("/lct")
78
     public ResultVo listClassForTeacher(@RequestBody TGrade tGrade) {
86
     public ResultVo listClassForTeacher(@RequestBody TGrade tGrade) {

+ 9
- 0
suser/src/main/java/com/xhkjedu/suser/mapper/gradeclass/GradeMapper.java View File

24
      **/
24
      **/
25
     List<GradeVo> listClass(@Param("schoolid") Integer schoolid, @Param("year") Integer year,@Param("classtype") Integer classtype);
25
     List<GradeVo> listClass(@Param("schoolid") Integer schoolid, @Param("year") Integer year,@Param("classtype") Integer classtype);
26
 
26
 
27
+    /**
28
+     * @Description 获取班级学生列表
29
+     * @Date 2023/12/18 14:51
30
+     * @Author YWX
31
+     * @Param [schoolid, year, classtype]
32
+     * @Return java.util.List<java.util.Map>
33
+     **/
34
+    List<Map> listClassStu(@Param("schoolid") Integer schoolid, @Param("year") Integer year,@Param("classtype") Integer classtype);
35
+
27
     /**
36
     /**
28
      * 获取通知教师列表
37
      * 获取通知教师列表
29
      * @Param [schoolid, year]
38
      * @Param [schoolid, year]

+ 12
- 0
suser/src/main/java/com/xhkjedu/suser/service/gradeclass/GradeService.java View File

67
         return gradeMapper.listClass(schoolid, year, classtype);
67
         return gradeMapper.listClass(schoolid, year, classtype);
68
     }
68
     }
69
 
69
 
70
+    /**
71
+     * @Description 获取班级学生列表
72
+     * @Date 2023/12/18 14:50
73
+     * @Author YWX
74
+     * @Param [schoolid, classtype]
75
+     * @Return java.util.List<java.util.Map>
76
+     **/
77
+    public List<Map> listClassStu(Integer schoolid, Integer classtype) {
78
+        Integer year = schoolMapper.getYearById(schoolid);
79
+        return gradeMapper.listClassStu(schoolid, year, classtype);
80
+    }
81
+
70
     /**
82
     /**
71
      * 获取通知教师列表
83
      * 获取通知教师列表
72
      *
84
      *

+ 28
- 0
suser/src/main/resources/mapper/gradeclass/GradeMapper.xml View File

51
         </if>
51
         </if>
52
          order by c.gradeid,c.classtype,c.classorder,c.classid desc
52
          order by c.gradeid,c.classtype,c.classorder,c.classid desc
53
     </select>
53
     </select>
54
+    <!--获取班级学生列表-->
55
+    <resultMap id="gradeClassResult" type="java.util.Map">
56
+        <result property="gradeid" column="gradeid"/>
57
+        <collection property="classes" ofType="java.util.Map" javaType="java.util.List">
58
+            <result property="classid" column="classid"/>
59
+            <result property="classname" column="classname"/>
60
+            <result property="classnum" column="classnum"/>
61
+            <result property="classtype" column="classtype"/>
62
+            <collection property="students" ofType="java.util.Map" javaType="java.util.List">
63
+                <result property="studentid" column="studentid"/>
64
+                <result property="username" column="username"/>
65
+            </collection>
66
+        </collection>
67
+    </resultMap>
68
+    <select id="listClassStu" resultMap="gradeClassResult">
69
+        select c.gradeid,c.classid,c.classname,c.classnum,c.classtype,c.classorder,c.year,c.schoolyear
70
+        ,cs.studentid,u.username
71
+        from t_class c left join t_class_student cs on c.classid=cs.classid
72
+        left join t_user u on cs.studentid = u.userid
73
+        where c.schoolid=#{schoolid} and c.year=#{year} and c.classstate=1 and c.classnum>0
74
+        <if test="classtype!=null and classtype!=0">
75
+            and c.classtype=#{classtype}
76
+        </if>
77
+        <if test="classtype==null or classtype==0">
78
+            and c.classtype <![CDATA[ < ]]>5
79
+        </if>
80
+        order by c.gradeid,c.classtype,c.classorder,c.classid desc
81
+    </select>
54
 
82
 
55
     <!--教师设置权限班级-->
83
     <!--教师设置权限班级-->
56
     <select id="listClassForTeacher" resultMap="gradeResult">
84
     <select id="listClassForTeacher" resultMap="gradeResult">

Loading…
Cancel
Save