Browse Source

首页组件

tags/正式3.14.0
王宁 5 months ago
parent
commit
7128573dd0

+ 286
- 0
sapi/src/main/java/com/xhkjedu/sapi/controller/component/ComponentController.java View File

@@ -111,4 +111,290 @@ public class ComponentController {
111 111
         N_Utils.validation(new Object[]{userid, "用户ID", 1, limitSize, "数量", 1});
112 112
         return new ResultVo(0, componentService.listVideos(userid, limitSize));
113 113
     }
114
+
115
+    /*
116
+     * @Description 预习
117
+     * @Date 2024/7/22 9:26:52
118
+     * @Author WN
119
+     * @Param [params]
120
+     * @Return com.xhkjedu.vo.ResultVo
121
+     **/
122
+    @PostMapping("/list_guide")
123
+    public ResultVo listGuides(@RequestBody ComponentParams params) {
124
+        Integer userid = params.getUserid();
125
+        Integer limitSize = params.getLimitSize();
126
+        N_Utils.validation(new Object[]{userid, "用户ID", 1, limitSize, "数量", 1});
127
+        return new ResultVo(0, componentService.listGuides(userid, limitSize));
128
+    }
129
+
130
+    /*
131
+     * @Description 背诵
132
+     * @Date 2024/7/22 9:27:34
133
+     * @Author WN
134
+     * @Param [params]
135
+     * @Return com.xhkjedu.vo.ResultVo
136
+     **/
137
+    @PostMapping("/list_recited")
138
+    public ResultVo listReciteds(@RequestBody ComponentParams params) {
139
+        Integer userid = params.getUserid();
140
+        Integer limitSize = params.getLimitSize();
141
+        N_Utils.validation(new Object[]{userid, "用户ID", 1, limitSize, "数量", 1});
142
+        return new ResultVo(0, componentService.listReciteds(userid, limitSize));
143
+    }
144
+
145
+    /*
146
+     * @Description 课堂回顾
147
+     * @Date 2024/7/22 10:16:10
148
+     * @Author WN
149
+     * @Param [params]
150
+     * @Return com.xhkjedu.vo.ResultVo
151
+     **/
152
+    @PostMapping("/list_room")
153
+    public ResultVo listClassrooms(@RequestBody ComponentParams params) {
154
+        Integer userid = params.getUserid();
155
+        Integer limitSize = params.getLimitSize();
156
+        N_Utils.validation(new Object[]{userid, "用户ID", 1, limitSize, "数量", 1});
157
+        return new ResultVo(0, componentService.listClassrooms(userid, limitSize));
158
+    }
159
+
160
+    /*
161
+     * @Description 预习统计-班级
162
+     * @Date 2024/7/22 12:29:01
163
+     * @Author WN
164
+     * @Param [params]
165
+     * @Return com.xhkjedu.vo.ResultVo
166
+     **/
167
+    @PostMapping("/guide_class")
168
+    public ResultVo listGuidesStatisticClass(@RequestBody ComponentParams params) {
169
+        Integer userid = params.getUserid();
170
+        N_Utils.validation(new Object[]{userid, "用户ID", 1});
171
+        return new ResultVo(0, componentService.listGuidesStatisticClass(params));
172
+    }
173
+
174
+    /*
175
+     * @Description 预习统计-科目
176
+     * @Date 2024/7/22 14:22:29
177
+     * @Author WN
178
+     * @Param [params]
179
+     * @Return com.xhkjedu.vo.ResultVo
180
+     **/
181
+    @PostMapping("/guide_subject")
182
+    public ResultVo listGuidesStatisticSubject(@RequestBody ComponentParams params) {
183
+        Integer userid = params.getUserid();
184
+        N_Utils.validation(new Object[]{userid, "用户ID", 1});
185
+        return new ResultVo(0, componentService.listGuidesStatisticSubject(params));
186
+    }
187
+
188
+    /*
189
+     * @Description 作业统计-班级
190
+     * @Date 2024/7/22 15:36:23
191
+     * @Author WN
192
+     * @Param [params]
193
+     * @Return com.xhkjedu.vo.ResultVo
194
+     **/
195
+    @PostMapping("/paper_class")
196
+    public ResultVo listPapersStatisticClass(@RequestBody ComponentParams params) {
197
+        Integer userid = params.getUserid();
198
+        N_Utils.validation(new Object[]{userid, "用户ID", 1});
199
+        return new ResultVo(0, componentService.listPapersStatisticClass(params));
200
+    }
201
+
202
+    /*
203
+     * @Description 作业统计-科目
204
+     * @Date 2024/7/22 15:37:29
205
+     * @Author WN
206
+     * @Param [params]
207
+     * @Return com.xhkjedu.vo.ResultVo
208
+     **/
209
+    @PostMapping("/paper_subject")
210
+    public ResultVo listPapersStatisticSubject(@RequestBody ComponentParams params) {
211
+        Integer userid = params.getUserid();
212
+        N_Utils.validation(new Object[]{userid, "用户ID", 1});
213
+        return new ResultVo(0, componentService.listPapersStatisticSubject(params));
214
+    }
215
+
216
+    /*
217
+     * @Description 直播巡课
218
+     * @Date 2024/7/22 17:09:17
219
+     * @Author WN
220
+     * @Param [params]
221
+     * @Return com.xhkjedu.vo.ResultVo
222
+     **/
223
+    @PostMapping("/live_patrol")
224
+    public ResultVo listLivePatrol(@RequestBody ComponentParams params) {
225
+        Integer userid = params.getUserid();
226
+        N_Utils.validation(new Object[]{userid, "用户ID", 1});
227
+        return new ResultVo(0, componentService.listLivePatrol(params));
228
+    }
229
+
230
+    /*
231
+     * @Description 教师直播
232
+     * @Date 2024/7/22 17:20:50
233
+     * @Author WN
234
+     * @Param [params]
235
+     * @Return com.xhkjedu.vo.ResultVo
236
+     **/
237
+    @PostMapping("/live_teacher")
238
+    public ResultVo listLiveTeachers(@RequestBody ComponentParams params) {
239
+        Integer userid = params.getUserid();
240
+        Integer limitSize = params.getLimitSize();
241
+        N_Utils.validation(new Object[]{userid, "用户ID", 1, limitSize, "数量", 1});
242
+        return new ResultVo(0, componentService.listLiveTeachers(params));
243
+    }
244
+
245
+    /*
246
+     * @Description 班级错题集
247
+     * @Date 2024/7/23 10:21:22
248
+     * @Author WN
249
+     * @Param [params]
250
+     * @Return com.xhkjedu.vo.ResultVo
251
+     **/
252
+    @PostMapping("/class_errorq")
253
+    public ResultVo getClassErrorQuestion(@RequestBody ComponentParams params) {
254
+        Integer userid = params.getUserid();
255
+        Integer classid = params.getClassid();
256
+        N_Utils.validation(new Object[]{userid, "用户ID", 1, classid, "班级ID", 1});
257
+        return new ResultVo(0, componentService.getClassErrorQuestion(params));
258
+    }
259
+
260
+    /*
261
+     * @Description 我的班级
262
+     * @Date 2024/7/23 10:51:51
263
+     * @Author WN
264
+     * @Param [params]
265
+     * @Return com.xhkjedu.vo.ResultVo
266
+     **/
267
+    @PostMapping("/class_teacher")
268
+    public ResultVo getClassForTeacher(@RequestBody ComponentParams params) {
269
+        Integer userid = params.getUserid();
270
+        N_Utils.validation(new Object[]{userid, "用户ID", 1});
271
+        return new ResultVo(0, componentService.getClassForTeacher(params));
272
+    }
273
+
274
+    /*
275
+     * @Description 校本题库
276
+     * @Date 2024/7/23 11:24:09
277
+     * @Author WN
278
+     * @Param [params]
279
+     * @Return com.xhkjedu.vo.ResultVo
280
+     **/
281
+    @PostMapping("/question_statistic")
282
+    public ResultVo getQuestionStatistic(@RequestBody ComponentParams params) {
283
+        Integer userid = params.getUserid();
284
+        N_Utils.validation(new Object[]{userid, "用户ID", 1});
285
+        return new ResultVo(0, componentService.getQuestionStatistic(params));
286
+    }
287
+
288
+    /*
289
+     * @Description 教学统计
290
+     * @Date 2024/7/23 12:20:34
291
+     * @Author WN
292
+     * @Param [params]
293
+     * @Return com.xhkjedu.vo.ResultVo
294
+     **/
295
+    @PostMapping("/teach_statistic")
296
+    public ResultVo getTeachingStatistic(@RequestBody ComponentParams params) {
297
+        Integer userid = params.getUserid();
298
+        N_Utils.validation(new Object[]{userid, "用户ID", 1});
299
+        return new ResultVo(0, componentService.getTeachingStatistic(params));
300
+    }
301
+
302
+    /*
303
+     * @Description 常用应用
304
+     * @Date 2024/7/23 14:44:52
305
+     * @Author WN
306
+     * @Param [params]
307
+     * @Return com.xhkjedu.vo.ResultVo
308
+     **/
309
+    @PostMapping("/user_module")
310
+    public ResultVo listUserModules(@RequestBody ComponentParams params) {
311
+        Integer userid = params.getUserid();
312
+        Integer belongcode = params.getBelongcode();
313
+        N_Utils.validation(new Object[]{userid, "用户ID", 1,belongcode,"归属",1});
314
+        return new ResultVo(0, componentService.listUserModules(params));
315
+    }
316
+
317
+    /*
318
+     * @Description 考试-待出卷
319
+     * @Date 2024/7/23 15:00:42
320
+     * @Author WN
321
+     * @Param [params]
322
+     * @Return com.xhkjedu.vo.ResultVo
323
+     **/
324
+    @PostMapping("/exam_paper_giv")
325
+    public ResultVo listExamPaperGiv(@RequestBody ComponentParams params) {
326
+        Integer userid = params.getUserid();
327
+        N_Utils.validation(new Object[]{userid, "用户ID", 1});
328
+        return new ResultVo(0, componentService.listExamPaperGiv(params));
329
+    }
330
+
331
+    /*
332
+     * @Description 考试-待批阅
333
+     * @Date 2024/7/23 15:13:03
334
+     * @Author WN
335
+     * @Param [params]
336
+     * @Return com.xhkjedu.vo.ResultVo
337
+     **/
338
+    @PostMapping("/exam_paper_check")
339
+    public ResultVo listExamPaperCheck(@RequestBody ComponentParams params) {
340
+        Integer userid = params.getUserid();
341
+        N_Utils.validation(new Object[]{userid, "用户ID", 1});
342
+        return new ResultVo(0, componentService.listExamPaperCheck(params));
343
+    }
344
+
345
+    /*
346
+     * @Description 考试待监考
347
+     * @Date 2024/7/23 15:26:09
348
+     * @Author WN
349
+     * @Param [params]
350
+     * @Return com.xhkjedu.vo.ResultVo
351
+     **/
352
+    @PostMapping("/exam_invigilate")
353
+    public ResultVo listExamInvigilate(@RequestBody ComponentParams params) {
354
+        Integer userid = params.getUserid();
355
+        N_Utils.validation(new Object[]{userid, "用户ID", 1});
356
+        return new ResultVo(0, componentService.listExamInvigilate(params));
357
+    }
358
+
359
+    /*
360
+     * @Description 考试-校级报告
361
+     * @Date 2024/7/23 16:33:08
362
+     * @Author WN
363
+     * @Param [params]
364
+     * @Return com.xhkjedu.vo.ResultVo
365
+     **/
366
+    @PostMapping("/exam_report_school")
367
+    public ResultVo getExamReportSchool(@RequestBody ComponentParams params) {
368
+        Integer userid = params.getUserid();
369
+        N_Utils.validation(new Object[]{userid, "用户ID", 1});
370
+        return new ResultVo(0, componentService.getExamReportSchool(params));
371
+    }
372
+
373
+    /*
374
+     * @Description 考试-班级报告
375
+     * @Date 2024/7/23 17:58:10
376
+     * @Author WN
377
+     * @Param [params]
378
+     * @Return com.xhkjedu.vo.ResultVo
379
+     **/
380
+    @PostMapping("/exam_report_class")
381
+    public ResultVo getExamReportClass(@RequestBody ComponentParams params) {
382
+        Integer userid = params.getUserid();
383
+        N_Utils.validation(new Object[]{userid, "用户ID", 1});
384
+        return new ResultVo(0, componentService.getExamReportClass(params));
385
+    }
386
+
387
+    /*
388
+     * @Description 考试-单科报告
389
+     * @Date 2024/7/23 17:24:51
390
+     * @Author WN
391
+     * @Param [params]
392
+     * @Return com.xhkjedu.vo.ResultVo
393
+     **/
394
+    @PostMapping("/exam_report_single")
395
+    public ResultVo getExamReportSingle(@RequestBody ComponentParams params) {
396
+        Integer userid = params.getUserid();
397
+        N_Utils.validation(new Object[]{userid, "用户ID", 1});
398
+        return new ResultVo(0, componentService.getExamReportSingle(params));
399
+    }
114 400
 }

