Browse Source

教师权限班级学生

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

+ 15
- 0
suser/src/main/java/com/xhkjedu/suser/controller/system/TeacherRoleController.java View File

@@ -123,6 +123,21 @@ public class TeacherRoleController {
123 123
         return new ResultVo(0,"获取教师权限班级列表成功",list);
124 124
     }
125 125
 
126
+    /**
127
+     * @Description 教师权限班级学生
128
+     * @Date 2023/12/19 10:41
129
+     * @Author YWX
130
+     * @Param [trole]
131
+     * @Return com.xhkjedu.vo.ResultVo
132
+     **/
133
+    @PostMapping("/list_class_stu")
134
+    public ResultVo listClassStu(@RequestBody TeacherRoleParam trole) {
135
+        Integer teacherid = trole.getTeacherid();
136
+        N_Utils.validation(new Object[]{teacherid, "教师id", 1});
137
+        List<Map> list = teacherRoleService.listClassStu(trole);
138
+        return new ResultVo(0, "获取教师权限班级学生列表成功", list);
139
+    }
140
+
126 141
     //直播巡课、作业统计、预习统计搜索用
127 142
     @PostMapping("/list_class2")
128 143
     public ResultVo listClass2(@RequestBody TeacherRoleParam trole){

+ 8
- 0
suser/src/main/java/com/xhkjedu/suser/mapper/gradeclass/ClassTeacherMapper.java View File

@@ -100,4 +100,12 @@ public interface ClassTeacherMapper extends TkMapper<TClassTeacher> {
100 100
      **/
101 101
     List<GradeVo> listRoleGradeAllClass(@Param("role")TeacherRoleParam role);
102 102
 
103
+    /**
104
+     * @Description 教师权限班级学生
105
+     * @Date 2023/12/19 10:41
106
+     * @Author YWX
107
+     * @Param [role]
108
+     * @Return java.util.List<java.util.Map>
109
+     **/
110
+    List<Map> listClassStu(@Param("role") TeacherRoleParam role);
103 111
 }

+ 14
- 0
suser/src/main/java/com/xhkjedu/suser/service/system/TeacherRoleService.java View File

@@ -274,6 +274,20 @@ public class TeacherRoleService extends JedisUtil {
274 274
         return classTeacherMapper.listGradeClassesByUserid(role);
275 275
     }
276 276
 
277
+    /**
278
+     * @Description 教师权限班级学生
279
+     * @Date 2023/12/19 10:40
280
+     * @Author YWX
281
+     * @Param [role]
282
+     * @Return java.util.List<java.util.Map>
283
+     **/
284
+    public List<Map> listClassStu(TeacherRoleParam role) {
285
+        TSchool school = schoolMapper.getSchoolInfoByUserid(role.getTeacherid());
286
+        role.setYear(school.getYear());
287
+        role.setSchoolid(school.getSchoolid());
288
+        return classTeacherMapper.listClassStu(role);
289
+    }
290
+
277 291
     /**
278 292
      * 教师权限班级
279 293
      * @Param [role]

+ 42
- 21
suser/src/main/resources/mapper/gradeclass/ClassTeacherMapper.xml View File

@@ -3,8 +3,8 @@
3 3
 <mapper namespace="com.xhkjedu.suser.mapper.gradeclass.ClassTeacherMapper">
4 4
     <!--班级教师列表-->
5 5
     <select id="findAll" resultType="com.xhkjedu.suser.vo.gradeclass.ClassTeacherVo">
6
-        select u.userid teacherid,u.username teachername,u.usersex,u.loginname,u.usertype,u.createtime,u.usertime,u.userlock
7
-        ,(case when u.userphone='' then userphone else concat(left(u.userphone,3),'****',right(u.userphone,4)) end)userphone
6
+        select u.userid as teacherid,u.username as teachername,u.usersex,u.loginname,u.usertype,u.createtime,u.usertime,u.userlock
7
+        ,(if(u.userphone='', userphone, concat(left(u.userphone,3),'****',right(u.userphone,4)))) as userphone
8 8
         ,(select s.subjectname from t_teacher_powersb ts left join t_subject_book sb on ts.lsbid=sb.lsbid
9 9
         left join t_subject s on sb.subjectid=s.subjectid
10 10
         where ts.teacherid=u.userid limit 1)subjectname
@@ -61,14 +61,14 @@
61 61
     </select>
62 62
     <!--前年份教师任教分组学生-->
63 63
     <resultMap id="teacherClass" type="java.util.Map">
64
-        <result property="classid" column="classid"></result>
65
-        <result property="classname" column="classname"></result>
66
-        <result property="gradeid" column="gradeid"></result>
67
-        <result property="classnum" column="classnum"></result>
64
+        <result property="classid" column="classid"/>
65
+        <result property="classname" column="classname"/>
66
+        <result property="gradeid" column="gradeid"/>
67
+        <result property="classnum" column="classnum"/>
68 68
         <collection property="students" ofType="java.util.Map" javaType="java.util.List">
69
-            <result property="studentid" column="studentid"></result>
70
-            <result property="studentname" column="studentname"></result>
71
-            <result property="headpic" column="headpic"></result>
69
+            <result property="studentid" column="studentid"/>
70
+            <result property="studentname" column="studentname"/>
71
+            <result property="headpic" column="headpic"/>
72 72
         </collection>
73 73
     </resultMap>
74 74
     <!--获取作业学生列表-->
@@ -81,12 +81,12 @@
81 81
     </select>
82 82
     <!--获取作业教师列表-->
83 83
     <resultMap id="paperTeacher" type="java.util.Map">
84
-        <result property="classid" column="classid"></result>
85
-        <result property="classname" column="classname"></result>
86
-        <result property="gradeid" column="gradeid"></result>
84
+        <result property="classid" column="classid"/>
85
+        <result property="classname" column="classname"/>
86
+        <result property="gradeid" column="gradeid"/>
87 87
         <collection property="teachers" ofType="java.util.Map" javaType="java.util.List">
88
-            <result property="teacherid" column="teacherid"></result>
89
-            <result property="teachername" column="teachername"></result>
88
+            <result property="teacherid" column="teacherid"/>
89
+            <result property="teachername" column="teachername"/>
90 90
         </collection>
91 91
     </resultMap>
92 92
     <select id="listPaperTeacher" resultMap="paperTeacher">
@@ -126,14 +126,14 @@
126 126
     </select>
127 127
 
128 128
     <resultMap id="gradeClass" type="com.xhkjedu.suser.vo.gradeclass.GradeVo">
129
-        <result property="gradeid" column="gradeid"></result>
130
-        <result property="gradename" column="gradename"></result>
129
+        <result property="gradeid" column="gradeid"/>
130
+        <result property="gradename" column="gradename"/>
131 131
         <collection property="classes" ofType="com.xhkjedu.suser.vo.gradeclass.ClassVo">
132
-            <result property="gradeid" column="gradeid"></result>
133
-            <result property="classid" column="classid"></result>
134
-            <result property="classname" column="classname"></result>
135
-            <result property="classnum" column="classnum"></result>
136
-            <result property="classtype" column="classtype"></result>
132
+            <result property="gradeid" column="gradeid"/>
133
+            <result property="classid" column="classid"/>
134
+            <result property="classname" column="classname"/>
135
+            <result property="classnum" column="classnum"/>
136
+            <result property="classtype" column="classtype"/>
137 137
         </collection>
138 138
     </resultMap>
139 139
 
@@ -219,4 +219,25 @@
219 219
         where ct.teacherid=#{role.teacherid} and c2.year=#{role.year} and c2.classstate=1 and c2.classtype=1 limit 1)
220 220
         order by c.classtype,c.classorder,c.classname
221 221
     </select>
222
+    <!--教师权限班级学生-->
223
+    <select id="listClassStu" resultMap="teacherClass">
224
+        select c.gradeid,c.classid,c.classname,c.classnum
225
+        ,cs.studentid,u.username studentname,u.headpic
226
+        from t_class_teacher ct left join  t_class c on ct.classid=c.classid
227
+        left join t_class_student cs on c.classid = cs.classid
228
+        left join t_user u on cs.studentid=u.userid
229
+        where ct.teacherid=#{role.teacherid} and c.year=#{role.year} and c.classstate=1
230
+        and c.schoolid=#{role.schoolid}
231
+        <if test="role.classtype!=null and role.classtype!=0">
232
+            <if test="role.classtype!=11">and c.classtype=#{role.classtype}</if>
233
+            <if test="role.classtype==11">and c.classtype in(1,2)</if>
234
+        </if>
235
+        <if test="role.classtype==null or role.classtype==0">
236
+            and c.classtype!=99
237
+        </if>
238
+        <if test="role.gradeid!=null and role.gradeid!=0">
239
+            and c.gradeid=#{role.gradeid}
240
+        </if>
241
+        order by c.gradeid,c.classtype,c.classorder,c.classname,convert(u.username using gbk)
242
+    </select>
222 243
 </mapper>

+ 3
- 2
suser/src/main/resources/mapper/gradeclass/GradeMapper.xml View File

@@ -61,13 +61,14 @@
61 61
             <result property="classtype" column="classtype"/>
62 62
             <collection property="students" ofType="java.util.Map" javaType="java.util.List">
63 63
                 <result property="studentid" column="studentid"/>
64
-                <result property="username" column="username"/>
64
+                <result property="studentname" column="studentname"/>
65
+                <result property="headpic" column="headpic"/>
65 66
             </collection>
66 67
         </collection>
67 68
     </resultMap>
68 69
     <select id="listClassStu" resultMap="gradeClassResult">
69 70
         select c.gradeid,c.classid,c.classname,c.classnum,c.classtype,c.classorder,c.year,c.schoolyear
70
-        ,cs.studentid,u.username
71
+        ,cs.studentid,u.username as studentname,u.headpic
71 72
         from t_class c left join t_class_student cs on c.classid=cs.classid
72 73
         left join t_user u on cs.studentid = u.userid
73 74
         where c.schoolid=#{schoolid} and c.year=#{year} and c.classstate=1 and c.classnum>0

Loading…
Cancel
Save