+ 83
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/component/ComponentMapper.java View File

@@ -1,5 +1,9 @@
1 1
 package com.xhkjedu.sapi.mapper.component;
2 2
 
3
+import com.xhkjedu.sapi.vo.analyze.work.SchoolWorkSubjectVo;
4
+import com.xhkjedu.sapi.vo.component.ComponentParams;
5
+import com.xhkjedu.sapi.vo.component.ExamInfoVo;
6
+import com.xhkjedu.sapi.vo.component.StudyStatisticVo;
3 7
 import com.xhkjedu.sapi.vo.notice.NoticeVo;
4 8
 import com.xhkjedu.vo.paper.PaperListVo;
5 9
 import org.apache.ibatis.annotations.Param;
@@ -31,4 +35,83 @@ public interface ComponentMapper {
31 35
 
32 36
     //同步视频
33 37
     List<Map<String,Object>> listVideos(@Param("userid") Integer userid, @Param("limitSize")Integer limitSize,@Param("schoolid")Integer schoolid);
38
+
39
+    //预习
40
+    List<Map<String,Object>> listGuides(@Param("userid") Integer userid, @Param("limitSize")Integer limitSize);
41
+
42
+    //背诵
43
+    List<Map<String,Object>> listReciteds(@Param("userid") Integer userid, @Param("limitSize")Integer limitSize);
44
+
45
+    //课堂回顾
46
+    List<Map<String,Object>> listClassrooms(@Param("userid") Integer userid, @Param("limitSize")Integer limitSize);
47
+
48
+    //预习统计-班级
49
+    List<StudyStatisticVo> listGuidesStatisticClass(@Param("params")ComponentParams params);
50
+
51
+    //预习统计-科目
52
+    List<StudyStatisticVo> listGuidesStatisticSubject(@Param("params")ComponentParams params);
53
+
54
+    //作业统计-班级
55
+    List<StudyStatisticVo> listPapersStatisticClass(@Param("params")ComponentParams params);
56
+
57
+    //作业统计-科目
58
+    List<StudyStatisticVo> listPapersStatisticSubject(@Param("params")ComponentParams params);
59
+
60
+    //直播巡课
61
+    Map<String,Object> listLivePatrol(@Param("params")ComponentParams params);
62
+
63
+    //教师直播
64
+    List<Map<String,Object>> listLiveTeachers(@Param("params")ComponentParams params);
65
+
66
+    //班级错题集-最近一次作业错题数量
67
+    Integer getClassErrorQuesLastPaper(@Param("params")ComponentParams params);
68
+
69
+    //班级做提及-错题数量和错题讲解数量
70
+    Map<String,Object> getClassErrorQuesAndExplain(@Param("params")ComponentParams params);
71
+
72
+    //我的班级-权限班级
73
+    List<Integer> listClassidsForTeacher(@Param("params")ComponentParams params);
74
+
75
+    //我的班级-学生数量分组数量
76
+    List<Integer> listClassStuAndGroup(@Param("userid") Integer userid, @Param("classidsStr")String classidsStr);
77
+
78
+    //校本题库-试题数量
79
+    Map<String,Integer> getQuestionStatistic(@Param("params")ComponentParams params);
80
+    //校本题库-当前学科试题数
81
+    Integer getQuestionStatisticSubejct(@Param("params")ComponentParams params);
82
+
83
+    //教学统计-班级学生教师数量
84
+    Map<String,Object> getTeachingSchoolClassNum(@Param("params")ComponentParams params);
85
+    //教学统计-作业
86
+    List<SchoolWorkSubjectVo> listTeachingPapers(@Param("params")ComponentParams params);
87
+    //教学统计-预习
88
+    List<SchoolWorkSubjectVo> listTeachingGuides(@Param("params")ComponentParams params);
89
+    //教学统计-背诵
90
+    List<SchoolWorkSubjectVo> listTeachingRecites(@Param("params")ComponentParams params);
91
+
92
+    //常用应用
93
+    List<Map<String,Object>> listUserModules(@Param("params")ComponentParams params);
94
+
95
+    //考试-待出卷
96
+    List<Map<String,Object>> listExamPaperGiv(@Param("params")ComponentParams params);
97
+    //考试-待批阅
98
+    List<Map<String,Object>> listExamPaperCheck(@Param("params")ComponentParams params);
99
+    //考试-待监考
100
+    List<Map<String,Object>> listExamInvigilate(@Param("params")ComponentParams params);
101
+    //考试-校级报告-获取最近一次生成报告的考试
102
+    Map<String,Object> getExamReportSchoolBase(@Param("schoolid")Integer schoolid);
103
+    //考试-校级报告-成绩概况
104
+    List<Map<String,Object>> listExamReportSchoolStatistic(@Param("examid")Integer examid);
105
+    //考试-班级报告-考试信息
106
+    ExamInfoVo getExamReportClassInfo(@Param("params")ComponentParams params);
107
+    //考试-班级报告-学科成绩对比
108
+    List<Map<String,Object>> listExamReportClassScore(@Param("params")ComponentParams params);
109
+    //考试-考试报告-参与班级
110
+    List<Map<String,Object>> listExamReportClass(@Param("examid")Integer examid,@Param("userid")Integer userid);
111
+    //考试-单科报告-单科考试信息
112
+    ExamInfoVo getExamReportSingleInfo(@Param("params")ComponentParams params);
113
+    //考试-单科报告-单科概况
114
+    Map<String,Object> getExamReportSingleBase(@Param("params")ComponentParams params);
115
+    //考试-单科报告-成绩等级分布
116
+    List<Map<String,Object>> listExamReportSingleRank(@Param("params")ComponentParams params);
34 117
 }

+ 3
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/gradeclass/ClassMapper.java View File

@@ -34,4 +34,7 @@ public interface ClassMapper extends TkMapper<TClass> {
34 34
 
35 35
     //班级学生id列表
36 36
     List<Integer> listStudentIdByClassIds(@Param("classIds") String classIds);
37
+
38
+    //教师任教行政班和提高班
39
+    String listTeacherClassids(@Param("teacherid") Integer teacherid,@Param("schoolid") Integer schoolid);
37 40
 }

+ 3
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/system/UserMapper.java View File

@@ -45,4 +45,7 @@ public interface UserMapper extends TkMapper<TUser> {
45 45
 
46 46
     //获取用户信息用于操作日志
47 47
     UserVo getUserInfoForHandleLog(@Param("userid") Integer userid);
48
+
49
+    //获取用户信息以及学段
50
+    UserVo getUserAndSchoolInfo(@Param("userid") Integer userid);
48 51
 }

+ 716
- 3
sapi/src/main/java/com/xhkjedu/sapi/service/component/ComponentService.java View File

@@ -1,17 +1,30 @@
1 1
 package com.xhkjedu.sapi.service.component;
2 2
 
3
+import com.alibaba.fastjson.JSON;
4
+import com.xhkjedu.sapi.mapper.analyze.SchoolPeopleMapper;
3 5
 import com.xhkjedu.sapi.mapper.component.ComponentMapper;
6
+import com.xhkjedu.sapi.mapper.gradeclass.ClassMapper;
7
+import com.xhkjedu.sapi.mapper.subjectbook.SubjectMapper;
4 8
 import com.xhkjedu.sapi.mapper.system.UserMapper;
9
+import com.xhkjedu.sapi.model.subjectbook.TSubject;
10
+import com.xhkjedu.sapi.utils.ApiUtil;
11
+import com.xhkjedu.sapi.vo.analyze.work.SchoolWorkSubjectVo;
12
+import com.xhkjedu.sapi.vo.component.ComponentParams;
13
+import com.xhkjedu.sapi.vo.component.ExamInfoVo;
14
+import com.xhkjedu.sapi.vo.component.StudyStatisticVo;
5 15
 import com.xhkjedu.sapi.vo.notice.NoticeVo;
16
+import com.xhkjedu.sapi.vo.subjectbook.SubjectVo;
6 17
 import com.xhkjedu.utils.N_Utils;
7 18
 import com.xhkjedu.vo.paper.PaperClassVo;
8 19
 import com.xhkjedu.vo.paper.PaperListVo;
20
+import com.xhkjedu.vo.system.UserVo;
9 21
 import org.springframework.stereotype.Service;
10 22
 
11 23
 import javax.annotation.Resource;
12
-import java.util.ArrayList;
13
-import java.util.List;
14
-import java.util.Map;
24
+import java.time.LocalDate;
25
+import java.time.LocalDateTime;
26
+import java.util.*;
27
+import java.util.stream.Collectors;
15 28
 
16 29
 /**
17 30
  * @Description:组件内容
@@ -24,6 +37,13 @@ public class ComponentService {
24 37
     private ComponentMapper componentMapper;
25 38
     @Resource
26 39
     private UserMapper userMapper;
40
+    @Resource
41
+    private SubjectMapper subjectMapper;
42
+    @Resource
43
+    private ClassMapper classMapper;
44
+    @Resource
45
+    SchoolPeopleMapper schoolPeopleMapper;
46
+
27 47
 
28 48
     /*
29 49
      * @Description 待批作业
@@ -112,4 +132,697 @@ public class ComponentService {
112 132
         Integer schoolid = userMapper.getSchoolIdByUserId(userid);
113 133
         return componentMapper.listVideos(userid, limitSize, schoolid);
114 134
     }
135
+
136
+    /*
137
+     * @Description 预习
138
+     * @Date 2024/7/22 9:26:20
139
+     * @Author WN
140
+     * @Param [userid, limitSize]
141
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
142
+     **/
143
+    public List<Map<String, Object>> listGuides(Integer userid, Integer limitSize) {
144
+        return componentMapper.listGuides(userid, limitSize);
145
+    }
146
+
147
+    /*
148
+     * @Description 背诵
149
+     * @Date 2024/7/22 9:27:12
150
+     * @Author WN
151
+     * @Param [userid, limitSize]
152
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
153
+     **/
154
+    public List<Map<String, Object>> listReciteds(Integer userid, Integer limitSize) {
155
+        return componentMapper.listReciteds(userid, limitSize);
156
+    }
157
+
158
+    /*
159
+     * @Description 课堂回顾
160
+     * @Date 2024/7/22 10:15:44
161
+     * @Author WN
162
+     * @Param [userid, limitSize]
163
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
164
+     **/
165
+    public List<Map<String, Object>> listClassrooms(Integer userid, Integer limitSize) {
166
+        return componentMapper.listClassrooms(userid, limitSize);
167
+    }
168
+
169
+
170
+    /*
171
+     * @Description 预习统计-班级
172
+     * @Date 2024/7/22 12:28:24
173
+     * @Author WN
174
+     * @Param [params]
175
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
176
+     **/
177
+    public List<Map<String, Object>> listGuidesStatisticClass(ComponentParams params) {
178
+        // 设置参数
179
+        setSchoolAndWeekTimeForStudy(params);
180
+        List<StudyStatisticVo> list = componentMapper.listGuidesStatisticClass(params);
181
+        // 获取所有班级
182
+        Map<Integer, List<StudyStatisticVo>> mapClass = list.stream().collect(Collectors.groupingBy(StudyStatisticVo::getClassid));
183
+
184
+        List<Map<String, Object>> maps = new ArrayList<>();
185
+        for (Map.Entry<Integer, List<StudyStatisticVo>> entry : mapClass.entrySet()) {
186
+            List<StudyStatisticVo> classList = entry.getValue();
187
+            // 获取班级总数量
188
+            Integer totalnum = classList.stream().mapToInt(StudyStatisticVo::getTotalnum).sum();
189
+            Integer commitnum = classList.stream().mapToInt(StudyStatisticVo::getCommitnum).sum();
190
+            double commitRate = N_Utils.getIntegerDivideAndMulitiply(commitnum, totalnum);// 预习率
191
+
192
+            StudyStatisticVo firstVo = classList.get(0);
193
+            Map<String, Object> map = new HashMap<>();
194
+            map.put("gradeid", firstVo.getGradeid());
195
+            map.put("classid", firstVo.getClassid());
196
+            map.put("classname", firstVo.getClassname());
197
+            map.put("weeknum", classList.size());
198
+            map.put("commitRate", commitRate);
199
+            // 获取班级当天发布次数
200
+            List<StudyStatisticVo> todayClassList =
201
+                    classList.stream().filter(s -> ApiUtil.getLocalDateByStamp(s.getCreatetime()).equals(LocalDate.now())).collect(Collectors.toList());
202
+            int daynum = 0;
203
+            if (todayClassList.size() > 0) {
204
+                daynum = todayClassList.size();
205
+            }
206
+            map.put("daynum", daynum);
207
+            maps.add(map);
208
+        }
209
+
210
+        return maps;
211
+    }
212
+
213
+    /*
214
+     * @Description 预习统计-科目
215
+     * @Date 2024/7/22 14:20:29
216
+     * @Author WN
217
+     * @Param [params]
218
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
219
+     **/
220
+    public List<Map<String, Object>> listGuidesStatisticSubject(ComponentParams params) {
221
+        // 设置参数
222
+        setSchoolAndWeekTimeForStudy(params);
223
+        List<StudyStatisticVo> list = componentMapper.listGuidesStatisticSubject(params);
224
+        // 获取所有科目
225
+        Map<String, List<StudyStatisticVo>> mapSubject = list.stream().collect(Collectors.groupingBy(StudyStatisticVo::getSubjectid));
226
+        // 获取学校科目
227
+        TSubject subject = new TSubject();
228
+        subject.setLevel(params.getSchoollevel());
229
+        subject.setSchoolid(params.getSchoolid());
230
+        List<SubjectVo> subjectVos = subjectMapper.listSubjectsForSel(subject);
231
+
232
+        List<Map<String, Object>> maps = new ArrayList<>();
233
+        for (SubjectVo subjectVo : subjectVos) {
234
+
235
+            int totalnum = 0;
236
+            int commitnum = 0;
237
+            double commitRate = 0;
238
+            int daynum = 0;
239
+            int weeknum = 0;
240
+            if (mapSubject.containsKey(subjectVo.getSubjectid())) {
241
+                List<StudyStatisticVo> subjectList = mapSubject.get(subjectVo.getSubjectid());
242
+                weeknum = subjectList.size();
243
+                // 获取班级总数量
244
+                totalnum = subjectList.stream().mapToInt(StudyStatisticVo::getTotalnum).sum();
245
+                commitnum = subjectList.stream().mapToInt(StudyStatisticVo::getCommitnum).sum();
246
+                commitRate = N_Utils.getIntegerDivideAndMulitiply(commitnum, totalnum);// 预习率
247
+                // 获取班级当天发布次数
248
+                List<StudyStatisticVo> todayClassList =
249
+                        subjectList.stream().filter(s -> ApiUtil.getLocalDateByStamp(s.getCreatetime()).equals(LocalDate.now())).collect(Collectors.toList());
250
+                if (todayClassList != null && todayClassList.size() > 0) {
251
+                    daynum = todayClassList.size();
252
+                }
253
+            }
254
+
255
+            Map<String, Object> map = new HashMap<>();
256
+            map.put("subjectname", subjectVo.getSubjectname());
257
+            map.put("weeknum", weeknum);
258
+            map.put("daynum", daynum);
259
+            map.put("commitRate", commitRate);
260
+            maps.add(map);
261
+        }
262
+        return maps;
263
+    }
264
+
265
+    // 设置参数
266
+    private void setSchoolAndWeekTimeForStudy(ComponentParams params) {
267
+        // 获取用户学校及用户类型
268
+        UserVo user = userMapper.getUserAndSchoolInfo(params.getUserid());
269
+        params.setUsertype(user.getUsertype());
270
+        params.setSchoolid(user.getSchoolid());
271
+        params.setSchoollevel(user.getSchoollevel());
272
+        // 获取当前日期所在周的起止时间
273
+        long[] dateWeek = ApiUtil.getNowWeekOfTimestamp();
274
+        params.setStarttime(dateWeek[0]);
275
+        params.setStoptime(dateWeek[1]);
276
+    }
277
+
278
+    /*
279
+     * @Description 作业统计-班级
280
+     * @Date 2024/7/22 15:32:13
281
+     * @Author WN
282
+     * @Param [params]
283
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
284
+     **/
285
+    public List<Map<String, Object>> listPapersStatisticClass(ComponentParams params) {
286
+        // 设置参数
287
+        setSchoolAndWeekTimeForStudy(params);
288
+        List<StudyStatisticVo> list = componentMapper.listPapersStatisticClass(params);
289
+        // 获取所有班级
290
+        Map<Integer, List<StudyStatisticVo>> mapClass = list.stream().collect(Collectors.groupingBy(StudyStatisticVo::getClassid));
291
+
292
+        List<Map<String, Object>> maps = new ArrayList<>();
293
+        for (Map.Entry<Integer, List<StudyStatisticVo>> entry : mapClass.entrySet()) {
294
+            List<StudyStatisticVo> classList = entry.getValue();
295
+            // 获取班级总数量
296
+            Integer totalnum = classList.stream().mapToInt(StudyStatisticVo::getTotalnum).sum();
297
+            Integer commitnum = classList.stream().mapToInt(StudyStatisticVo::getCommitnum).sum();
298
+            Integer checknum = classList.stream().mapToInt(StudyStatisticVo::getChecknum).sum();
299
+            double commitRate = N_Utils.getIntegerDivideAndMulitiply(commitnum, totalnum);// 预习率
300
+            double checkRate = N_Utils.getIntegerDivideAndMulitiply(checknum, commitnum);// 批改率
301
+
302
+            StudyStatisticVo firstVo = classList.get(0);
303
+            Map<String, Object> map = new HashMap<>();
304
+            map.put("gradeid", firstVo.getGradeid());
305
+            map.put("classid", firstVo.getClassid());
306
+            map.put("classname", firstVo.getClassname());
307
+            map.put("weeknum", classList.size());
308
+            map.put("commitRate", commitRate);
309
+            map.put("checkRate", checkRate);
310
+            // 获取班级当天发布次数
311
+            List<StudyStatisticVo> todayClassList =
312
+                    classList.stream().filter(s -> ApiUtil.getLocalDateByStamp(s.getCreatetime()).equals(LocalDate.now())).collect(Collectors.toList());
313
+            int daynum = 0;
314
+            if (todayClassList != null && todayClassList.size() > 0) {
315
+                daynum = todayClassList.size();
316
+            }
317
+            map.put("daynum", daynum);
318
+            maps.add(map);
319
+        }
320
+
321
+        return maps;
322
+    }
323
+
324
+    /*
325
+     * @Description 作业统计-科目
326
+     * @Date 2024/7/22 15:35:31
327
+     * @Author WN
328
+     * @Param [params]
329
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
330
+     **/
331
+    public List<Map<String, Object>> listPapersStatisticSubject(ComponentParams params) {
332
+        // 设置参数
333
+        setSchoolAndWeekTimeForStudy(params);
334
+        List<StudyStatisticVo> list = componentMapper.listPapersStatisticSubject(params);
335
+        // 获取所有科目
336
+        Map<String, List<StudyStatisticVo>> mapSubject = list.stream().collect(Collectors.groupingBy(StudyStatisticVo::getSubjectid));
337
+        // 获取学校科目
338
+        TSubject subject = new TSubject();
339
+        subject.setLevel(params.getSchoollevel());
340
+        subject.setSchoolid(params.getSchoolid());
341
+        List<SubjectVo> subjectVos = subjectMapper.listSubjectsForSel(subject);
342
+
343
+        List<Map<String, Object>> maps = new ArrayList<>();
344
+        for (SubjectVo subjectVo : subjectVos) {
345
+
346
+            int totalnum = 0;
347
+            int commitnum = 0;
348
+            double commitRate = 0;
349
+            double checkRate = 0;
350
+            int daynum = 0;
351
+            int weeknum = 0;
352
+            if (mapSubject.containsKey(subjectVo.getSubjectid())) {
353
+                List<StudyStatisticVo> subjectList = mapSubject.get(subjectVo.getSubjectid());
354
+                weeknum = subjectList.size();
355
+                // 获取班级总数量
356
+                totalnum = subjectList.stream().mapToInt(StudyStatisticVo::getTotalnum).sum();
357
+                commitnum = subjectList.stream().mapToInt(StudyStatisticVo::getCommitnum).sum();
358
+                int checknum = subjectList.stream().mapToInt(StudyStatisticVo::getChecknum).sum();
359
+                commitRate = N_Utils.getIntegerDivideAndMulitiply(commitnum, totalnum);// 预习率
360
+                checkRate = N_Utils.getIntegerDivideAndMulitiply(checknum, commitnum);
361
+                // 获取班级当天发布次数
362
+                List<StudyStatisticVo> todayClassList =
363
+                        subjectList.stream().filter(s -> ApiUtil.getLocalDateByStamp(s.getCreatetime()).equals(LocalDate.now())).collect(Collectors.toList());
364
+                if (todayClassList != null && todayClassList.size() > 0) {
365
+                    daynum = todayClassList.size();
366
+                }
367
+            }
368
+
369
+            Map<String, Object> map = new HashMap<>();
370
+            map.put("subjectname", subjectVo.getSubjectname());
371
+            map.put("weeknum", weeknum);
372
+            map.put("daynum", daynum);
373
+            map.put("commitRate", commitRate);
374
+            map.put("checkRate", checkRate);
375
+            maps.add(map);
376
+        }
377
+        return maps;
378
+    }
379
+
380
+    /*
381
+     * @Description 直播巡课
382
+     * @Date 2024/7/22 16:47:52
383
+     * @Author WN
384
+     * @Param [params]
385
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
386
+     **/
387
+    public Map<String, Object> listLivePatrol(ComponentParams params) {
388
+        // 获取用户学校及用户类型
389
+        UserVo user = userMapper.getUserAndSchoolInfo(params.getUserid());
390
+        params.setUsertype(user.getUsertype());
391
+        params.setSchoolid(user.getSchoolid());
392
+
393
+        // 获取教师任教班级
394
+        if (user.getUsertype() == 1) {
395
+            String classids = classMapper.listTeacherClassids(params.getUserid(), user.getSchoolid());
396
+            params.setClassids(classids);
397
+        }
398
+        // 当前日期
399
+        params.setTodayDate(LocalDate.now());
400
+        Map<String, Object> map = componentMapper.listLivePatrol(params);
401
+        if (map == null || map.isEmpty()) {
402
+            map = new HashMap<>();
403
+            map.put("timestr", params.getTodayDate());
404
+            map.put("num", 0);
405
+            map.put("wksnum", 0);
406
+            map.put("jxznum", 0);
407
+            map.put("yjsnum", 0);
408
+            map.put("ygqnum", 0);
409
+        }
410
+
411
+        return map;
412
+    }
413
+
414
+
415
+    /*
416
+     * @Description 教师直播
417
+     * @Date 2024/7/22 17:20:35
418
+     * @Author WN
419
+     * @Param [params]
420
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
421
+     **/
422
+    public List<Map<String, Object>> listLiveTeachers(ComponentParams params) {
423
+        // 当前日期
424
+        params.setTodayDatetime(LocalDateTime.now());
425
+        return componentMapper.listLiveTeachers(params);
426
+    }
427
+
428
+    /*
429
+     * @Description 班级错题集
430
+     * @Date 2024/7/23 10:19:52
431
+     * @Author WN
432
+     * @Param [params]
433
+     * @Return void
434
+     **/
435
+    public Map<String,Object> getClassErrorQuestion(ComponentParams params) {
436
+        long[] yeartimestamp = ApiUtil.getNowhalfYearTimestamp();//近半年
437
+        params.setStarttime(yeartimestamp[0]);
438
+        params.setStoptime(yeartimestamp[1]);
439
+
440
+        // 获取当前教师班级最近一次已生成报告作业
441
+        Integer lastError = componentMapper.getClassErrorQuesLastPaper(params);
442
+        Map<String,Object> map =  componentMapper.getClassErrorQuesAndExplain(params);
443
+        if(map == null || map.isEmpty()) {
444
+            map = new HashMap<>();
445
+            map.put("quesnum",0);
446
+            map.put("explainnum",0);
447
+        }
448
+        if(lastError == null){
449
+            lastError = 0;
450
+        }
451
+        map.put("lasterror",lastError);
452
+        return map;
453
+    }
454
+
455
+    /*
456
+     * @Description 我的班级 (classtype 1,2,3)
457
+     * @Date 2024/7/23 10:51:25
458
+     * @Author WN
459
+     * @Param [params]
460
+     * @Return java.util.Map<java.lang.String,java.lang.Integer>
461
+     **/
462
+    public Map<String,Integer> getClassForTeacher(ComponentParams params){
463
+        Integer schoolid = userMapper.getSchoolIdByUserId(params.getUserid());
464
+        params.setSchoolid(schoolid);
465
+        List<Integer> classids = componentMapper.listClassidsForTeacher(params);//权限班级
466
+        int classnum = 0;
467
+        int stunum = 0;
468
+        int groupnum = 0;
469
+        if(classids != null && classids.size() > 0) {
470
+            classnum = classids.size();
471
+            String classidsStr = classids.stream()
472
+                                .map(Object::toString)
473
+                                .collect(Collectors.joining(","));
474
+            List<Integer> stuGroups = componentMapper.listClassStuAndGroup(params.getUserid(),classidsStr);
475
+            if(stuGroups != null && stuGroups.size() > 0) {
476
+                stunum = stuGroups.get(0);
477
+                groupnum = stuGroups.get(1);
478
+            }
479
+        }
480
+
481
+        Map<String,Integer> map = new HashMap<>();
482
+        map.put("classnum",classnum);
483
+        map.put("stunum",stunum);
484
+        map.put("groupnum",groupnum);
485
+        return map;
486
+    }
487
+
488
+    /*
489
+     * @Description 校本题库
490
+     * @Date 2024/7/23 11:23:11
491
+     * @Author WN
492
+     * @Param [params]
493
+     * @Return java.util.Map<java.lang.String,java.lang.Integer>
494
+     **/
495
+    public Map<String,Integer> getQuestionStatistic(ComponentParams params){
496
+        UserVo uservo = userMapper.getUserAndSchoolInfo(params.getUserid());
497
+        params.setSchoolid(uservo.getSchoolid());
498
+        params.setSchoollevel(uservo.getSchoollevel());
499
+
500
+        Map<String,Integer> map = componentMapper.getQuestionStatistic(params);
501
+        if(map == null || map.isEmpty()){
502
+            map = new HashMap<>();
503
+            map.put("totalnum",0);
504
+            map.put("todaynum",0);
505
+        }
506
+        //获取当前学科试题数量
507
+        Integer subjectnum = componentMapper.getQuestionStatisticSubejct(params);
508
+        if(subjectnum == null){
509
+            subjectnum = 0;
510
+        }
511
+        map.put("subjectnum",subjectnum);
512
+
513
+        return  map;
514
+    }
515
+
516
+    /*
517
+     * @Description 教学统计
518
+     * @Date 2024/7/23 12:19:54
519
+     * @Author WN
520
+     * @Param [params]
521
+     * @Return java.util.Map<java.lang.String,java.lang.Object>
522
+     **/
523
+    public Map<String,Object> getTeachingStatistic(ComponentParams params){
524
+        UserVo uservo = userMapper.getUserAndSchoolInfo(params.getUserid());
525
+        params.setSchoolid(uservo.getSchoolid());
526
+        params.setSchoollevel(uservo.getSchoollevel());
527
+        params.setYear(uservo.getYear());
528
+
529
+        //近半年
530
+        long[] yeartimestamp = ApiUtil.getNowhalfYearTimestamp();
531
+        params.setStarttime(yeartimestamp[0]);
532
+        params.setStoptime(yeartimestamp[1]);
533
+
534
+        params.setTimestamp(N_Utils.getSecondTimestamp());
535
+
536
+        Map<String,Object> map = componentMapper.getTeachingSchoolClassNum(params);//班级总数量
537
+
538
+        //作业
539
+        List<SchoolWorkSubjectVo> lst = componentMapper.listTeachingPapers(params);
540
+        Integer paperTotalnum = 0;
541
+        double paperCommitRate = 0;
542
+        double paperCheckRate = 0;
543
+
544
+        if(lst!=null && lst.size()>0){
545
+            for(SchoolWorkSubjectVo subject : lst){
546
+                subject.setCommitrate(N_Utils.getIntegerDivideAndMulitiply(subject.getCommitnum(),subject.getStunum()));
547
+                subject.setCheckrate(N_Utils.getIntegerDivideAndMulitiply(subject.getChecknum(),subject.getCommitnum()));
548
+                subject.setWorklist(new ArrayList<>());
549
+            }
550
+
551
+            paperTotalnum = lst.stream().mapToInt(SchoolWorkSubjectVo::getFabunum).sum();
552
+            Integer totalcommit =  lst.stream().mapToInt(SchoolWorkSubjectVo::getCommitnum).sum();
553
+            Integer totalcheck = lst.stream().mapToInt(SchoolWorkSubjectVo::getChecknum).sum();
554
+            Integer totalstunum = lst.stream().mapToInt(SchoolWorkSubjectVo::getStunum).sum();
555
+            paperCommitRate  = N_Utils.getIntegerDivideAndMulitiply(totalcommit,totalstunum);
556
+            if(totalcommit>0){
557
+                paperCheckRate = N_Utils.getIntegerDivideAndMulitiply(totalcheck,totalcommit);
558
+            }
559
+        }
560
+        map.put("paperTotalnum",paperTotalnum);
561
+        map.put("paperCommitRate",paperCommitRate);
562
+        map.put("paperCheckRate",paperCheckRate);
563
+
564
+        //预习
565
+        List<SchoolWorkSubjectVo> guideList = componentMapper.listTeachingGuides(params);
566
+        Integer guideTotalnum = 0;
567
+        double guideCommitRate = 0;
568
+        if(guideList!=null && guideList.size()>0){
569
+            for(SchoolWorkSubjectVo subject : guideList){
570
+                subject.setCommitrate(N_Utils.getIntegerDivideAndMulitiply(subject.getCommitnum(),subject.getStunum()));
571
+
572
+                subject.setWorklist(new ArrayList<>());
573
+            }
574
+
575
+            guideTotalnum = lst.stream().mapToInt(SchoolWorkSubjectVo::getFabunum).sum();
576
+            Integer totalstunum = lst.stream().mapToInt(SchoolWorkSubjectVo::getStunum).sum();
577
+            Integer totalcommit = lst.stream().mapToInt(SchoolWorkSubjectVo::getCommitnum).sum();
578
+            if(totalcommit>0){
579
+                guideCommitRate = N_Utils.getIntegerDivideAndMulitiply(totalcommit,totalstunum);
580
+            }
581
+        }
582
+        map.put("guideTotalnum",guideTotalnum);
583
+        map.put("guideCommitRate",guideCommitRate);
584
+
585
+        //背诵
586
+        // List<SchoolWorkSubjectVo> reciteList = componentMapper.listTeachingRecites(params);
587
+        // int reciteTotalnum = 0;
588
+        // double reciteCommitRate = 0;
589
+        // if(reciteList!=null && reciteList.size()>0){
590
+        //     for(SchoolWorkSubjectVo subject : lst){
591
+        //         subject.setCommitrate(N_Utils.getIntegerDivideAndMulitiply(subject.getCommitnum(),subject.getStunum()));
592
+        //
593
+        //         subject.setWorklist(new ArrayList<>());
594
+        //     }
595
+        //     reciteTotalnum = lst.stream().mapToInt(SchoolWorkSubjectVo::getFabunum).sum();
596
+        //     Integer totalstunum = lst.stream().mapToInt(SchoolWorkSubjectVo::getStunum).sum();
597
+        //     Integer totalcommit = lst.stream().mapToInt(SchoolWorkSubjectVo::getCommitnum).sum();
598
+        //     if(totalcommit>0){
599
+        //         reciteCommitRate = N_Utils.getIntegerDivideAndMulitiply(totalcommit,totalstunum);
600
+        //     }
601
+        // }
602
+        // map.put("reciteTotalnum",reciteTotalnum);
603
+        // map.put("reciteCommitRate",reciteCommitRate);
604
+
605
+        return  map;
606
+    }
607
+
608
+    /*
609
+     * @Description 常用应用
610
+     * @Date 2024/7/23 14:43:54
611
+     * @Author WN
612
+     * @Param [params]
613
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
614
+     **/
615
+    public List<Map<String,Object>> listUserModules(ComponentParams params){
616
+        return componentMapper.listUserModules(params);
617
+    }
618
+
619
+    /*
620
+     * @Description 考试-待出卷
621
+     * @Date 2024/7/23 15:00:08
622
+     * @Author WN
623
+     * @Param [params]
624
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
625
+     **/
626
+    public List<Map<String,Object>> listExamPaperGiv(ComponentParams params){
627
+        params.setTodayDatetime(LocalDateTime.now());
628
+        return componentMapper.listExamPaperGiv(params);
629
+    }
630
+
631
+    /*
632
+     * @Description 考试-待批阅
633
+     * @Date 2024/7/23 15:12:24
634
+     * @Author WN
635
+     * @Param [params]
636
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
637
+     **/
638
+    public List<Map<String,Object>> listExamPaperCheck(ComponentParams params){
639
+        return componentMapper.listExamPaperCheck(params);
640
+    }
641
+
642
+    /*
643
+     * @Description 考试-待监考
644
+     * @Date 2024/7/23 15:25:42
645
+     * @Author WN
646
+     * @Param [params]
647
+     * @Return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
648
+     **/
649
+    public List<Map<String,Object>> listExamInvigilate(ComponentParams params){
650
+        params.setTodayDatetime(LocalDateTime.now());
651
+        Integer schoolid = userMapper.getSchoolIdByUserId(params.getUserid());
652
+
653
+        List<Map<String,Object>> list = componentMapper.listExamInvigilate(params);
654
+        for (Map map : list) {
655
+            List<Map> classes = JSON.parseArray(map.get("classnames").toString(), Map.class);
656
+            List<Map> classList = new ArrayList<>();
657
+            Integer majored = (Integer) map.get("majored");
658
+            if (majored == 1) {//主监考
659
+                classList.addAll(classes);
660
+            } else {
661
+                String[] classids2 = map.get("classids").toString().split(",");
662
+                for (String classid : classids2) {
663
+                    Map cmap = classes.stream().filter(c -> c.get("classid").toString().equals(classid)).findFirst().orElse(null);
664
+                    if (cmap != null) classList.add(cmap);
665
+                }
666
+            }
667
+            map.remove("classids");
668
+            map.remove("classnames");
669
+            List<Map> schools = new ArrayList<>();
670
+            Map<Integer, List<Map>> collect = classList.stream().collect(Collectors.groupingBy(c -> (Integer) c.get("schoolid")));
671
+            for (Map.Entry<Integer, List<Map>> entry : collect.entrySet()) {
672
+                List<Map> clist = entry.getValue();
673
+                Map school = new HashMap();
674
+                school.put("schoolid", entry.getKey());
675
+                for (int i = 0; i < clist.size(); i++) {
676
+                    Map c = clist.get(i);
677
+                    if (i == 0) {
678
+                        school.put("schoolname", c.get("schoolname"));
679
+                    }
680
+                    c.remove("schoolid");
681
+                    c.remove("schoolname");
682
+                }
683
+                school.put("classes", clist);
684
+                schools.add(school);
685
+            }
686
+            if (schools.size() > 1) {
687
+                //把本校放在第一个位置
688
+                for (int i = 0; i < schools.size(); i++) {
689
+                    Map rtnMap = schools.get(i);
690
+                    Integer schoolid2 = Integer.parseInt(rtnMap.get("schoolid").toString());
691
+                    if (schoolid.equals(schoolid2)) {
692
+                        Collections.swap(schools, i, 0);
693
+                        break;
694
+                    }
695
+                }
696
+            }
697
+            map.put("schools", schools);
698
+        }
699
+
700
+        return list;
701
+    }
702
+
703
+    /*
704
+     * @Description 考试-校级报告
705
+     * @Date 2024/7/23 16:28:31
706
+     * @Author WN
707
+     * @Param [params]
708
+     * @Return java.util.Map<java.lang.String,java.lang.Object>
709
+     **/
710
+    public Map<String,Object> getExamReportSchool(ComponentParams params){
711
+        Integer schoolid = userMapper.getSchoolIdByUserId(params.getUserid());
712
+        //获取最新近一次有报告的考试
713
+        Map<String,Object> map = componentMapper.getExamReportSchoolBase(schoolid);
714
+        if(map!=null && !map.isEmpty()){
715
+            Integer examid = Integer.parseInt(map.get("examid").toString());
716
+            List<Map<String,Object>> subjects = componentMapper.listExamReportSchoolStatistic(examid);
717
+            map.put("subjects",subjects);
718
+        }else {
719
+            map = new HashMap<>();
720
+            map.put("classnum", 0);
721
+            map.put("stunum", 0);
722
+            map.put("missnum", 0);
723
+            map.put("subjectnum", 0);
724
+            map.put("maxscore", 0);
725
+            map.put("avgscore", 0);
726
+            map.put("mixscore", 0);
727
+
728
+            map.put("subjects",new ArrayList<>());
729
+        }
730
+        return map;
731
+    }
732
+
733
+    /*
734
+     * @Description 考试-班级报告
735
+     * @Date 2024/7/23 17:57:54
736
+     * @Author WN
737
+     * @Param [params]
738
+     * @Return java.util.Map<java.lang.String,java.lang.Object>
739
+     **/
740
+    public Map<String,Object> getExamReportClass(ComponentParams params){
741
+        Integer schoolid = userMapper.getSchoolIdByUserId(params.getUserid());
742
+        params.setSchoolid(schoolid);
743
+
744
+        Map<String,Object> map = new HashMap<>();
745
+        ExamInfoVo examInfoVo = componentMapper.getExamReportClassInfo(params);
746
+        if(examInfoVo != null){
747
+            params.setSubjectid("zf");
748
+            params.setClassid(examInfoVo.getClassid());
749
+            params.setShowrank(examInfoVo.getTeashowrank());
750
+            params.setExamid(examInfoVo.getExamid());
751
+
752
+            map = componentMapper.getExamReportSingleBase(params);
753
+
754
+            //获取考试关联的班级信息
755
+            List<Map<String,Object>> classList = componentMapper.listExamReportClass(examInfoVo.getExamid(),params.getUserid());
756
+            map.put("classlist",classList);
757
+
758
+
759
+            List<Map<String,Object>> subjectList = new ArrayList<>();
760
+            if(examInfoVo.getTeashowrank() == 3){
761
+                subjectList = componentMapper.listExamReportClassScore(params);
762
+            }
763
+            map.put("subjectlist",subjectList);
764
+        }else{
765
+            map = new HashMap<>();
766
+            map.put("classlist", new ArrayList<>());
767
+            map.put("subjectlist", new ArrayList<>());
768
+            map.put("yxrate", 0);
769
+            map.put("jgrate", 0);
770
+            map.put("classmaxscore", 0);
771
+            map.put("classavgscore", 0);
772
+            map.put("classavgscorerank", 0);
773
+            map.put("schoolmaxscore", 0);
774
+            map.put("schoolavgscore", 0);
775
+        }
776
+
777
+        return map;
778
+    }
779
+
780
+    /*
781
+     * @Description 考试-单科报告
782
+     * @Date 2024/7/23 17:23:57
783
+     * @Author WN
784
+     * @Param [params]
785
+     * @Return java.util.Map<java.lang.String,java.lang.Object>
786
+     **/
787
+    public Map<String,Object> getExamReportSingle(ComponentParams params){
788
+        Integer schoolid = userMapper.getSchoolIdByUserId(params.getUserid());
789
+        params.setSchoolid(schoolid);
790
+
791
+        Map<String,Object> map = new HashMap<>();
792
+        ExamInfoVo examInfoVo = componentMapper.getExamReportSingleInfo(params);
793
+
794
+        if(examInfoVo != null){
795
+            params.setSubjectid(examInfoVo.getSubjectid());
796
+            params.setClassid(examInfoVo.getClassid());
797
+            params.setShowrank(examInfoVo.getTeashowrank());
798
+            params.setExamid(examInfoVo.getExamid());
799
+
800
+            map = componentMapper.getExamReportSingleBase(params);
801
+
802
+            //获取考试关联的班级信息
803
+            List<Map<String,Object>> classList = componentMapper.listExamReportClass(examInfoVo.getExamid(),params.getUserid());
804
+            map.put("classlist",classList);
805
+
806
+            List<Map<String,Object>> rankList = new ArrayList<>();
807
+            if(examInfoVo.getTeashowrank() == 3){
808
+                rankList = componentMapper.listExamReportSingleRank(params);
809
+            }
810
+            map.put("ranklist",rankList);
811
+        }else{
812
+            map = new HashMap<>();
813
+            map.put("classlist", new ArrayList<>());
814
+            map.put("ranklist", new ArrayList<>());
815
+            map.put("yxrate", 0);
816
+            map.put("jgrate", 0);
817
+            map.put("classmaxscore", 0);
818
+            map.put("classavgscore", 0);
819
+            map.put("classavgscorerank", 0);
820
+            map.put("schoolmaxscore", 0);
821
+            map.put("schoolavgscore", 0);
822
+        }
823
+
824
+        return map;
825
+    }
826
+
827
+
115 828
 }

+ 92
- 19
sapi/src/main/java/com/xhkjedu/sapi/utils/ApiUtil.java View File

@@ -12,6 +12,9 @@ import org.springframework.web.client.RestClientException;
12 12
 import org.springframework.web.client.RestTemplate;
13 13
 
14 14
 import java.text.SimpleDateFormat;
15
+import java.time.*;
16
+import java.time.temporal.ChronoUnit;
17
+import java.time.temporal.TemporalAdjusters;
15 18
 import java.util.ArrayList;
16 19
 import java.util.Date;
17 20
 import java.util.List;
@@ -31,26 +34,27 @@ public class ApiUtil {
31 34
     public static Integer id = 0;
32 35
     public static Map<String, String> uriMap = new ConcurrentHashMap<>();
33 36
 
34
-    //获取id
35
-    public static synchronized String getId(){
37
+    // 获取id
38
+    public static synchronized String getId() {
36 39
         Integer nummin = ConfigKey.nummin;
37 40
         Integer nummax = ConfigKey.nummax;
38 41
         if (id == 0 || id.equals(nummax)) {
39 42
             id = nummin;
40 43
         } else {
41
-            id ++;
44
+            id++;
42 45
         }
43
-        String _num = (getSecondTimestamp() + ConfigKey.numadd) +"" + id;
46
+        String _num = (getSecondTimestamp() + ConfigKey.numadd) + "" + id;
44 47
         long num = Long.parseLong(_num);
45
-        return Long.toString(num,36).toUpperCase();
48
+        return Long.toString(num, 36).toUpperCase();
46 49
     }
47 50
 
48 51
     /**
49 52
      * 发送form-data请求返回json结果
53
+     *
54
+     * @return java.lang.String
50 55
      * @Param [apiUrl, param]
51 56
      * @Author ywx
52 57
      * @Date 2021/5/14 17:41
53
-     * @return java.lang.String
54 58
      **/
55 59
     public static String sendFormData(String apiUrl, MultiValueMap<String, String> param) {
56 60
         try {
@@ -64,36 +68,105 @@ public class ApiUtil {
64 68
             String result = response.getBody();
65 69
             return result;
66 70
         } catch (RestClientException e) {
67
-            log.error("发送form-data请求失败",e.getMessage());
71
+            log.error("发送form-data请求失败", e.getMessage());
68 72
             return null;
69 73
         }
70 74
     }
71 75
 
72 76
     /*
73
-    * @Description 比较当前时间和时间段
74
-    * @Author WN
75
-    * @Date 2023/6/15 11:24:59
76
-    */
77
-    public static boolean compareCurrDateTime(String starttimeStr,String stoptimeStr) throws Exception{
77
+     * @Description 比较当前时间和时间段
78
+     * @Author WN
79
+     * @Date 2023/6/15 11:24:59
80
+     */
81
+    public static boolean compareCurrDateTime(String starttimeStr, String stoptimeStr) throws Exception {
78 82
         boolean rtn = false;
79
-        if(N_Utils.isEmpty(starttimeStr) || N_Utils.isEmpty(stoptimeStr)){
83
+        if (N_Utils.isEmpty(starttimeStr) || N_Utils.isEmpty(stoptimeStr)) {
80 84
             rtn = false;
81
-        }else{
85
+        } else {
82 86
             SimpleDateFormat sdf = new SimpleDateFormat("MM-dd HH:mm");
83 87
 
84
-            Date starttime = sdf.parse(starttimeStr); //开始时间
85
-            Date stoptime = sdf.parse(stoptimeStr); //结束时间
88
+            Date starttime = sdf.parse(starttimeStr); // 开始时间
89
+            Date stoptime = sdf.parse(stoptimeStr); // 结束时间
86 90
 
87 91
             Date nowtime = new Date();
88 92
             String times = sdf.format(nowtime);
89
-            Date currtime = sdf.parse(times);//当前时间
93
+            Date currtime = sdf.parse(times);// 当前时间
90 94
 
91
-            //当前时间在开始时间之前或者等于开始时间  并且 当前时间在结束时间之后或者等于结束时间
92
-            if((starttime.before(currtime) || starttime.equals(currtime)) && (stoptime.after(currtime) || stoptime.equals(currtime))){
95
+            // 当前时间在开始时间之前或者等于开始时间  并且 当前时间在结束时间之后或者等于结束时间
96
+            if ((starttime.before(currtime) || starttime.equals(currtime)) && (stoptime.after(currtime) || stoptime.equals(currtime))) {
93 97
                 rtn = true;
94 98
             }
95 99
         }
96 100
 
97 101
         return rtn;
98 102
     }
103
+
104
+    /*
105
+     * @Description 获取当前时间所在周的开始时间和结束时间
106
+     * @Date 2024/7/22 10:33:54
107
+     * @Author WN
108
+     * @Param []
109
+     * @Return long[]
110
+     **/
111
+    public static long[] getNowWeekOfTimestamp() {
112
+        LocalDate now = LocalDate.now();
113
+        LocalDate startOfWeek = now.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
114
+        LocalDate endOfWeek = now.with(TemporalAdjusters.nextOrSame(DayOfWeek.SUNDAY));
115
+
116
+        long starttimestamp = startOfWeek.atStartOfDay(ZoneOffset.ofHours(8)).toInstant().toEpochMilli();
117
+
118
+        LocalDateTime dateTime = endOfWeek.atTime(23, 59, 59);
119
+        long endtimestamp = dateTime.atZone(ZoneId.systemDefault()).toEpochSecond();
120
+
121
+        long[] rtnTimestamp = new long[2];
122
+        rtnTimestamp[0] = starttimestamp / 1000;
123
+        rtnTimestamp[1] = endtimestamp;
124
+        return rtnTimestamp;
125
+    }
126
+
127
+    /*
128
+     * @Description 获取当前时间以及半年前时间
129
+     * @Date 2024/7/23 9:15:21
130
+     * @Author WN
131
+     * @Param []
132
+     * @Return long[]
133
+     **/
134
+    public static long[] getNowhalfYearTimestamp() {
135
+        LocalDate today = LocalDate.now(); // 获取当前日期
136
+        LocalDate halfYearAgo = today.minus(6, ChronoUnit.MONTHS); // 当前日期往前推6个月
137
+
138
+        long starttimestamp = halfYearAgo.atStartOfDay(ZoneOffset.ofHours(8)).toInstant().toEpochMilli();
139
+        LocalDateTime dateTime = today.atTime(23, 59, 59);
140
+
141
+        long endtimestamp = dateTime.atZone(ZoneId.systemDefault()).toEpochSecond();
142
+
143
+        long[] rtnTimestamp = new long[2];
144
+        rtnTimestamp[0] = starttimestamp / 1000;
145
+        rtnTimestamp[1] = endtimestamp;
146
+
147
+        return rtnTimestamp;
148
+    }
149
+
150
+    /*
151
+     * @Description 获取时间戳对应年月日
152
+     * @Date 2024/7/22 12:18:23
153
+     * @Author WN
154
+     * @Param [timestamp]
155
+     * @Return java.time.LocalDate
156
+     **/
157
+    public static LocalDate getLocalDateByStamp(Integer timestamp) {
158
+        // 使用时间戳构建Instant
159
+        Instant instant = Instant.ofEpochSecond(timestamp);
160
+
161
+        // 转换为ZoneId的时间
162
+        LocalDate localDate = instant.atZone(ZoneId.systemDefault()).toLocalDate();
163
+        return localDate;
164
+    }
165
+
166
+    public static void main(String[] args) {
167
+        LocalDate today = LocalDate.now(); // 获取当前日期
168
+        LocalDate halfYearAgo = today.minus(6, ChronoUnit.MONTHS); // 当前日期往前推6个月
169
+        System.out.println("半年前的日期是: " + halfYearAgo);
170
+    }
171
+
99 172
 }

+ 37
- 3
sapi/src/main/java/com/xhkjedu/sapi/vo/component/ComponentParams.java View File

@@ -3,6 +3,8 @@ package com.xhkjedu.sapi.vo.component;
3 3
 import com.xhkjedu.sapi.model.component.TUserComponent;
4 4
 import lombok.Data;
5 5
 
6
+import java.time.LocalDate;
7
+import java.time.LocalDateTime;
6 8
 import java.util.List;
7 9
 
8 10
 /**
@@ -13,10 +15,42 @@ import java.util.List;
13 15
 @Data
14 16
 public class ComponentParams {
15 17
 
16
-    private Integer userid;//用户id
18
+    private Integer userid;// 用户id
17 19
 
18
-    private List<TUserComponent> components;//组件集合
20
+    private List<TUserComponent> components;// 组件集合
19 21
 
20
-    private Integer limitSize = 3;//获取条数
22
+    private Integer limitSize = 3;// 获取条数
23
+
24
+    private Integer schoolid;// 学校ID
25
+
26
+    private Integer schoollevel;// 学段
27
+
28
+    private Integer year;//当前年份
29
+
30
+    private Integer usertype;// 用户类型0管理员1教师
31
+
32
+    private long starttime;// 开始时间
33
+
34
+    private long stoptime;// 结束时间
35
+
36
+    private LocalDate todayDate;// 当天日期
37
+
38
+    private LocalDateTime todayDatetime;// 当前时间
39
+
40
+    private String classids;// 班级id集合
41
+
42
+    private Integer timestamp;//当前时间戳
43
+
44
+    private String selectDate;// 选择日期
45
+
46
+    private Integer classid;// 班级ID
47
+
48
+    private Integer belongcode;//1网页 2app 3网页+app
49
+
50
+    private Integer examid;//考试id
51
+
52
+    private String subjectid;//科目id
53
+
54
+    private Integer showrank;//0保密1分数2分数+班排名3分数+班/校排名
21 55
 
22 56
 }

+ 29
- 0
sapi/src/main/java/com/xhkjedu/sapi/vo/component/ExamInfoVo.java View File

@@ -0,0 +1,29 @@
1
+package com.xhkjedu.sapi.vo.component;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * @Description:考试信息
7
+ * @Author: WN
8
+ * @Date: 2024/7/23 16:59:54
9
+ **/
10
+@Data
11
+public class ExamInfoVo {
12
+
13
+    private Integer examid;
14
+
15
+    // 教师显示排名得分0保密1分数2分数+班排名3分数+班/校排名
16
+    private Integer teashowrank;
17
+
18
+    // 学生显示排名得分0保密1分数2分数+班排名3分数+班/校排名
19
+    private Integer stushowrank;
20
+
21
+    // 班级id
22
+    private Integer classid;
23
+
24
+    // 班级名称
25
+    private String classname;
26
+
27
+    //// 科目id
28
+    private String subjectid;
29
+}

+ 34
- 0
sapi/src/main/java/com/xhkjedu/sapi/vo/component/StudyStatisticVo.java View File

@@ -0,0 +1,34 @@
1
+package com.xhkjedu.sapi.vo.component;
2
+
3
+import lombok.Data;
4
+
5
+/**
6
+ * @Description:学习统计
7
+ * @Author: WN
8
+ * @Date: 2024/7/22 11:05:22
9
+ **/
10
+@Data
11
+public class StudyStatisticVo {
12
+
13
+    private Integer id;
14
+
15
+    private String subjectid;
16
+
17
+    private String subjectname;
18
+
19
+    private Integer gradeid;
20
+
21
+    private Integer classid;
22
+
23
+    private String classname;
24
+
25
+    private Integer totalnum;//学生数量
26
+
27
+    private Integer commitnum;//提交数量
28
+
29
+    private Integer checknum;//批阅数量
30
+
31
+    private Integer createtime;
32
+
33
+    private Integer teacherid;
34
+}

+ 390
- 7
sapi/src/main/resources/mapper/component/ComponentMapper.xml View File

@@ -94,7 +94,7 @@
94 94
     
95 95
     <!--我的空间-->
96 96
     <select id="listMySpaces" resultType="java.util.Map">
97
-        select r.resourceid,r.resourcename,r.resourceclass,r.suffix,r.resourcesize,r.resourcecover,
97
+        select r.resourceid,r.resourcename,r.resourceclass,r.suffix,r.resourcesize,r.resourcecover,r.resourceurl,
98 98
         r.createtime from t_resource r
99 99
         left join t_resource_director d on r.resourceid=d.resourceid
100 100
         left join t_teacher_powersb p on p.teacherid=r.createid and p.lsbid=d.lsbid
@@ -104,7 +104,7 @@
104 104
 
105 105
     <!--校本资源库-->
106 106
     <select id="listSchoolResources" resultType="java.util.Map">
107
-        select r.resourceid,r.resourcename,r.resourceclass,r.suffix,r.resourcesize,r.resourcecover,
107
+        select r.resourceid,r.resourcename,r.resourceclass,r.suffix,r.resourcesize,r.resourcecover,resourceurl,
108 108
         r.createtime from t_resource r
109 109
         left join t_resource_director rd on r.resourceid=rd.resourceid
110 110
         left join t_director d on rd.directorid=d.directorid
@@ -126,17 +126,400 @@
126 126
         group by r.resourceid order by r.createtime desc limit #{limitSize}
127 127
     </select>
128 128
 
129
-    <select id="listGuides" resultType="java.util.Map">
130
-        select g.guideid,g.guidename,g.createtime,g.createid,u.username as createname,r.resourcesize
129
+    <resultMap id="guidesForMap" type="java.util.Map">
130
+        <result column="guideid" property="guideid"/>
131
+        <result column="guidename" property="guidename"/>
132
+        <result column="createid" property="createid"/>
133
+        <result column="createtime" property="createtime"/>
134
+        <result column="totalnum" property="totalnum"/>
135
+        <result column="commitnum" property="commitnum"/>
136
+        <collection property="resources" ofType="java.util.Map"
137
+                    javaType="java.util.List" select="listResourcesByGuideid" column="guideid">
138
+        </collection>
139
+    </resultMap>
140
+
141
+    <!--预习-->
142
+    <select id="listGuides" resultMap="guidesForMap">
143
+        select g.guideid,g.guidename,g.createtime,g.createid
131 144
         ,count(DISTINCT gs.rgsid) totalnum,
132 145
         count(DISTINCT(if(gs.readtime is not null,gs.rgsid,null))) commitnum
133
-        from t_guide g left join t_user u on g.createid=u.userid
146
+        from t_guide g
134 147
         left join t_guide_group_student gs on g.guideid=gs.guideid and g.schoolid=gs.schoolid
135
-        left join t_guide_resource gr on g.guideid=gr.guideid
136
-        left join t_resource r on gr.resourceid=r.resourceid
137 148
         left join t_director d on g.directorid=d.directorid
138 149
         left join t_teacher_powersb p on p.teacherid=g.createid and p.lsbid=g.lsbid
139 150
         where d.disabled=0 and g.createid=#{userid}
140 151
         group by g.guideid order by g.createtime desc,g.guidename LIMIT #{limitSize}
141 152
     </select>
153
+    <select id="listResourcesByGuideid" resultType="java.util.Map">
154
+        select r.resourceid, r.resourcename,r.resourceurl,r.resourcecover,r.converted,r.pdfurl,
155
+        r.suffix,r.mp4code,r.resourcesize,r.duration,r.resourceclass
156
+        from t_resource r left join t_guide_resource gr on r.resourceid=gr.resourceid
157
+        where gr.guideid=#{guideid} order by gr.grid
158
+    </select>
159
+
160
+    <!--背诵-->
161
+    <select id="listReciteds" resultType="java.util.Map">
162
+        select r.reciteid,r.recitetitle,r.subjectid,r.createid,r.createtime,r.recitestate,r.recitecont
163
+        ,rg.starttime,rg.stoptime,count(DISTINCT rs.rsid) totalnum,
164
+        count(DISTINCT(if (rs.rsstate>0,rs.rsid,null))) commitnum
165
+        from t_recite r left join t_recite_group rg on r.reciteid=rg.reciteid
166
+        left join t_recite_student rs on r.reciteid=rs.reciteid and r.schoolid=rs.schoolid
167
+        where r.createid=#{userid} and r.recitestate=22 group by r.reciteid order by r.createtime desc limit #{limitSize}
168
+    </select>
169
+
170
+    <!--课堂回顾-->
171
+    <select id="listClassrooms" resultType="java.util.Map">
172
+        SELECT c.roomid,c.roomname,c.classid,g.classname,g.gradeid,c.createtime,c.endtime,
173
+        c.realstunum,u.username createname,c.classnum,d.directorname,
174
+        (select rfpath from t_classroom_file where roomid=c.roomid order by rfid limit 1) rfpath,
175
+        (select count(rs.asksid)+(select count(ps.psid) from t_classroom_paper p
176
+        left join t_classroom_paper_student ps on p.paperid=ps.paperid and ps.pschecked!=1 where p.roomid=c.roomid)
177
+        from t_classroom_askteacher rt
178
+        left join t_classroom_askstudent rs on rt.asktid=rs.asktid and rs.radiocorrect=0
179
+        where rt.roomid=c.roomid and rt.asktype between 32 and 33)wpynum
180
+        FROM t_classroom c LEFT JOIN t_class g ON c.classid=g.classid
181
+        left join t_user u on c.teacherid=u.userid
182
+        left join t_director d on c.directorid=d.directorid
183
+        WHERE d.disabled=0 and c.teacherid=#{userid}
184
+        ORDER BY c.createtime DESC limit #{limitSize}
185
+    </select>
186
+
187
+    <!--预习统计-班级-->
188
+    <select id="listGuidesStatisticClass" resultType="com.xhkjedu.sapi.vo.component.StudyStatisticVo">
189
+        select g.guideid as id,g.createtime,gg.classid,c.gradeid,c.classname
190
+        ,count(DISTINCT(gs.rgsid)) totalnum
191
+        ,count(DISTINCT(if(gs.readtime is not null,gs.rgsid,null))) commitnum
192
+        from t_guide_group gg left join t_guide g on gg.guideid=g.guideid and g.schoolid=gg.schoolid
193
+        left join t_class c on gg.classid=c.classid
194
+        left join t_guide_group_student gs on g.guideid=gs.guideid and gg.classid=gs.classid
195
+        where g.schoolid=#{params.schoolid} and g.createtime BETWEEN #{params.starttime} and #{params.stoptime}
196
+        <if test="params.usertype == 1"> and g.createid=#{params.userid}</if>
197
+        group by gg.rgid order by c.gradeid,c.classtype,c.classorder
198
+    </select>
199
+    <!--预习统计-科目-->
200
+    <select id="listGuidesStatisticSubject" resultType="com.xhkjedu.sapi.vo.component.StudyStatisticVo">
201
+        select g.guideid as id,g.createtime,g.subjectid,s.subjectname
202
+        ,count(DISTINCT(gs.rgsid)) totalnum
203
+        ,count(DISTINCT(if(gs.readtime is not null,gs.rgsid,null))) commitnum
204
+        from t_guide_group_student gs left join t_guide g on gs.guideid=g.guideid and gs.schoolid=g.schoolid
205
+        left join t_subject s on g.subjectid=s.subjectid
206
+        where g.schoolid=#{params.schoolid} and g.createtime BETWEEN #{params.starttime} and #{params.stoptime}
207
+        <if test="params.usertype == 1"> and g.createid=#{params.userid}</if>
208
+        group by g.guideid order by s.subjectorder
209
+    </select>
210
+
211
+    <!--作业统计-班级-->
212
+    <select id="listPapersStatisticClass" resultType="com.xhkjedu.sapi.vo.component.StudyStatisticVo">
213
+        select p.paperid as id,pc.createtime,pc.classid,c.gradeid,c.classname
214
+        ,count(DISTINCT(ps.psid)) totalnum
215
+        ,count(DISTINCT(if(ps.psstate>0,ps.psid,null))) commitnum
216
+        ,count(DISTINCT(if(ps.pschecked=1,ps.psid,null))) checknum
217
+        from t_paper_class pc left join t_paper p on pc.paperid=p.paperid and p.schoolid=pc.schoolid
218
+        left join t_class c on pc.classid=c.classid
219
+        left join t_paper_student ps on ps.paperid=p.paperid and ps.classid=pc.classid
220
+        where p.schoolid=#{params.schoolid} and pc.pgstate=22 and pc.createtime BETWEEN #{params.starttime} and #{params.stoptime}
221
+        <if test="params.usertype == 1"> and p.createid=#{params.userid}</if>
222
+        group by pc.pcid order by c.gradeid,c.classtype,c.classorder
223
+    </select>
224
+
225
+    <!--作业统计-科目-->
226
+    <select id="listPapersStatisticSubject" resultType="com.xhkjedu.sapi.vo.component.StudyStatisticVo">
227
+        select p.paperid as id,pc.createtime,p.subjectid,s.subjectname
228
+        ,count(DISTINCT(ps.psid)) totalnum
229
+        ,count(DISTINCT(if(ps.psstate>0,ps.psid,null))) commitnum
230
+        ,count(DISTINCT(if(ps.pschecked=1,ps.psid,null))) checknum
231
+        from t_paper_student ps left join t_paper p on ps.paperid=p.paperid and ps.schoolid=p.schoolid
232
+        left join t_paper_class pc on pc.paperid=p.paperid and pc.schoolid=p.schoolid
233
+        left join t_subject s on p.subjectid=s.subjectid
234
+        where p.schoolid=#{params.schoolid} and pc.pgstate=22 and pc.createtime BETWEEN #{params.starttime} and #{params.stoptime}
235
+        <if test="params.usertype == 1"> and p.createid=#{params.userid}</if>
236
+        group by p.paperid order by s.subjectorder
237
+    </select>
238
+
239
+    <!--直播巡课-->
240
+    <select id="listLivePatrol" resultType="java.util.Map">
241
+        select cs.sectiondate as timestr,count(distinct cs.sectionid)as num,
242
+        count(distinct case when cs.sectionstate=0 then cs.sectionid else null end)wksnum,
243
+        count(distinct case when cs.sectionstate=2 then cs.sectionid else null end)jxznum,
244
+        count(distinct case when cs.sectionstate=3 then cs.sectionid else null end)yjsnum,
245
+        count(distinct case when cs.sectionstate=4 then cs.sectionid else null end)ygqnum
246
+        from l_course_section cs left join l_course c on cs.courseid=c.courseid
247
+        <if test="params.usertype == 1 and params.classids!=null and params.classids!=''">
248
+            left join l_course_class cc on cc.courseid=c.courseid
249
+        </if>
250
+        where c.deleted=1 and c.schoolid=#{params.schoolid}
251
+        and cs.sectiondate=#{params.todayDate}
252
+        <if test="params.usertype == 1 and params.classids!=null and params.classids!=''">
253
+            and cc.classid in (${params.classids})
254
+        </if>
255
+        <if test="params.usertype==1">
256
+            and cs.teacherid=#{params.userid}
257
+        </if>
258
+        group by cs.sectionid
259
+    </select>
260
+
261
+    <!--教师直播-->
262
+    <select id="listLiveTeachers" resultType="java.util.Map">
263
+        select c.courseid,c.gradeid,c.stunum,c.comm,c.classid,s.subjectname,u.username teachername,u.headpic,
264
+        (select t.typename from l_course_type t where t.ctypeid=c.ctypeid)typename,
265
+        cs.sectionid,cs.sectionname,cs.sectiondate,cs.teacherid,cs.stunum cynum ,cs.planbegintime,cs.planendtime,cs.sectionstate,
266
+        cs.begintime,cs.endtime,
267
+        timestampdiff(second,CONCAT(cs.sectiondate,' ',cs.planbegintime),CONCAT(cs.sectiondate,' ',cs.planendtime)) totaltime,
268
+        (select count(*) from l_course_section_playback p where p.sectionid=cs.sectionid and p.pb is not null)playnum
269
+        from l_course_section cs left join l_course c on cs.courseid = c.courseid
270
+        left join t_subject s on c.subjectid=s.subjectid
271
+        left join t_user u on cs.teacherid=u.userid
272
+        where cs.teacherid=#{params.userid} and c.deleted=1 and cs.sectiondate=#{params.selectDate}
273
+        order by cs.sectionstate,abs(timestampdiff(second,concat(cs.sectiondate,' ',cs.planbegintime),#{params.todayDatetime})),
274
+        cs.sectionid limit #{params.limitSize}
275
+    </select>
276
+
277
+    <!--班级错题集-最近一次作业错题数量-->
278
+    <select id="getClassErrorQuesLastPaper" resultType="java.lang.Integer">
279
+        select count(qc.qcid) lastnum
280
+        from t_question_class qc left join t_paper p on qc.paperid=p.paperid
281
+        where p.deleted=0 and p.hasreport=1 and p.createid=#{params.userid} and qc.classid=#{params.classid} and qc.qctype!=3
282
+        group by p.paperid order by qc.createtime desc limit 1
283
+    </select>
284
+    <!--班级做提及-错题数量和错题讲解数量-->
285
+    <select id="getClassErrorQuesAndExplain" resultType="java.util.Map">
286
+        select count(DISTINCT qc.qcid) quesnum,count(DISTINCT qe.qcpid) explainnum
287
+        from t_question_class qc left join t_paper p on qc.paperid=p.paperid
288
+        left join t_question_explain qe on qc.questionid=qe.questionid
289
+        where p.deleted=0 and p.hasreport=1 and p.createid=#{params.userid} and qc.classid=#{params.classid}
290
+        and qc.createtime BETWEEN #{params.starttime} and #{params.stoptime}
291
+        order by qc.createtime desc
292
+    </select>
293
+
294
+    <!--我的班级-权限班级-->
295
+    <select id="listClassidsForTeacher" resultType="java.lang.Integer">
296
+        select c.classid
297
+        from t_class_teacher ct left join t_class c on ct.classid=c.classid
298
+        left join t_school s on c.schoolid=s.schoolid and c.`year`=s.`year`
299
+        where s.schoolid=#{params.schoolid} and ct.teacherid=#{params.userid} and c.classstate=1 and c.classtype in (1,2,3)
300
+        and c.classnum > 0
301
+        order by c.classtype,c.classorder
302
+    </select>
303
+    <!--我的班级-学生数量分组数量-->
304
+    <select id="listClassStuAndGroup" resultType="java.lang.Integer">
305
+        select count(DISTINCT studentid) stunum from t_class_student where classid in (${classidsStr})
306
+        UNION
307
+        select count(distinct groupid) groupnum from t_group where
308
+            (grouptype=1 or (grouptype=2 and createid=#{userid})) and
309
+            classid in (${classidsStr})
310
+    </select>
311
+    
312
+    <!--校本题库-试题数量-->
313
+    <select id="getQuestionStatistic" resultType="java.util.Map">
314
+        select count(DISTINCT q.questionid) totalnum,
315
+        count(DISTINCT(if(DATE(FROM_UNIXTIME(q.createtime)) = CURDATE(),q.questionid,null))) todaynum
316
+        from t_question q
317
+        left join t_subject s on q.subjectid=s.subjectid and s.`level`=#{params.schoollevel}
318
+        where q.belong and (q.belong in(1,2) or (q.belong in(3,10) and q.schoolid=#{params.schoolid})) and q.qlevel &lt; 3
319
+    </select>
320
+    <!--校本题库-当前学科试题数量-->
321
+    <select id="getQuestionStatisticSubejct" resultType="java.lang.Integer">
322
+        select count(DISTINCT q.questionid) subjectnum
323
+        from t_question q
324
+        left join t_teacher_powersb tp on q.subjectid = tp.subjectid
325
+        where tp.teacherid=#{params.userid} and q.belong and (q.belong in(1,2) or (q.belong in(3,10) and q.schoolid=#{params.schoolid})) and q.qlevel &lt; 3
326
+    </select>
327
+
328
+    <!--教学统计-班级学生教师数量-->
329
+    <select id="getTeachingSchoolClassNum" resultType="java.util.Map">
330
+        SELECT COUNT(DISTINCT c.classid) AS classnum,count(DISTINCT s.studentid) studentnum,
331
+        (SELECT COUNT(*) FROM t_user WHERE schoolid=c.schoolid AND usertype=1 AND userstate=1) AS teachernum
332
+        FROM t_class c LEFT JOIN t_class_student s ON c.classid=s.classid
333
+        WHERE c.schoolid=#{params.schoolid} AND c.year=#{params.year} and c.classtype=1 and c.classstate=1
334
+    </select>
335
+    <!--教学统计-作业-->
336
+    <select id="listTeachingPapers" resultType="com.xhkjedu.sapi.vo.analyze.work.SchoolWorkSubjectVo">
337
+        SELECT p.subjectid,count(distinct p.paperid)fabunum,
338
+        count(distinct if(pg.starttime&lt;=#{params.timestamp},ps1.psid,null))stunum,
339
+        count(distinct if(ps1.psstate in(1,2,4),ps1.psid,null)) commitnum,
340
+        count(distinct if(ps1.psstate in(1,2,4) and ps1.pschecked=1,ps1.psid,null)) checknum
341
+        FROM t_paper p
342
+        left join t_paper_class pg on p.paperid=pg.paperid
343
+        LEFT JOIN t_paper_student ps1 ON p.paperid=ps1.paperid and ps1.classid=pg.classid
344
+        LEFT JOIN t_class c ON pg.classid=c.classid
345
+        LEFT JOIN T_USER U ON p.createid=u.userid
346
+        left join t_director d on p.directorid=d.directorid
347
+        where p.deleted=0 and p.paperstate=22 AND p.schoolid=#{params.schoolid} AND pg.schoolid=#{params.schoolid}
348
+        and p.year=#{params.year} AND u.userstate=1 and (d.disabled=0 or p.directorid is null)
349
+        AND pg.starttime>=#{params.starttime} AND pg.stoptime <![CDATA[ <= ]]>#{params.stoptime}
350
+        GROUP BY p.subjectid
351
+    </select>
352
+    <!--教学统计-预习-->
353
+    <select id="listTeachingGuides" resultType="com.xhkjedu.sapi.vo.analyze.work.SchoolWorkSubjectVo">
354
+        SELECT g.subjectid,count(distinct g.guideid)fabunum,
355
+        count(distinct ggs.rgsid)stunum,
356
+        count(distinct if(ggs.costtime!=0,ggs.rgsid,null)) commitnum
357
+        FROM t_guide g left join t_guide_group_student ggs on ggs.guideid=g.guideid
358
+        LEFT JOIN t_class c ON ggs.classid=c.classid
359
+        LEFT JOIN T_USER U ON g.createid=u.userid
360
+        left join t_director d on g.directorid=d.directorid
361
+        where d.disabled=0 and g.schoolid=#{params.schoolid} AND ggs.schoolid=#{params.schoolid}
362
+        and g.year=#{params.year} and u.userstate=1 AND g.createtime >= #{params.starttime} AND g.createtime <![CDATA[ <= ]]>#{params.stoptime}
363
+        GROUP BY g.subjectid
364
+    </select>
365
+    <!--教学统计-背诵-->
366
+    <select id="listTeachingRecites" resultType="com.xhkjedu.sapi.vo.analyze.work.SchoolWorkSubjectVo">
367
+        SELECT r.subjectid,count(distinct r.reciteid)fabunum,
368
+        count(distinct rs.rsid) stunum,
369
+        count(distinct if(rs.rsstate!=0,rs.rsid,null)) commitnum
370
+        FROM t_recite r left join t_recite_group rg on rg.reciteid=r.reciteid
371
+        LEFT JOIN t_recite_student rs ON rg.reciteid=rs.reciteid and rg.classid=rs.classid
372
+        LEFT JOIN t_class c ON rg.classid=c.classid
373
+        LEFT JOIN T_USER U ON r.createid=u.userid
374
+        WHERE r.recitestate=22 AND r.schoolid=#{params.schoolid} AND rg.schoolid=#{params.schoolid}
375
+        and r.year=#{params.year} AND u.userstate=1 AND rg.starttime>=#{params.starttime} AND rg.starttime <![CDATA[ <= ]]>#{params.stoptime}
376
+        GROUP BY r.subjectid
377
+    </select>
378
+
379
+    <!--常用应用-->
380
+    <select id="listUserModules" resultType="java.util.Map">
381
+        SELECT um.umid, um.moduleid,m.modulename,m.moduleurl,m.moduleico,m.minout,m.mabbrevname
382
+        FROM t_user_module um LEFT JOIN t_module m ON um.moduleid=m.moduleid
383
+        WHERE um.userid=#{params.userid} and m.display=1
384
+        <if test="params.belongcode!=null and params.belongcode==1">and um.belongcode in (1,3)</if>
385
+        <if test="params.belongcode!=null and params.belongcode==2">and um.belongcode in (2,3)</if>
386
+        ORDER BY um.umorder
387
+    </select>
388
+
389
+    <!--考试-待出卷-->
390
+    <select id="listExamPaperGiv" resultType="java.util.Map">
391
+        select es.esid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,es.teacherid,u2.username as teachername,
392
+        es.esstate ,ep.epid,ep.ptype,ep.pnum,ep.pscore,ep.answered,ep.handleid,u.username as handlename,
393
+        ep.scantronpdf,es.examid,e.examname,e.examtype,e.exammode,e.examstate,e.hashb,e.schoolid
394
+        from e_subject es left join e_paper ep on es.esid=ep.esid
395
+        left join e_base e on es.examid=e.examid
396
+        left join t_user u on ep.handleid=u.userid
397
+        left join t_user u2 on es.teacherid=u2.userid
398
+        where e.deleted=1 and es.teacherid=#{params.userid}
399
+        group by es.esid
400
+        order by abs(timediff(concat(es.sdate,' ',es.begintime),#{params.todayDatetime})) limit #{params.limitSize}
401
+    </select>
402
+    <!--考试-待批阅-->
403
+    <select id="listExamPaperCheck" resultType="java.util.Map">
404
+        select a.*,eb.examname,eb.gradeid,eb.examtype,eb.examstate,eb.hashb,eb.schoolid,es.sdate,es.begintime,es.endtime,es.subjectname
405
+        ,truncate(a.pynum*100/a.tjnum,2)pgrate
406
+        from(select p.esid,p.epid,group_concat(distinct concat(psq.qn,'_',psq.eptqid) order by psq.eptqid)qns
407
+        ,group_concat(distinct pc.classid)classids
408
+        ,count(case when psq.answered=1 then psq.epsqid else null end)tjnum
409
+        ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
410
+        from e_paper p left join e_paper_correctclass pc on p.epid = pc.epid
411
+        left join e_paper_student_question psq on psq.classid=pc.classid and psq.epid=p.epid
412
+        where pc.teacherid=#{params.userid} and psq.ctype in(3,13,14,15) group by p.epid
413
+        union
414
+        select p.esid,p.epid,group_concat(distinct concat(pq.qn,'_',pq.eptqid) order by pq.eptqid)qns
415
+        ,'' classids
416
+        ,count(case when psq.answered=1 then psq.epsqid else null end)tjnum
417
+        ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
418
+        from e_paper p left join e_paper_correctquestion pq on p.epid = pq.epid
419
+        left join e_paper_student_question psq on psq.eptqid=pq.eptqid
420
+        where pq.teacherid=#{params.userid} group by p.epid)a left join e_subject es on a.esid = es.esid
421
+        left join e_base eb on es.examid = eb.examid
422
+        where a.tjnum!=a.pynum and eb.deleted=1 limit #{params.limitSize}
423
+    </select>
424
+    <!--考试-待监考-->
425
+    <select id="listExamInvigilate" resultType="java.util.Map">
426
+        select es.*,count(eps.epsid)examnum
427
+--         ,count(if(eps.sstate in(0,3), eps.epsid, null)) wjcnum
428
+--         ,count(if(eps.sstate in(1,2), eps.epsid, null))jcnum
429
+        ,truncate(count(if(eps.sstate in(1,2), eps.epsid, null))*100/count(eps.epsid),2) jcrate
430
+--         ,count(if(eps.sstate=2, eps.epsid, null))tjnum
431
+--         ,count(if(eps.sstate=3, eps.epsid, null))qknum
432
+        from(select es.esid,es.sdate,es.begintime,es.endtime,es.esstate,es.subjectname,es.pstate
433
+        ,eb.examname,eb.gradeid,eb.examtype,eb.examstate,eb.hashb,eb.schoolid,max(ei.majored)majored
434
+        ,(if(max(ei.majored)=0, group_concat(distinct ei.classid), group_concat(distinct ec.classid)))classids
435
+        ,concat('[',group_concat(distinct json_object('classid',ec.classid,'classname',ec.classname
436
+        ,'schoolid',ec.schoolid,'schoolname',s.schoolname)),']')classnames
437
+        from e_subject_invigilate ei left join e_subject es on ei.esid=es.esid
438
+        left join e_base eb on eb.examid = es.examid
439
+        left join e_class ec on eb.examid = ec.examid
440
+        left join t_school s on ec.schoolid = s.schoolid
441
+        where eb.deleted=1 and eb.examstate!=0 and eb.exammode=1 and eb.monitored=1
442
+        and ei.teacherid=#{params.userid} and es.pstate!=2
443
+        group by es.esid having classids is not null
444
+        )es left join e_paper_student eps on es.esid = eps.esid and find_in_set(eps.classid,es.classids)
445
+        group by es.esid
446
+        order by abs(timediff(concat(es.sdate,' ',es.begintime),#{params.todayDatetime})) limit #{params.limitSize}
447
+    </select>
448
+    <!--考试-校级报告-获取最近一次生成报告的考试-->
449
+    <select id="getExamReportSchoolBase" resultType="java.util.Map">
450
+        select re.*  from e_base e left join e_rbase re on e.examid=re.examid
451
+        where e.schoolid=#{schoolid} and e.deleted=1 and e.examstate=3 order by examdate desc limit 1
452
+    </select>
453
+    <!--考试-校级报告-成绩概况-->
454
+    <select id="listExamReportSchoolStatistic" resultType="java.util.Map">
455
+        select rs.subjectid, rs.subjectname, score, maxscore, minscore, avgscore, stunum, missnum, yxrate, lhrate, jgrate, dfrate, bzc
456
+        from e_rsubject rs left join e_subject es on rs.examid = es.examid and rs.subjectid=es.subjectid
457
+        where rs.examid=#{examid}
458
+        order by es.begintime,es.esid
459
+    </select>
460
+
461
+    <!--考试-考试报告-班级参与班级-->
462
+    <select id="listExamReportClass" resultType="java.util.Map">
463
+        select ec.classid,c.gradeid,c.classname from e_class ec left join t_class c on ec.classid=c.classid
464
+        left join t_class_teacher ct on ec.classid = ct.classid
465
+        where examid=#{examid} and ct.teacherid=#{userid} group by ec.classid order by c.classorder,c.classid
466
+    </select>
467
+
468
+    <!--考试-班级报告-考试信息-->
469
+    <select id="getExamReportClassInfo" resultType="com.xhkjedu.sapi.vo.component.ExamInfoVo">
470
+        select e.examid,e.teashowrank,c.classid,c.classname
471
+        from e_base e left join e_class c on e.examid=c.examid
472
+        left join t_class_teacher ct on c.classid=ct.classid
473
+        where e.examstate=3 and e.deleted=1 and ct.teacherid=#{params.userid} and c.schoolid=#{params.schoolid}
474
+        group by e.examid order by e.examdate desc limit 1
475
+    </select>
476
+    <!--考试-班级报告-学科成绩对比-->
477
+    <select id="listExamReportClassScore" resultType="java.util.Map">
478
+        select er.allscore,er.classmaxscore,er.classminscore,er.classavgscore,er.schoolmaxscore,er.schoolavgscore
479
+        ,er.stunum,er.missnum,er.yxrate,er.lhrate,er.jgrate,er.dfrate,er.bzc,er.qkbzc
480
+        ,er.classid,(case when er.classid=0 then '全部班级' else ec.classname end)classname
481
+        ,(case when er.subjectid='zf' then '总分' else (select s.subjectname from t_subject s where
482
+        er.subjectid=s.subjectid) end)subjectname
483
+        from e_rclass er left join e_class ec on er.examid = ec.examid and er.classid = ec.classid
484
+        left join e_subject es on ec.examid = es.examid and er.subjectid=es.subjectid
485
+        where er.examid=#{params.examid} and er.classid=#{params.classid}
486
+        order by es.begintime,es.esid
487
+    </select>
488
+    <!--考试-单科报告-单科考试信息-->
489
+    <select id="getExamReportSingleInfo" resultType="com.xhkjedu.sapi.vo.component.ExamInfoVo">
490
+        select e.examid,e.teashowrank,e.stushowrank,s.subjectid,c.classid from e_base e
491
+        left join e_subject s on e.examid=s.examid
492
+        left join t_teacher_powersb tp on tp.teacherid=#{params.userid} and tp.subjectid=s.subjectid
493
+        left join e_class c on e.examid=c.examid
494
+        left join t_class_teacher ct on c.classid=ct.classid and tp.teacherid=ct.teacherid
495
+        where e.examstate=3 and e.deleted=1 and ct.teacherid=#{params.userid}
496
+        and c.schoolid=#{params.schoolid}
497
+        group by e.examid order by e.examdate desc,e.examid desc limit 1
498
+    </select>
499
+    <!--考试-单科报告-单科概况-->
500
+    <select id="getExamReportSingleBase" resultType="java.util.Map">
501
+        select er.stunum,er.yxrate,er.jgrate,er.lhrate,er.dfrate
502
+        <if test="params.showrank==0">
503
+            ,0 classmaxscore,0 classavgscore,0 classminscore,0 classavgscorerank,0 schoolmaxscore,0 schoolavgscore
504
+        </if>
505
+        <if test="params.showrank==1">
506
+            ,er.classmaxscore,er.classavgscore,er.classminscore,0 classavgscorerank,er.schoolmaxscore,er.schoolavgscore
507
+        </if>
508
+        <if test="params.showrank==2 or params.showrank==3">
509
+            ,er.classmaxscore,er.classavgscore,er.classminscore,er.classavgscorerank,er.schoolmaxscore,er.schoolavgscore
510
+        </if>
511
+        from e_rclass er
512
+        where er.examid=#{params.examid} and er.classid=#{params.classid} and er.subjectid=#{params.subjectid}
513
+        limit 1
514
+    </select>
515
+    <!--考试-单科报告-成绩等级分布-->
516
+    <select id="listExamReportSingleRank" resultType="java.util.Map">
517
+        select err.ranktype,err.rankname,err.stunum,err.stujson,err.sturate,er.minscore,er.maxscore
518
+        ,(case when er.linescore is null then '' else concat(er.linescore,'-',er.floatscore) end)rankrange
519
+        from e_rclass_rank err left join e_rrank er on err.examid = er.examid and err.subjectid = er.subjectid
520
+        and er.ranktype=1 and er.rankname=err.rankname
521
+        where err.examid=#{params.examid} and err.classid=#{params.classid}
522
+        and err.subjectid=#{params.subjectid} and err.ranktype=1
523
+    </select>
524
+
142 525
 </mapper>

+ 9
- 0
sapi/src/main/resources/mapper/gradeclass/ClassMapper.xml View File

@@ -45,4 +45,13 @@
45 45
     <select id="listStudentIdByClassIds" resultType="java.lang.Integer">
46 46
         select distinct studentid from t_class_student where classid in(${classIds})
47 47
     </select>
48
+
49
+    <!--教师权限班级id集合-->
50
+    <select id="listTeacherClassids" resultType="java.lang.String">
51
+        select group_concat(distinct c.classid)
52
+        from t_class_teacher ct left join  t_class c on ct.classid=c.classid
53
+        left join t_school s on ct.schoolid=s.schoolid
54
+        where ct.teacherid=#{teacherid} and c.year=s.year and c.classstate=1
55
+          and c.classtype in(1,2) and c.schoolid=#{schoolid}
56
+    </select>
48 57
 </mapper>

+ 1
- 0
sapi/src/main/resources/mapper/subjectbook/SubjectMapper.xml View File

@@ -11,4 +11,5 @@
11 11
         </if>
12 12
         ) order by subjectorder asc
13 13
     </select>
14
+
14 15
 </mapper>

+ 6
- 0
sapi/src/main/resources/mapper/system/UserMapper.xml View File

@@ -53,4 +53,10 @@
53 53
         select userid,username,loginname,usertype,schoolid from t_user where userid=#{userid}
54 54
     </select>
55 55
 
56
+    <!--获取用户信息以及学段-->
57
+    <select id="getUserAndSchoolInfo" resultType="com.xhkjedu.vo.system.UserVo">
58
+        select u.userid,u.usertype,u.schoolid,s.schoollevel,s.year from t_user u
59
+        left join t_school s on u.schoolid=s.schoolid where u.userid=#{userid}
60
+    </select>
61
+
56 62
 </mapper>

Loading…
Cancel
Save