Bläddra i källkod

区域统计、可视化学年数据搜索

tags/正式版本
雍文秀 2 år sedan
förälder
incheckning
8e7bc7f153
21 ändrade filer med 298 tillägg och 195 borttagningar
  1. 1
    1
      sapi/src/main/java/com/xhkjedu/sapi/controller/region/RRoomAnalyzeController.java
  2. 4
    4
      sapi/src/main/java/com/xhkjedu/sapi/controller/region/RSchoolAnalyzeController.java
  3. 9
    9
      sapi/src/main/java/com/xhkjedu/sapi/controller/region/RegionAnalyzeController.java
  4. 5
    5
      sapi/src/main/java/com/xhkjedu/sapi/controller/region/SAnalyzeController.java
  5. 13
    0
      sapi/src/main/java/com/xhkjedu/sapi/controller/system/SchoolController.java
  6. 2
    5
      sapi/src/main/java/com/xhkjedu/sapi/mapper/region/RRoomAnalyzeMapper.java
  7. 4
    2
      sapi/src/main/java/com/xhkjedu/sapi/mapper/region/RSchoolAnalyzeMapper.java
  8. 11
    15
      sapi/src/main/java/com/xhkjedu/sapi/mapper/region/RegionAnalyzeMapper.java
  9. 7
    6
      sapi/src/main/java/com/xhkjedu/sapi/mapper/region/SAnalyzeMapper.java
  10. 3
    0
      sapi/src/main/java/com/xhkjedu/sapi/mapper/system/SchoolMapper.java
  11. 4
    3
      sapi/src/main/java/com/xhkjedu/sapi/service/region/RRoomAnalyzeService.java
  12. 7
    5
      sapi/src/main/java/com/xhkjedu/sapi/service/region/RSchoolAnalyzeService.java
  13. 17
    61
      sapi/src/main/java/com/xhkjedu/sapi/service/region/RegionAnalyzeService.java
  14. 28
    19
      sapi/src/main/java/com/xhkjedu/sapi/service/region/SAnalyzeService.java
  15. 5
    0
      sapi/src/main/java/com/xhkjedu/sapi/service/system/SchoolService.java
  16. 63
    9
      sapi/src/main/resources/mapper/region/RPaperAnalyzeMapper.xml
  17. 8
    9
      sapi/src/main/resources/mapper/region/RRoomAnalyzeMapper.xml
  18. 14
    2
      sapi/src/main/resources/mapper/region/RSchoolAnalyzeMapper.xml
  19. 77
    24
      sapi/src/main/resources/mapper/region/RegionAnalyzeMapper.xml
  20. 12
    16
      sapi/src/main/resources/mapper/region/SAnalyzeMapper.xml
  21. 4
    0
      sapi/src/main/resources/mapper/system/SchoolMapper.xml

+ 1
- 1
sapi/src/main/java/com/xhkjedu/sapi/controller/region/RRoomAnalyzeController.java Visa fil

@@ -30,7 +30,7 @@ public class RRoomAnalyzeController {
30 30
         Integer endtime = param.getEndtime();
31 31
         Integer level = param.getLevel();
32 32
         N_Utils.validation(new Object[]{level,"学段",1,begintime,"开始时间",1,endtime,"结束时间",1});
33
-        Map map = rRoomAnalyzeService.listRoom(level,begintime, endtime);
33
+        Map map = rRoomAnalyzeService.listRoom(param);
34 34
         return new ResultVo(0,"获取课堂统计成功",map);
35 35
     }
36 36
 }

+ 4
- 4
sapi/src/main/java/com/xhkjedu/sapi/controller/region/RSchoolAnalyzeController.java Visa fil

@@ -25,8 +25,8 @@ public class RSchoolAnalyzeController {
25 25
     private RSchoolAnalyzeService rSchoolAnalyzeService;
26 26
 
27 27
     @PostMapping("/list_school")
28
-    public ResultVo listSchool(){
29
-        Map map = rSchoolAnalyzeService.listSchool();
28
+    public ResultVo listSchool(RegionParam param){
29
+        Map map = rSchoolAnalyzeService.listSchool(param);
30 30
         return new ResultVo(0,"获取学校列表成功",map);
31 31
     }
32 32
 
@@ -37,8 +37,8 @@ public class RSchoolAnalyzeController {
37 37
     }
38 38
 
39 39
     @PostMapping("/list_stu")
40
-    public ResultVo listStu(){
41
-        Map map = rSchoolAnalyzeService.listStu();
40
+    public ResultVo listStu(RegionParam param){
41
+        Map map = rSchoolAnalyzeService.listStu(param);
42 42
         return new ResultVo(0,"获取学生列表成功",map);
43 43
     }
44 44
 

+ 9
- 9
sapi/src/main/java/com/xhkjedu/sapi/controller/region/RegionAnalyzeController.java Visa fil

@@ -53,14 +53,14 @@ public class RegionAnalyzeController {
53 53
     }
54 54
 
55 55
     @PostMapping("/slist")
56
-    public ResultVo listSchool(){
57
-        List<Map> list = regionAnalyzeService.listSchool();
56
+    public ResultVo listSchool(@RequestBody RegionParam param){
57
+        List<Map> list = regionAnalyzeService.listSchool(param);
58 58
         return new ResultVo(0,"获取学校列表成功",list);
59 59
     }
60 60
 
61 61
     @PostMapping("/ctslist")
62
-    public ResultVo listClassTeacherStudentNum(){
63
-        List<Map> list = regionAnalyzeService.listClassTeacherStudentNum();
62
+    public ResultVo listClassTeacherStudentNum(@RequestBody RegionParam param){
63
+        List<Map> list = regionAnalyzeService.listClassTeacherStudentNum(param);
64 64
         return new ResultVo(0,"获取学段班级、教师、学生总量成功",list);
65 65
     }
66 66
 
@@ -69,14 +69,14 @@ public class RegionAnalyzeController {
69 69
     @PostMapping("/workc")
70 70
     public ResultVo listPaperCommitMonth(@RequestBody RegionParam param){
71 71
         N_Utils.validation(new Object[]{param.getBegintime(),"开始时间",1,param.getEndtime(),"结束时间",1});
72
-        Map map = regionAnalyzeService.listPaperCommitMonth(param.getBegintime(),param.getEndtime());
72
+        Map map = regionAnalyzeService.listPaperCommitMonth(param);
73 73
         return new ResultVo(0,"获取教学统计作业提交率成功",map);
74 74
     }
75 75
     //教学统计--各教学任务
76 76
     @PostMapping("/work")
77 77
     public ResultVo listGuideCommitMonth(@RequestBody RegionParam param){
78 78
         N_Utils.validation(new Object[]{param.getBegintime(),"开始时间",1,param.getEndtime(),"结束时间",1});
79
-        List<WorkRtnVo> map = regionAnalyzeService.listWorkCommitMonth(param.getBegintime(),param.getEndtime());
79
+        List<WorkRtnVo> map = regionAnalyzeService.listWorkCommitMonth(param);
80 80
         return new ResultVo(0,"获取各教学任务统计信息成功",map);
81 81
     }
82 82
 
@@ -84,7 +84,7 @@ public class RegionAnalyzeController {
84 84
     @PostMapping("/papernum")
85 85
     public ResultVo listPapernumMonth(@RequestBody RegionParam param){
86 86
         N_Utils.validation(new Object[]{param.getBegintime(),"开始时间",1,param.getEndtime(),"结束时间",1});
87
-        Map map = regionAnalyzeService.listPapernumMonth(param.getBegintime(),param.getEndtime());
87
+        Map map = regionAnalyzeService.listPapernumMonth(param);
88 88
         return new ResultVo(0,"获取布置作业次数成功",map);
89 89
     }
90 90
 
@@ -92,7 +92,7 @@ public class RegionAnalyzeController {
92 92
     @PostMapping("/roomnum")
93 93
     public ResultVo listRoomNumMonth(@RequestBody RegionParam param){
94 94
         N_Utils.validation(new Object[]{param.getBegintime(),"开始时间",1,param.getEndtime(),"结束时间",1});
95
-        Map map = regionAnalyzeService.listRoomNumMonth(param.getBegintime(),param.getEndtime());
95
+        Map map = regionAnalyzeService.listRoomNumMonth(param);
96 96
         return new ResultVo(0,"获取课堂使用数量成功",map);
97 97
     }
98 98
 
@@ -100,7 +100,7 @@ public class RegionAnalyzeController {
100 100
     @PostMapping("/roomask")
101 101
     public ResultVo listRoomAskNumMonth(@RequestBody RegionParam param){
102 102
         N_Utils.validation(new Object[]{param.getBegintime(),"开始时间",1,param.getEndtime(),"结束时间",1});
103
-        List<Map> map = regionAnalyzeService.listRoomAskNumMonth2(param.getBegintime(),param.getEndtime());
103
+        List<Map> map = regionAnalyzeService.listRoomAskNumMonth2(param);
104 104
         return new ResultVo(0,"获取课堂互动数量成功",map);
105 105
     }
106 106
 

+ 5
- 5
sapi/src/main/java/com/xhkjedu/sapi/controller/region/SAnalyzeController.java Visa fil

@@ -62,7 +62,7 @@ public class SAnalyzeController {
62 62
     public ResultVo listClassTeacherStudentNum(@RequestBody SchoolParams param){
63 63
         Integer schoolid = param.getSchoolid();
64 64
         N_Utils.validation(new Object[]{schoolid,"学校id",1});
65
-        Map map = sAnalyzeService.listClassTeacherStudentNum(schoolid);
65
+        Map map = sAnalyzeService.listClassTeacherStudentNum(param);
66 66
         return new ResultVo(0,"获取班级、教师、学生总量成功",map);
67 67
     }
68 68
 
@@ -94,7 +94,7 @@ public class SAnalyzeController {
94 94
         Integer begintime = param.getBegintime();
95 95
         Integer endtime = param.getEndtime();
96 96
         N_Utils.validation(new Object[]{schoolid,"学校id",1,begintime,"开始时间",1,endtime,"结束时间",1});
97
-        List<Map> map = sAnalyzeService.listPaperCommitMonth(schoolid, begintime, endtime);
97
+        List<Map> map = sAnalyzeService.listPaperCommitMonth(param);
98 98
         return new ResultVo(0,"获取教学统计作业提交率成功",map);
99 99
     }
100 100
     //教学统计--预习提交率
@@ -104,7 +104,7 @@ public class SAnalyzeController {
104 104
         Integer begintime = param.getBegintime();
105 105
         Integer endtime = param.getEndtime();
106 106
         N_Utils.validation(new Object[]{schoolid,"学校id",1,begintime,"开始时间",1,endtime,"结束时间",1});
107
-        List<Map> map = sAnalyzeService.listGuideCommitMonth(schoolid, begintime, endtime);
107
+        List<Map> map = sAnalyzeService.listGuideCommitMonth(param);
108 108
         return new ResultVo(0,"获取教学任务预习统计信息成功",map);
109 109
     }
110 110
 
@@ -115,7 +115,7 @@ public class SAnalyzeController {
115 115
         Integer begintime = param.getBegintime();
116 116
         Integer endtime = param.getEndtime();
117 117
         N_Utils.validation(new Object[]{schoolid,"学校id",1,begintime,"开始时间",1,endtime,"结束时间",1});
118
-        Map map = sAnalyzeService.listRoomNumMonth(schoolid, begintime, endtime);
118
+        Map map = sAnalyzeService.listRoomNumMonth(param);
119 119
         return new ResultVo(0,"获取课堂使用数量成功",map);
120 120
     }
121 121
 
@@ -126,7 +126,7 @@ public class SAnalyzeController {
126 126
         Integer begintime = param.getBegintime();
127 127
         Integer endtime = param.getEndtime();
128 128
         N_Utils.validation(new Object[]{schoolid,"学校id",1,begintime,"开始时间",1,endtime,"结束时间",1});
129
-        List<Map> map = sAnalyzeService.listRoomAskNumMonth(schoolid, begintime, endtime);
129
+        List<Map> map = sAnalyzeService.listRoomAskNumMonth(param);
130 130
         return new ResultVo(0,"获取课堂互动数量成功",map);
131 131
     }
132 132
 

+ 13
- 0
sapi/src/main/java/com/xhkjedu/sapi/controller/system/SchoolController.java Visa fil

@@ -188,4 +188,17 @@ public class SchoolController {
188 188
         List<Integer> list = schoolService.listYear(schoolid);
189 189
         return new ResultVo(0, "获取列表成功", list);
190 190
     }
191
+
192
+    /*
193
+     * 获取区域学年列表
194
+     * @Param []
195
+     * @Author ywx
196
+     * @Date 2022/10/14 10:05
197
+     * @return com.xhkjedu.vo.ResultVo
198
+     **/
199
+    @PostMapping("/list_cyear")
200
+    public ResultVo listCloudYear() {
201
+        List<Integer> list = schoolService.listCloudYear();
202
+        return new ResultVo(0, "获取列表成功", list);
203
+    }
191 204
 }

+ 2
- 5
sapi/src/main/java/com/xhkjedu/sapi/mapper/region/RRoomAnalyzeMapper.java Visa fil

@@ -1,6 +1,7 @@
1 1
 package com.xhkjedu.sapi.mapper.region;
2 2
 
3 3
 import com.xhkjedu.sapi.vo.region.RRoomVo;
4
+import com.xhkjedu.sapi.vo.region.RegionParam;
4 5
 import org.apache.ibatis.annotations.Param;
5 6
 import org.springframework.stereotype.Repository;
6 7
 
@@ -8,9 +9,5 @@ import java.util.List;
8 9
 
9 10
 @Repository
10 11
 public interface RRoomAnalyzeMapper {
11
-    List<RRoomVo> listRoom(@Param("level") Integer level, @Param("begintime") Integer begintime, @Param("endtime") Integer endtime);
12
-
13
-    //获取学校课堂用时人数统计
14
-    RRoomVo getRoom(@Param("schoolid") Integer schoolid, @Param("begintime") Integer begintime
15
-            , @Param("endtime") Integer endtime, @Param("year") Integer year);
12
+    List<RRoomVo> listRoom(@Param("param") RegionParam param);
16 13
 }

+ 4
- 2
sapi/src/main/java/com/xhkjedu/sapi/mapper/region/RSchoolAnalyzeMapper.java Visa fil

@@ -2,7 +2,9 @@ package com.xhkjedu.sapi.mapper.region;
2 2
 
3 3
 import com.xhkjedu.sapi.vo.region.RSStuVo;
4 4
 import com.xhkjedu.sapi.vo.region.RSTeacherVo;
5
+import com.xhkjedu.sapi.vo.region.RegionParam;
5 6
 import com.xhkjedu.sapi.vo.region.SchoolVo;
7
+import org.apache.ibatis.annotations.Param;
6 8
 import org.springframework.stereotype.Repository;
7 9
 
8 10
 import java.util.List;
@@ -11,7 +13,7 @@ import java.util.Map;
11 13
 @Repository
12 14
 public interface RSchoolAnalyzeMapper {
13 15
     //获取学校列表
14
-    List<SchoolVo> listSchool();
16
+    List<SchoolVo> listSchool(@Param("param") RegionParam param);
15 17
 
16 18
     //教师性别统计
17 19
     List<RSTeacherVo> listTeacherSex();
@@ -20,7 +22,7 @@ public interface RSchoolAnalyzeMapper {
20 22
     List<RSTeacherVo> listTeacherSubject();
21 23
 
22 24
     //学生统计
23
-    List<RSStuVo> listStu();
25
+    List<RSStuVo> listStu(@Param("param") RegionParam param);
24 26
 
25 27
     //活跃度统计
26 28
     List<Map> listAccess(Integer begintime, Integer endtime);

+ 11
- 15
sapi/src/main/java/com/xhkjedu/sapi/mapper/region/RegionAnalyzeMapper.java Visa fil

@@ -1,9 +1,7 @@
1 1
 package com.xhkjedu.sapi.mapper.region;
2 2
 
3
-import com.xhkjedu.sapi.vo.region.CloudVo;
4
-import com.xhkjedu.sapi.vo.region.RSubjectVo;
5
-import com.xhkjedu.sapi.vo.region.ResourceTypeVo;
6
-import com.xhkjedu.sapi.vo.region.WorkVo;
3
+import com.xhkjedu.sapi.vo.region.*;
4
+import org.apache.ibatis.annotations.Param;
7 5
 import org.springframework.stereotype.Repository;
8 6
 
9 7
 import java.util.List;
@@ -29,27 +27,25 @@ public interface RegionAnalyzeMapper {
29 27
     List<RSubjectVo> listQuestionSubjectNum();
30 28
 
31 29
     //获取学校列表
32
-    List<Map> listSchool();
30
+    List<Map> listSchool(@Param("param") RegionParam param);
33 31
 
34 32
     //获取学段班级、教师、学生总量
35
-    List<Map> listClassTeacherStudentNum();
33
+    List<Map> listClassTeacherStudentNum(@Param("param") RegionParam param);
36 34
     //近一个月教学统计——作业提交率
37
-    List<WorkVo> listPaperCommitMonth(Integer begintime, Integer endtime);
35
+    List<WorkVo> listPaperCommitMonth(@Param("param") RegionParam param);
38 36
     //近一个月教学统计——预习提交率
39
-    List<WorkVo> listGuideCommitMonth(Integer begintime, Integer endtime);
37
+    List<WorkVo> listGuideCommitMonth(@Param("param") RegionParam param);
40 38
     //近一个月教学统计——背诵提交率
41
-    List<WorkVo> listReciteCommitMonth(Integer begintime, Integer endtime);
39
+    List<WorkVo> listReciteCommitMonth(@Param("param") RegionParam param);
42 40
     //近一个月教学统计——课堂出勤率
43
-    List<Map> listRoomCommitMonth(Integer begintime, Integer endtime);
41
+    List<Map> listRoomCommitMonth(@Param("param") RegionParam param);
44 42
 
45 43
 
46 44
     //近一个月布置作业次数
47
-    List<WorkVo> listPapernumMonth(Integer begintime, Integer endtime);
45
+    List<WorkVo> listPapernumMonth(@Param("param") RegionParam param);
48 46
 
49 47
     //近一个月课堂使用情况统计——使用次数
50
-    List<WorkVo> listRoomNumMonth(Integer begintime, Integer endtime);
48
+    List<WorkVo> listRoomNumMonth(@Param("param") RegionParam param);
51 49
     //近一个月课堂使用情况统计——课堂互动
52
-    List<WorkVo> listRoomAskNumMonth(Integer begintime, Integer endtime);
53
-    //近一个月课堂使用情况统计——课堂互动
54
-    List<Map> listRoomAskNumMonth2(Integer begintime, Integer endtime);
50
+    List<Map> listRoomAskNumMonth2(@Param("param") RegionParam param);
55 51
 }

+ 7
- 6
sapi/src/main/java/com/xhkjedu/sapi/mapper/region/SAnalyzeMapper.java Visa fil

@@ -1,6 +1,8 @@
1 1
 package com.xhkjedu.sapi.mapper.region;
2 2
 
3
+import com.xhkjedu.sapi.vo.analyze.SchoolParams;
3 4
 import com.xhkjedu.sapi.vo.region.AccessVo;
5
+import com.xhkjedu.sapi.vo.region.RegionParam;
4 6
 import com.xhkjedu.sapi.vo.region.ResourceTypeVo;
5 7
 import com.xhkjedu.sapi.vo.region.SWorkVo;
6 8
 import org.apache.ibatis.annotations.Param;
@@ -30,20 +32,19 @@ public interface SAnalyzeMapper {
30 32
     List<ResourceTypeVo> listResourceSubjectNum(Integer schoolid);
31 33
 
32 34
     //获取班级、教师、学生总量
33
-    Map listClassTeacherStudentNum(@Param("schoolid") Integer schoolid);
34
-    List<Map> listClassTeacherStudent(@Param("schoolid") Integer schoolid);
35
+    List<Map> listClassTeacherStudent(@Param("param") SchoolParams param);
35 36
     //近一个月访问统计
36 37
     List<AccessVo> listAccess(Integer schoolid, Integer begintime, Integer endtime);
37 38
 
38 39
     //近一个月应用监控统计
39 40
     List<AccessVo> listAppMonitorMonth(Integer schoolid, Integer begintime, Integer endtime);
40 41
     //近一个月教学统计——作业提交率
41
-    List<SWorkVo> listPaperCommitMonth(Integer schoolid, Integer begintime, Integer endtime, Integer year);
42
+    List<SWorkVo> listPaperCommitMonth(@Param("param") RegionParam param);
42 43
     //近一个月教学统计——预习提交率
43
-    List<SWorkVo> listGuideCommitMonth(Integer schoolid, Integer begintime, Integer endtime, Integer year);
44
+    List<SWorkVo> listGuideCommitMonth(@Param("param") RegionParam param);
44 45
 
45 46
     //近一个月课堂使用情况统计——使用次数
46
-    List<SWorkVo> listRoomNumMonth(Integer schoolid, Integer begintime, Integer endtime, Integer year);
47
+    List<SWorkVo> listRoomNumMonth(@Param("param") RegionParam param);
47 48
     //近一个月课堂使用情况统计——课堂互动
48
-    List<Map> listRoomAskNumMonth(Integer schoolid, Integer begintime, Integer endtime, Integer year);
49
+    List<Map> listRoomAskNumMonth(@Param("param") RegionParam param);
49 50
 }

+ 3
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/system/SchoolMapper.java Visa fil

@@ -63,4 +63,7 @@ public interface SchoolMapper extends TkMapper<TSchool> {
63 63
 
64 64
     //获取学年列表
65 65
     List<Integer> listYear(@Param("schoolid") Integer schoolid);
66
+
67
+    //获取区域学年列表
68
+    List<Integer> listCloudYear();
66 69
 }

+ 4
- 3
sapi/src/main/java/com/xhkjedu/sapi/service/region/RRoomAnalyzeService.java Visa fil

@@ -2,6 +2,7 @@ package com.xhkjedu.sapi.service.region;
2 2
 
3 3
 import com.xhkjedu.sapi.mapper.region.RRoomAnalyzeMapper;
4 4
 import com.xhkjedu.sapi.vo.region.RRoomVo;
5
+import com.xhkjedu.sapi.vo.region.RegionParam;
5 6
 import com.xhkjedu.utils.N_Utils;
6 7
 import org.springframework.stereotype.Service;
7 8
 
@@ -23,11 +24,11 @@ public class RRoomAnalyzeService {
23 24
     @Resource
24 25
     private RRoomAnalyzeMapper rRoomAnalyzeMapper;
25 26
 
26
-    public Map listRoom(Integer level, Integer begintime, Integer endtime) {
27
+    public Map listRoom(RegionParam param) {
27 28
         Map map = new HashMap();
28 29
         //学校课堂使用统计
29 30
         List<RRoomVo> list = new ArrayList<>();
30
-        List<RRoomVo> rooms = rRoomAnalyzeMapper.listRoom(level, begintime, endtime);
31
+        List<RRoomVo> rooms = rRoomAnalyzeMapper.listRoom(param);
31 32
         if (N_Utils.isListNotEmpty(rooms)) {
32 33
             Map<Integer, List<RRoomVo>> schoolRoomMap = rooms.stream().collect(Collectors.groupingBy(RRoomVo::getSchoolid));
33 34
             for (Map.Entry<Integer, List<RRoomVo>> entry : schoolRoomMap.entrySet()) {
@@ -83,7 +84,7 @@ public class RRoomAnalyzeService {
83 84
         Map<Integer, List<RRoomVo>> tscollect = list.stream().collect(Collectors.groupingBy(RRoomVo::getSchoolid));
84 85
         for(Map.Entry smap:tscollect.entrySet()) {
85 86
             List<RRoomVo> schools = (List<RRoomVo>) smap.getValue();
86
-            Integer daynum = N_Utils.getTimestampDay(begintime,endtime);//使用天数
87
+            Integer daynum = N_Utils.getTimestampDay(param.getBegintime(),param.getEndtime());//使用天数
87 88
             Integer totaltime = schools.stream().collect(Collectors.summingInt(RRoomVo::getTotaltime));//总用时
88 89
             RRoomVo school = schools.get(0);
89 90
             String schoolname = school.getSchoolname();

+ 7
- 5
sapi/src/main/java/com/xhkjedu/sapi/service/region/RSchoolAnalyzeService.java Visa fil

@@ -3,6 +3,7 @@ package com.xhkjedu.sapi.service.region;
3 3
 import com.xhkjedu.sapi.mapper.cloud.CloudMapper;
4 4
 import com.xhkjedu.sapi.mapper.region.RSchoolAnalyzeMapper;
5 5
 import com.xhkjedu.sapi.model.cloud.TCloud;
6
+import com.xhkjedu.sapi.vo.region.RegionParam;
6 7
 import com.xhkjedu.utils.N_Utils;
7 8
 import com.xhkjedu.sapi.vo.region.RSStuVo;
8 9
 import com.xhkjedu.sapi.vo.region.RSTeacherVo;
@@ -27,11 +28,11 @@ public class RSchoolAnalyzeService {
27 28
     private CloudMapper cloudMapper;
28 29
 
29 30
     //获取学校列表
30
-    public Map listSchool() {
31
+    public Map listSchool(RegionParam param) {
31 32
         Map map = new HashMap();
32 33
         TCloud cloud = cloudMapper.getCloud();
33 34
         map.put("cloudmap",cloud.getCloudmap());
34
-        List<SchoolVo> schools = rSchoolAnalyzeMapper.listSchool();
35
+        List<SchoolVo> schools = rSchoolAnalyzeMapper.listSchool(param);
35 36
         List<Map> levels = new ArrayList<>();
36 37
         /*Map<Object, List<SchoolVo>> schoollevel = schools.stream().collect(Collectors.groupingBy(m -> m.getSchoollevel()));
37 38
         for(Map.Entry lmap:schoollevel.entrySet()) {
@@ -210,10 +211,11 @@ public class RSchoolAnalyzeService {
210 211
      * @Author ywx
211 212
      * @Date 2021/7/9 15:22
212 213
      * @return java.util.Map
213
-     **/
214
-    public Map listStu() {
214
+     *
215
+     * @param param*/
216
+    public Map listStu(RegionParam param) {
215 217
         Map map = new HashMap();
216
-        List<RSStuVo> students = rSchoolAnalyzeMapper.listStu();
218
+        List<RSStuVo> students = rSchoolAnalyzeMapper.listStu(param);
217 219
         Integer znum = students.size();
218 220
         //学生性别统计
219 221
         List<Map> sexes = new ArrayList<>();

+ 17
- 61
sapi/src/main/java/com/xhkjedu/sapi/service/region/RegionAnalyzeService.java Visa fil

@@ -169,18 +169,18 @@ public class RegionAnalyzeService {
169 169
     }
170 170
 
171 171
     //获取学校列表
172
-    public List<Map> listSchool() {
173
-        return regionAnalyzeMapper.listSchool();
172
+    public List<Map> listSchool(RegionParam param) {
173
+        return regionAnalyzeMapper.listSchool(param);
174 174
     }
175 175
 
176 176
     //获取学段班级、教师、学生总量
177
-    public List<Map> listClassTeacherStudentNum() {
178
-        return regionAnalyzeMapper.listClassTeacherStudentNum();
177
+    public List<Map> listClassTeacherStudentNum(RegionParam param) {
178
+        return regionAnalyzeMapper.listClassTeacherStudentNum(param);
179 179
     }
180 180
 
181 181
     //近一个月教学统计
182
-    public Map listPaperCommitMonth(Integer begintime, Integer endtime) {
183
-        List<WorkVo> works = regionAnalyzeMapper.listPaperCommitMonth(begintime, endtime);
182
+    public Map listPaperCommitMonth(RegionParam param) {
183
+        List<WorkVo> works = regionAnalyzeMapper.listPaperCommitMonth(param);
184 184
         Map map = new HashMap();
185 185
 
186 186
         if (works != null && works.size() > 0) {
@@ -207,13 +207,13 @@ public class RegionAnalyzeService {
207 207
     }
208 208
 
209 209
     //近一个月教学统计--各教学任务
210
-    public List<WorkRtnVo> listWorkCommitMonth(Integer begintime, Integer endtime) {
210
+    public List<WorkRtnVo> listWorkCommitMonth(RegionParam param) {
211 211
 
212 212
         List<WorkRtnVo> rtnmap = new ArrayList<>();
213 213
         boolean noexist = false;
214 214
 
215 215
         //作业
216
-        List<WorkVo> papers = regionAnalyzeMapper.listPaperCommitMonth(begintime, endtime);
216
+        List<WorkVo> papers = regionAnalyzeMapper.listPaperCommitMonth(param);
217 217
         if (N_Utils.isListNotEmpty(papers)) {
218 218
             for (WorkVo w : papers) {
219 219
                 List<WorkDetailVo> detials = w.getDetails();
@@ -238,7 +238,7 @@ public class RegionAnalyzeService {
238 238
             }
239 239
         }
240 240
         //课堂考勤
241
-        List<Map> rooms = regionAnalyzeMapper.listRoomCommitMonth(begintime, endtime);
241
+        List<Map> rooms = regionAnalyzeMapper.listRoomCommitMonth(param);
242 242
         if (N_Utils.isListNotEmpty(rooms)) {
243 243
             for (Map map : rooms) {
244 244
                 Integer stunum = Integer.parseInt(map.get("stunum").toString());
@@ -262,7 +262,7 @@ public class RegionAnalyzeService {
262 262
             }
263 263
         }
264 264
         //预习
265
-        List<WorkVo> guides = regionAnalyzeMapper.listGuideCommitMonth(begintime, endtime);
265
+        List<WorkVo> guides = regionAnalyzeMapper.listGuideCommitMonth(param);
266 266
         if (N_Utils.isListNotEmpty(guides)) {
267 267
             for (WorkVo w : guides) {
268 268
                 List<WorkDetailVo> detials = w.getDetails();
@@ -286,7 +286,7 @@ public class RegionAnalyzeService {
286 286
             }
287 287
         }
288 288
         //背诵
289
-        List<WorkVo> recites = regionAnalyzeMapper.listReciteCommitMonth(begintime, endtime);
289
+        List<WorkVo> recites = regionAnalyzeMapper.listReciteCommitMonth(param);
290 290
         if (N_Utils.isListNotEmpty(recites)) {
291 291
             for (WorkVo w : recites) {
292 292
                 List<WorkDetailVo> detials = w.getDetails();
@@ -324,8 +324,8 @@ public class RegionAnalyzeService {
324 324
     }
325 325
 
326 326
     //近一个月布置作业次数
327
-    public Map listPapernumMonth(Integer begintime, Integer endtime) {
328
-        List<WorkVo> papers = regionAnalyzeMapper.listPapernumMonth(begintime, endtime);
327
+    public Map listPapernumMonth(RegionParam param) {
328
+        List<WorkVo> papers = regionAnalyzeMapper.listPapernumMonth(param);
329 329
 
330 330
         Map map = new HashMap();
331 331
         if (papers != null && papers.size() > 0) {
@@ -347,10 +347,10 @@ public class RegionAnalyzeService {
347 347
     }
348 348
 
349 349
     //近一个月课堂使用情况统计——使用次数
350
-    public Map listRoomNumMonth(Integer begintime, Integer endtime) {
350
+    public Map listRoomNumMonth(RegionParam param) {
351 351
         Map map = new HashMap();
352 352
 
353
-        List<WorkVo> rooms = regionAnalyzeMapper.listRoomNumMonth(begintime, endtime);
353
+        List<WorkVo> rooms = regionAnalyzeMapper.listRoomNumMonth(param);
354 354
         if (rooms != null && rooms.size() > 0) {
355 355
             //最大数量对象
356 356
             WorkVo maxnum = rooms.stream().max(Comparator.comparing(WorkVo::getNum)).get();
@@ -367,51 +367,7 @@ public class RegionAnalyzeService {
367 367
     }
368 368
 
369 369
     //近一个月课堂使用情况统计——课堂互动
370
-    public List<Map> listRoomAskNumMonth(Integer begintime, Integer endtime, Integer year) {
371
-
372
-        List<WorkVo> list = regionAnalyzeMapper.listRoomAskNumMonth(begintime, endtime);//课堂互动
373
-
374
-        List<WorkVo> rooms = regionAnalyzeMapper.listRoomNumMonth(begintime, endtime);//课堂次数
375
-        Map<Integer, Integer> roommap = rooms.stream().collect(Collectors.toMap(WorkVo::getSchoolid, WorkVo::getNum));
376
-
377
-        //互动类型20抢答21随机点名30判断题31选择题32简答题33画图题40课堂小测
378
-        List<Map> rtnlist = new ArrayList<>();
379
-
380
-        if (list != null && list.size() > 0) {
381
-            for (WorkVo room : list) {
382
-                List<WorkTypeVo> asks = room.getAsks();
383
-
384
-                //提问次数
385
-                List<WorkTypeVo> twlist = asks.stream().filter(workTypeVo -> workTypeVo.getAsktype() >= 30).filter(workTypeVo -> workTypeVo.getAsktype() < 40).collect(Collectors.toList());
386
-                Integer twnum = twlist.stream().mapToInt(WorkTypeVo::getAsknum).sum();
387
-                //堂测次数
388
-                List<WorkTypeVo> tclist = asks.stream().filter(workTypeVo -> workTypeVo.getAsktype() == 40).collect(Collectors.toList());
389
-                Integer tcnum = tclist.stream().mapToInt(WorkTypeVo::getAsknum).sum();
390
-                //点名次数
391
-                List<WorkTypeVo> dmlist = asks.stream().filter(workTypeVo -> workTypeVo.getAsktype() == 21).collect(Collectors.toList());
392
-                Integer dmnum = dmlist.stream().mapToInt(WorkTypeVo::getAsknum).sum();
393
-                //抢答次数
394
-                List<WorkTypeVo> qdlist = asks.stream().filter(workTypeVo -> workTypeVo.getAsktype() == 20).collect(Collectors.toList());
395
-                Integer qdnum = qdlist.stream().mapToInt(WorkTypeVo::getAsknum).sum();
396
-
397
-                Map map = new HashMap();
398
-                map.put("twnum", twnum);
399
-                map.put("tcnum", tcnum);
400
-                map.put("dmnum", dmnum);
401
-                map.put("qdnum", qdnum);
402
-                map.put("schoolname", room.getSchoolname());
403
-                map.put("shortname", room.getShortname());
404
-                map.put("num", roommap.get(room.getSchoolid()));
405
-
406
-                rtnlist.add(map);
407
-            }
408
-        }
409
-
410
-        return rtnlist;
411
-    }
412
-
413
-    //近一个月课堂使用情况统计——课堂互动
414
-    public List<Map> listRoomAskNumMonth2(Integer begintime, Integer endtime) {
415
-        return regionAnalyzeMapper.listRoomAskNumMonth2(begintime, endtime);
370
+    public List<Map> listRoomAskNumMonth2(RegionParam param) {
371
+        return regionAnalyzeMapper.listRoomAskNumMonth2(param);
416 372
     }
417 373
 }

+ 28
- 19
sapi/src/main/java/com/xhkjedu/sapi/service/region/SAnalyzeService.java Visa fil

@@ -1,12 +1,10 @@
1 1
 package com.xhkjedu.sapi.service.region;
2 2
 
3
-import com.xhkjedu.sapi.mapper.system.SchoolMapper;
4 3
 import com.xhkjedu.sapi.mapper.region.SAnalyzeMapper;
4
+import com.xhkjedu.sapi.mapper.system.SchoolMapper;
5
+import com.xhkjedu.sapi.vo.analyze.SchoolParams;
6
+import com.xhkjedu.sapi.vo.region.*;
5 7
 import com.xhkjedu.utils.N_Utils;
6
-import com.xhkjedu.sapi.vo.region.AccessVo;
7
-import com.xhkjedu.sapi.vo.region.ResourceTypeVo;
8
-import com.xhkjedu.sapi.vo.region.SAClassVo;
9
-import com.xhkjedu.sapi.vo.region.SWorkVo;
10 8
 import org.springframework.stereotype.Service;
11 9
 
12 10
 import javax.annotation.Resource;
@@ -99,10 +97,13 @@ public class SAnalyzeService {
99 97
     }
100 98
 
101 99
     //获取班级、教师、学生总量
102
-    public Map listClassTeacherStudentNum(Integer schoolid) {
100
+    public Map listClassTeacherStudentNum(SchoolParams param) {
103 101
 //        Map map = sAnalyzeMapper.listClassTeacherStudentNum(schoolid);
104 102
         Map map = new HashMap();
105
-        List<Map> list = sAnalyzeMapper.listClassTeacherStudent(schoolid);
103
+        if(N_Utils.isEmptyInteger(param.getYear())){
104
+            param.setYear(schoolMapper.getYearById(param.getSchoolid()));
105
+        }
106
+        List<Map> list = sAnalyzeMapper.listClassTeacherStudent(param);
106 107
         Map<Integer,List<Map>> grades = list.stream().collect(Collectors.groupingBy(m->(Integer) m.get("gradeid")));
107 108
         grades = grades.entrySet().stream().sorted(Map.Entry.comparingByKey())
108 109
                 .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (c1, c2) -> c1, LinkedHashMap::new));
@@ -231,16 +232,20 @@ public class SAnalyzeService {
231 232
     }
232 233
 
233 234
     //近一个月作业统计
234
-    public List<Map> listPaperCommitMonth(Integer schoolid, Integer begintime, Integer endtime) {
235
-        Integer year = schoolMapper.getYearById(schoolid);
236
-        List<SWorkVo> works = sAnalyzeMapper.listPaperCommitMonth(schoolid, begintime, endtime, year);
235
+    public List<Map> listPaperCommitMonth(RegionParam param) {
236
+        if(N_Utils.isEmptyInteger(param.getYear())) {
237
+            param.setYear(schoolMapper.getYearById(param.getSchoolid()));
238
+        }
239
+        List<SWorkVo> works = sAnalyzeMapper.listPaperCommitMonth(param);
237 240
         return getPaperGuide(works);
238 241
     }
239 242
 
240 243
     //近一个月预习统计
241
-    public List<Map> listGuideCommitMonth(Integer schoolid, Integer begintime, Integer endtime) {
242
-        Integer year = schoolMapper.getYearById(schoolid);
243
-        List<SWorkVo> works = sAnalyzeMapper.listGuideCommitMonth(schoolid, begintime, endtime, year);
244
+    public List<Map> listGuideCommitMonth(RegionParam param) {
245
+        if(N_Utils.isEmptyInteger(param.getYear())) {
246
+            param.setYear(schoolMapper.getYearById(param.getSchoolid()));
247
+        }
248
+        List<SWorkVo> works = sAnalyzeMapper.listGuideCommitMonth(param);
244 249
         return getPaperGuide(works);
245 250
     }
246 251
 
@@ -269,11 +274,13 @@ public class SAnalyzeService {
269 274
     }
270 275
 
271 276
     //近一个月课堂使用情况统计——使用次数
272
-    public Map listRoomNumMonth(Integer schoolid, Integer begintime, Integer endtime) {
277
+    public Map listRoomNumMonth(RegionParam param) {
273 278
         Map map = new HashMap();
274 279
 
275
-        Integer year = schoolMapper.getYearById(schoolid);
276
-        List<SWorkVo> rooms = sAnalyzeMapper.listRoomNumMonth(schoolid, begintime, endtime, year);
280
+        if(N_Utils.isEmptyInteger(param.getYear())) {
281
+            param.setYear(schoolMapper.getYearById(param.getSchoolid()));
282
+        }
283
+        List<SWorkVo> rooms = sAnalyzeMapper.listRoomNumMonth(param);
277 284
         if (rooms != null && rooms.size() > 0) {
278 285
             //最大数量对象
279 286
             SWorkVo maxnum = rooms.stream().max(Comparator.comparing(SWorkVo::getNum)).get();
@@ -293,8 +300,10 @@ public class SAnalyzeService {
293 300
     }
294 301
 
295 302
     //近一个月课堂使用情况统计——课堂互动
296
-    public List<Map> listRoomAskNumMonth(Integer schoolid, Integer begintime, Integer endtime) {
297
-        Integer year = schoolMapper.getYearById(schoolid);
298
-        return sAnalyzeMapper.listRoomAskNumMonth(schoolid, begintime, endtime, year);
303
+    public List<Map> listRoomAskNumMonth(RegionParam param) {
304
+        if(N_Utils.isEmptyInteger(param.getYear())) {
305
+            param.setYear(schoolMapper.getYearById(param.getSchoolid()));
306
+        }
307
+        return sAnalyzeMapper.listRoomAskNumMonth(param);
299 308
     }
300 309
 }

+ 5
- 0
sapi/src/main/java/com/xhkjedu/sapi/service/system/SchoolService.java Visa fil

@@ -521,4 +521,9 @@ public class SchoolService {
521 521
     public List<Integer> listYear(Integer schoolid) {
522 522
         return schoolMapper.listYear(schoolid);
523 523
     }
524
+
525
+    //获取区域学年列表
526
+    public List<Integer> listCloudYear() {
527
+        return schoolMapper.listCloudYear();
528
+    }
524 529
 }

+ 63
- 9
sapi/src/main/resources/mapper/region/RPaperAnalyzeMapper.xml Visa fil

@@ -7,28 +7,52 @@
7 7
       select count(DISTINCT pg.paperid) from t_paper_group pg left join t_paper p on pg.paperid=p.paperid
8 8
         LEFT JOIN t_school s on p.schoolid=s.schoolid
9 9
         left join t_class c on c.classid=pg.classid
10
-        where s.schoollevel=#{param.level} and c.year=s.year and pg.starttime between #{param.begintime} and #{param.endtime}
10
+        where s.schoollevel=#{param.level} and pg.starttime between #{param.begintime} and #{param.endtime}
11
+        <if test="param.year!=null and param.year!=0">
12
+            and c.year=#{param.year}
13
+        </if>
14
+        <if test="param.year==null || param.year==0">
15
+            and c.year=s.year
16
+        </if>
11 17
     </select>
12 18
     <!--作业数量统计——预习数量-->
13 19
     <select id="getRegionPaperNumPreview" resultType="java.lang.Integer">
14 20
         select count(DISTINCT g.guideid) from t_guide_group gg left join t_guide g on gg.guideid=g.guideid
15 21
         LEFT JOIN t_school s on g.schoolid=s.schoolid
16 22
         left join t_class c on c.classid=gg.classid
17
-        where s.schoollevel=#{param.level} and c.year=s.year and g.createtime between #{param.begintime} and #{param.endtime}
23
+        where s.schoollevel=#{param.level} and g.createtime between #{param.begintime} and #{param.endtime}
24
+        <if test="param.year!=null and param.year!=0">
25
+            and c.year=#{param.year}
26
+        </if>
27
+        <if test="param.year==null || param.year==0">
28
+            and c.year=s.year
29
+        </if>
18 30
     </select>
19 31
     <!--作业数量统计——背诵数量-->
20 32
     <select id="getRegionPaperNumRecite" resultType="java.lang.Integer">
21 33
        select count(DISTINCT rg.reciteid) from t_recite_group rg left join t_recite r on rg.reciteid=r.reciteid
22 34
         LEFT JOIN t_school s on r.schoolid=s.schoolid
23 35
         left join t_class c on c.classid=rg.classid
24
-        where s.schoollevel=#{param.level} and c.year=s.year and rg.starttime between #{param.begintime} and #{param.endtime}
36
+        where s.schoollevel=#{param.level} and rg.starttime between #{param.begintime} and #{param.endtime}
37
+        <if test="param.year!=null and param.year!=0">
38
+            and c.year=#{param.year}
39
+        </if>
40
+        <if test="param.year==null || param.year==0">
41
+            and c.year=s.year
42
+        </if>
25 43
     </select>
26 44
     <!--作业数量统计——错题视频数量-->
27 45
     <select id="getRegionPaperNumQueexp" resultType="java.lang.Integer">
28 46
        select count(distinct qe.qcpid) from t_question_explain qe left join t_question_class qc on qe.questionid=qe.questionid
29 47
       left JOIN t_school s on qc.schoolid=s.schoolid
30 48
       left join t_class c on c.classid=qc.classid
31
-      where s.schoollevel=#{param.level} and c.year=s.year and qe.createtime between #{param.begintime} and #{param.endtime}
49
+      where s.schoollevel=#{param.level} and qe.createtime between #{param.begintime} and #{param.endtime}
50
+        <if test="param.year!=null and param.year!=0">
51
+            and c.year=#{param.year}
52
+        </if>
53
+        <if test="param.year==null || param.year==0">
54
+            and c.year=s.year
55
+        </if>
32 56
     </select>
33 57
 
34 58
     <!--作业各类率统计-->
@@ -59,7 +83,13 @@
59 83
         left join t_paper_student ps on ps.paperid=p.paperid and ps.classid=pg.classid
60 84
         left join t_school s on p.schoolid=s.schoolid
61 85
         left join t_class c on c.classid=pg.classid
62
-        where s.schoollevel=#{param.level} and c.year=s.year and pg.starttime between #{param.begintime} and #{param.endtime}
86
+        where s.schoollevel=#{param.level} and pg.starttime between #{param.begintime} and #{param.endtime}
87
+        <if test="param.year!=null and param.year!=0">
88
+            and c.year=#{param.year}
89
+        </if>
90
+        <if test="param.year==null || param.year==0">
91
+            and c.year=s.year
92
+        </if>
63 93
         group by p.schoolid,p.paperid order by p.schoolid
64 94
     </select>
65 95
     <!--作业各类率统计——背诵-->
@@ -72,7 +102,13 @@
72 102
         left join t_recite_student rs on rs.reciteid=r.reciteid and rs.classid=rg.classid
73 103
         left join t_school s on r.schoolid=s.schoolid
74 104
         left join t_class c on c.classid=rg.classid
75
-        where s.schoollevel=#{param.level} and c.year=s.year  and rg.starttime between #{param.begintime} and #{param.endtime}
105
+        where s.schoollevel=#{param.level} and rg.starttime between #{param.begintime} and #{param.endtime}
106
+        <if test="param.year!=null and param.year!=0">
107
+            and c.year=#{param.year}
108
+        </if>
109
+        <if test="param.year==null || param.year==0">
110
+            and c.year=s.year
111
+        </if>
76 112
         group by r.schoolid,r.reciteid order by r.schoolid
77 113
     </select>
78 114
     <!--作业各类率统计——预习-->
@@ -85,7 +121,13 @@
85 121
         left join t_guide_group_student ggs on ggs.guideid=g.guideid and ggs.classid=gg.classid
86 122
         left join t_school s on s.schoolid=g.schoolid
87 123
         left join t_class c on c.classid=gg.classid
88
-        where s.schoollevel=#{param.level} and c.year=s.year and g.createtime between #{param.begintime} and #{param.endtime}
124
+        where s.schoollevel=#{param.level} and g.createtime between #{param.begintime} and #{param.endtime}
125
+        <if test="param.year!=null and param.year!=0">
126
+            and c.year=#{param.year}
127
+        </if>
128
+        <if test="param.year==null || param.year==0">
129
+            and c.year=s.year
130
+        </if>
89 131
         group by s.schoolid, g.guideid order by s.schoolid
90 132
     </select>
91 133
 
@@ -97,7 +139,13 @@
97 139
          from t_paper_student ps
98 140
         left join t_school s on ps.schoolid=s.schoolid
99 141
         left join t_class c on c.classid=ps.classid
100
-        where s.schoollevel=#{param.level} and c.year=s.year and ps.stoptime between #{param.begintime} and #{param.endtime}
142
+        where s.schoollevel=#{param.level} and ps.stoptime between #{param.begintime} and #{param.endtime}
143
+        <if test="param.year!=null and param.year!=0">
144
+            and c.year=#{param.year}
145
+        </if>
146
+        <if test="param.year==null || param.year==0">
147
+            and c.year=s.year
148
+        </if>
101 149
         group by ps.schoolid order by ps.schoolid
102 150
     </select>
103 151
     <!--人均用时——预习-->
@@ -109,7 +157,13 @@
109 157
         left join t_guide g on gs.guideid=g.guideid
110 158
         left join t_school s on g.schoolid=s.schoolid
111 159
         left join t_class c on c.classid=gs.classid
112
-        where s.schoollevel=#{param.level} and c.year=s.year and gs.readtime between #{param.begintime} and #{param.endtime} and gs.readtime>0
160
+        where s.schoollevel=#{param.level} and gs.readtime between #{param.begintime} and #{param.endtime} and gs.readtime>0
161
+        <if test="param.year!=null and param.year!=0">
162
+            and c.year=#{param.year}
163
+        </if>
164
+        <if test="param.year==null || param.year==0">
165
+            and c.year=s.year
166
+        </if>
113 167
         group by s.schoolid order by s.schoolid
114 168
     </select>
115 169
 

+ 8
- 9
sapi/src/main/resources/mapper/region/RRoomAnalyzeMapper.xml Visa fil

@@ -24,15 +24,14 @@
24 24
         left join t_classroom_paper p on p.paperid=rt.paperid
25 25
         left join t_classroom_paper_student ps on p.paperid=ps.paperid
26 26
         left join t_classroom_paper_student_scantron pss on ps.psid=pss.psid
27
-        where s.schoollevel=#{level} and s.schoolstate=1 and c.year=s.year and r.roomstate=2 and r.endtime is not null
28
-        and r.createtime between #{begintime} and #{endtime}
27
+        where s.schoollevel=#{param.level} and s.schoolstate=1 and r.roomstate=2 and r.endtime is not null
28
+        <if test="param.year!=null and param.year!=0">
29
+            and c.year=#{param.year}
30
+        </if>
31
+        <if test="param.year==null || param.year==0">
32
+            and c.year=s.year
33
+        </if>
34
+        and r.createtime between #{param.begintime} and #{param.endtime}
29 35
         group by r.roomid
30 36
     </select>
31
-    <!--获取学校课堂用时人数统计-->
32
-    <select id="getRoom" resultType="com.xhkjedu.sapi.vo.region.RRoomVo">
33
-        select sum(r.endtime-r.createtime)totaltime,sum(r.classnum)classnum,sum(r.realstunum)realstunum
34
-        from t_classroom r left join t_class c on c.classid=r.classid
35
-        where r.schoolid=#{schoolid} and c.year=#{year} and r.roomstate=2 and r.endtime is not null
36
-        and r.createtime between #{begintime} and #{endtime}
37
-    </select>
38 37
 </mapper>

+ 14
- 2
sapi/src/main/resources/mapper/region/RSchoolAnalyzeMapper.xml Visa fil

@@ -6,7 +6,13 @@
6 6
         select s.schoollevel,s.schoolname,s.shortname,s.coordinate,count(c.classid)bjnum
7 7
         ,(select count(*) from t_user u where u.schoolid=c.schoolid and u.usertype=1 and u.userstate=1)jsnum
8 8
         ,sum((select count(distinct cs.studentid) from t_class_student cs where cs.classid=c.classid))xsnum
9
-        from t_school s left join t_class c on c.schoolid=s.schoolid and c.classstate=1 and c.year=s.year and c.classtype=1
9
+        from t_school s left join t_class c on c.schoolid=s.schoolid and c.classstate=1 and c.classtype=1
10
+        <if test="param.year!=null and param.year!=0">
11
+            and c.year=#{param.year}
12
+        </if>
13
+        <if test="param.year==null || param.year==0">
14
+            and c.year=s.year
15
+        </if>
10 16
         where s.schoolstate=1 group by s.schoolid order by s.schoollevel,s.schoolid
11 17
     </select>
12 18
     <!--教师性别统计-->
@@ -31,7 +37,13 @@
31 37
         from t_class_student cs left join t_user u on cs.studentid=u.userid
32 38
         left join t_class c on cs.classid=c.classid
33 39
         left join t_school s on c.schoolid=s.schoolid
34
-        where s.schoolstate=1 and c.classtype=1 and c.classstate=1 and c.year=s.year
40
+        where s.schoolstate=1 and c.classtype=1 and c.classstate=1
41
+        <if test="param.year!=null and param.year!=0">
42
+            and c.year=#{param.year}
43
+        </if>
44
+        <if test="param.year==null || param.year==0">
45
+            and c.year=s.year
46
+        </if>
35 47
     </select>
36 48
     <!--活跃度统计-->
37 49
     <select id="listAccess" resultType="java.util.Map">

+ 77
- 24
sapi/src/main/resources/mapper/region/RegionAnalyzeMapper.xml Visa fil

@@ -36,7 +36,13 @@
36 36
         ,(select cloudmap from t_cloud limit 1)cloudmap
37 37
         ,(select count(*) from t_user u where u.schoolid=c.schoolid and u.usertype=1 and u.userstate=1)jsnum
38 38
         ,sum((select count(distinct cs.studentid) from t_class_student cs where cs.classid=c.classid))xsnum
39
-        from t_school s left join t_class c on c.schoolid=s.schoolid and c.classstate=1 and c.year=s.year and c.classtype=1
39
+        from t_school s left join t_class c on c.schoolid=s.schoolid and c.classstate=1 and c.classtype=1
40
+        <if test="param.year!=null and param.year!=0">
41
+            and c.year=#{param.year}
42
+        </if>
43
+        <if test="param.year==null or param.year==0">
44
+            and c.year=s.year
45
+        </if>
40 46
         where s.schoolstate=1
41 47
         group by s.schoolid order by s.schoolid
42 48
     </select>
@@ -46,7 +52,13 @@
46 52
         ,(select count(*) from t_user u where u.schoolid=c.schoolid and u.usertype=1 and u.userstate=1)jsnum
47 53
         ,sum((select count(distinct cs.studentid) from t_class_student cs where cs.classid=c.classid))xsnum
48 54
         from t_school s right join t_class c on s.schoolid=c.schoolid
49
-        where s.schoolstate=1 and c.classstate=1 and c.year=s.year and c.classtype=1
55
+        where s.schoolstate=1 and c.classstate=1 and c.classtype=1
56
+        <if test="param.year!=null and param.year!=0">
57
+            and c.year=#{param.year}
58
+        </if>
59
+        <if test="param.year==null or param.year==0">
60
+            and c.year=s.year
61
+        </if>
50 62
         group by s.schoollevel
51 63
     </select>
52 64
 
@@ -70,10 +82,17 @@
70 82
         count(distinct case when ps.psstate!=0 then ps.psid else null end)commitnum,
71 83
         count(distinct case when ps.psstate!=0 and ps.pschecked=1 then ps.psid else null end)checknum
72 84
         from t_paper_group pg
73
-        right join t_school s on pg.schoolid=s.schoolid and pg.pgstate=22 and pg.starttime between #{begintime} and #{endtime}
85
+        right join t_school s on pg.schoolid=s.schoolid and pg.pgstate=22
86
+        and pg.starttime between #{param.begintime} and #{param.endtime}
74 87
         left join t_paper_student ps on ps.paperid=pg.paperid
75 88
         left join t_class c on c.classid=pg.classid
76
-        where s.schoolstate=1 and c.year=s.year
89
+        where s.schoolstate=1
90
+        <if test="param.year!=null and param.year!=0">
91
+            and c.year=#{param.year}
92
+        </if>
93
+        <if test="param.year==null or param.year==0">
94
+            and c.year=s.year
95
+        </if>
77 96
         group by s.schoolid,pg.paperid order by s.schoolid
78 97
     </select>
79 98
     <!--预习-->
@@ -81,10 +100,17 @@
81 100
         select s.schoolid,s.schoolname,s.shortname,g.guideid as rid,
82 101
         count(distinct gs.rgsid) stunum,
83 102
         count(distinct case when gs.readtime>0 then gs.rgsid else null end) commitnum
84
-        from t_guide g right join t_school s on g.schoolid=s.schoolid and g.createtime between #{begintime} and #{endtime}
103
+        from t_guide g right join t_school s on g.schoolid=s.schoolid
104
+        and g.createtime between #{param.begintime} and #{param.endtime}
85 105
         left join t_guide_group_student gs on gs.guideid=g.guideid
86 106
         left join t_class c on c.classid=gs.classid
87
-        where s.schoolstate=1 and c.year=s.year
107
+        where s.schoolstate=1
108
+        <if test="param.year!=null and param.year!=0">
109
+            and c.year=#{param.year}
110
+        </if>
111
+        <if test="param.year==null or param.year==0">
112
+            and c.year=s.year
113
+        </if>
88 114
         group by s.schoolid,g.guideid order by g.schoolid
89 115
     </select>
90 116
 
@@ -93,18 +119,32 @@
93 119
         select s.schoolid,s.schoolname,s.shortname,rg.reciteid as wid,
94 120
         count(distinct rs.rsid) stunum,
95 121
         count(distinct case when rs.rsstate!=0 then rs.rsid else null end) commitnum
96
-        from t_recite_group rg right join t_school s on rg.schoolid=s.schoolid and rg.starttime between #{begintime} and #{endtime}
122
+        from t_recite_group rg right join t_school s on rg.schoolid=s.schoolid
123
+        and rg.starttime between #{param.begintime} and #{param.endtime}
97 124
         left join t_recite_student rs on rs.reciteid=rg.reciteid and rs.classid=rg.classid
98 125
         left join t_class c on c.classid=rg.classid
99
-        where s.schoolstate=1 and c.year=s.year
126
+        where s.schoolstate=1
127
+        <if test="param.year!=null and param.year!=0">
128
+            and c.year=#{param.year}
129
+        </if>
130
+        <if test="param.year==null or param.year==0">
131
+            and c.year=s.year
132
+        </if>
100 133
         group by s.schoolid,rg.reciteid order by s.schoolid
101 134
     </select>
102 135
     <!--课堂出勤率-->
103 136
     <select id="listRoomCommitMonth" resultType="java.util.Map">
104 137
         select s.schoolid,s.schoolname,s.shortname,ifnull(SUM(c.classnum),0) stunum,ifnull(SUM(c.realstunum),0) commitnum
105 138
         from t_classroom c left join t_class c2 on c.classid=c2.classid
106
-        right join t_school s on c.schoolid=s.schoolid and c.roomstate=2 and c.createtime between #{begintime} and #{endtime}
107
-        where s.schoolstate=1 and c2.year=s.year
139
+        right join t_school s on c.schoolid=s.schoolid and c.roomstate=2
140
+        and c.createtime between #{param.begintime} and #{param.endtime}
141
+        where s.schoolstate=1
142
+        <if test="param.year!=null and param.year!=0">
143
+            and c2.year=#{param.year}
144
+        </if>
145
+        <if test="param.year==null or param.year==0">
146
+            and c2.year=s.year
147
+        </if>
108 148
         group by s.schoolid order by s.schoolid
109 149
     </select>
110 150
 
@@ -112,8 +152,15 @@
112 152
     <select id="listPapernumMonth" resultType="com.xhkjedu.sapi.vo.region.WorkVo">
113 153
         select s.schoolid,s.schoolname,s.shortname,count(distinct pg.paperid) num
114 154
         from t_paper_group pg left join t_class c on c.classid=pg.classid
115
-        right join t_school s on pg.schoolid=s.schoolid and pg.pgstate=22 and pg.createtime between #{begintime} and #{endtime}
116
-        where s.schoolstate=1 and c.year=s.year
155
+        right join t_school s on pg.schoolid=s.schoolid and pg.pgstate=22
156
+        and pg.createtime between #{param.begintime} and #{param.endtime}
157
+        where s.schoolstate=1
158
+        <if test="param.year!=null and param.year!=0">
159
+            and c.year=#{param.year}
160
+        </if>
161
+        <if test="param.year==null or param.year==0">
162
+            and c.year=s.year
163
+        </if>
117 164
         group by s.schoolid order by s.schoolid
118 165
 
119 166
     </select>
@@ -121,9 +168,16 @@
121 168
     <!--课堂使用情况统计——使用次数-->
122 169
     <select id="listRoomNumMonth" resultType="com.xhkjedu.sapi.vo.region.WorkVo">
123 170
         select s.schoolid,s.schoolname,s.shortname,count(c.roomid) num from t_classroom c
124
-        right join t_school s on c.schoolid=s.schoolid and c.createtime between #{begintime} and #{endtime}
171
+        right join t_school s on c.schoolid=s.schoolid
172
+        and c.createtime between #{param.begintime} and #{param.endtime}
125 173
         left join t_class c2 on c.classid=c2.classid
126
-        where s.schoolstate=1 and c2.year=s.year
174
+        where s.schoolstate=1
175
+        <if test="param.year!=null and param.year!=0">
176
+            and c2.year=#{param.year}
177
+        </if>
178
+        <if test="param.year==null or param.year==0">
179
+            and c2.year=s.year
180
+        </if>
127 181
         group by s.schoolid order by s.schoolid
128 182
     </select>
129 183
     <resultMap id="roomAsk" type="com.xhkjedu.sapi.vo.region.WorkVo">
@@ -137,24 +191,23 @@
137 191
     </resultMap>
138 192
 
139 193
     <!--课堂使用情况统计——课堂互动-->
140
-    <select id="listRoomAskNumMonth" resultMap="roomAsk">
141
-      select s.schoolid,s.schoolname,s.shortname,ca.asktype,count(ca.asktid) asknum from t_classroom_askteacher ca
142
-        right join t_school s on ca.schoolid=s.schoolid
143
-        left join t_classroom c on ca.roomid=c.roomid and c.createtime between #{begintime} and #{endtime}
144
-        left join t_class c2 on c.classid=c2.classid
145
-        where s.schoolstate=1 and c2.year=s.year
146
-        group by s.schoolid,ca.asktype order by s.schoolid
147
-    </select>
148 194
     <select id="listRoomAskNumMonth2" resultType="java.util.Map">
149 195
         select s.schoolname,s.shortname,count(distinct c.roomid)num
150 196
         ,sum(case when ca.asktype between 30 and 33 then 1 else 0 end)twnum
151 197
         ,sum(case when ca.asktype =40 then 1 else 0 end)tcnum
152 198
         ,sum(case when ca.asktype =21 then 1 else 0 end)dmnum
153 199
         ,sum(case when ca.asktype =20 then 1 else 0 end)qdnum
154
-        from t_classroom c right join t_school s on c.schoolid=s.schoolid and c.createtime between #{begintime} and #{endtime}
200
+        from t_classroom c right join t_school s on c.schoolid=s.schoolid
201
+        and c.createtime between #{param.begintime} and #{param.endtime}
155 202
         left join t_classroom_askteacher ca on ca.roomid=c.roomid
156 203
         left join t_class c2 on c.classid=c2.classid
157
-        where s.schoolstate=1 and c2.year=s.year
204
+        where s.schoolstate=1
205
+        <if test="param.year!=null and param.year!=0">
206
+            and c2.year=#{param.year}
207
+        </if>
208
+        <if test="param.year==null or param.year==0">
209
+            and c2.year=s.year
210
+        </if>
158 211
         group by s.schoolid order by s.schoolid
159 212
     </select>
160 213
 </mapper>

+ 12
- 16
sapi/src/main/resources/mapper/region/SAnalyzeMapper.xml Visa fil

@@ -40,22 +40,14 @@
40 40
         and ts.schoolid=#{schoolid}
41 41
         group by r.subjectid order by s.subjectorder
42 42
     </select>
43
-    <!--获取学段班级、教师、学生总量-->
44
-    <select id="listClassTeacherStudentNum" resultType="java.util.Map">
45
-        select count(c.classid)bjnum
46
-        ,(select count(*) from t_user u where u.schoolid=c.schoolid and u.usertype=1 and u.userstate=1)jsnum
47
-        ,sum((select count(distinct cs.studentid) from t_class_student cs where cs.classid=c.classid))xsnum
48
-        from t_school s right join t_class c on s.schoolid=c.schoolid
49
-        where s.schoolid=#{schoolid} and c.classstate=1 and c.year=s.year and c.classtype=1
50
-    </select>
43
+    <!--获取班级、教师、学生总量-->
51 44
     <select id="listClassTeacherStudent" resultType="java.util.Map">
52 45
         select c.classid,c.classname,c.gradeid,c.classorder,tu.userid teacherid,cs.studentid,ifnull(u.usersex,0)usersex
53
-        from t_school s right join t_class c on s.schoolid=c.schoolid
54
-        left join t_class_teacher ct on c.classid=ct.classid
46
+        from t_class c left join t_class_teacher ct on c.classid=ct.classid
55 47
         left join t_user tu on ct.teacherid=tu.userid and tu.usertype=1 and tu.userstate=1
56 48
         left join t_class_student cs on c.classid=cs.classid
57 49
         left join t_user u on cs.studentid=u.userid
58
-        where s.schoolid=#{schoolid} and c.classstate=1 and c.year=s.year and c.classtype=1
50
+        where c.schoolid=#{param.schoolid} and c.classstate=1 and c.year=#{param.year} and c.classtype=1
59 51
     </select>
60 52
     <!--访问量统计-->
61 53
     <select id="listAccess" resultType="com.xhkjedu.sapi.vo.region.AccessVo">
@@ -80,7 +72,8 @@
80 72
         left join t_subject s on p.subjectid=s.subjectid
81 73
         left join t_class c on pg.classid=c.classid
82 74
         left join t_paper_student ps on ps.paperid=pg.paperid
83
-        where c.year=#{year} and p.schoolid=#{schoolid} and pg.pgstate=22 and pg.starttime between #{begintime} and #{endtime}
75
+        where c.year=#{param.year} and p.schoolid=#{param.schoolid} and pg.pgstate=22
76
+        and pg.starttime between #{param.begintime} and #{param.endtime}
84 77
         group by c.gradeid,p.subjectid
85 78
     </select>
86 79
     <!--预习-->
@@ -90,7 +83,8 @@
90 83
         from t_guide g left join t_subject s on g.subjectid=s.subjectid
91 84
         left join t_guide_group_student gs on gs.guideid=g.guideid
92 85
         left join t_class c on gs.classid=c.classid
93
-        where c.year=#{year} and g.schoolid=#{schoolid} and g.createtime between #{begintime} and #{endtime}
86
+        where c.year=#{param.year} and g.schoolid=#{param.schoolid}
87
+        and g.createtime between #{param.begintime} and #{param.endtime}
94 88
         group by c.gradeid,g.subjectid
95 89
     </select>
96 90
 
@@ -98,7 +92,8 @@
98 92
     <select id="listRoomNumMonth" resultType="com.xhkjedu.sapi.vo.region.SWorkVo">
99 93
         select s.classid,s.classname,s.gradeid,count(c.roomid) num from t_classroom c
100 94
         left join t_class s on c.classid=s.classid
101
-        where c.schoolid=#{schoolid} and s.year=#{year} and c.createtime between #{begintime} and #{endtime}
95
+        where c.schoolid=#{param.schoolid} and s.year=#{param.year}
96
+        and c.createtime between #{param.begintime} and #{param.endtime}
102 97
         group by c.classid order by s.gradeid,s.classorder
103 98
     </select>
104 99
 
@@ -109,9 +104,10 @@
109 104
         ,sum(case when ca.asktype =40 then 1 else 0 end)tcnum
110 105
         ,sum(case when ca.asktype =21 then 1 else 0 end)dmnum
111 106
         ,sum(case when ca.asktype =20 then 1 else 0 end)qdnum
112
-        from t_classroom c left join t_class s on c.classid=s.classid and c.createtime between #{begintime} and #{endtime}
107
+        from t_classroom c left join t_class s on c.classid=s.classid
113 108
         left join t_classroom_askteacher ca on ca.roomid=c.roomid
114
-        where c.schoolid=#{schoolid} and s.year=#{year} and c.createtime between #{begintime} and #{endtime}
109
+        where c.schoolid=#{param.schoolid} and s.year=#{param.year}
110
+        and c.createtime between #{param.begintime} and #{param.endtime}
115 111
         group by c.classid order by s.gradeid,s.classorder
116 112
     </select>
117 113
 </mapper>

+ 4
- 0
sapi/src/main/resources/mapper/system/SchoolMapper.xml Visa fil

@@ -108,4 +108,8 @@
108 108
     <select id="listYear" resultType="java.lang.Integer">
109 109
         select c.year from t_class c where c.schoolid=#{schoolid} and c.classtype=1 and c.classstate=1 group by c.year
110 110
     </select>
111
+    <!--获取区域学年列表-->
112
+    <select id="listCloudYear" resultType="java.lang.Integer">
113
+        select c.year from t_class c where c.classtype=1 and c.classstate=1 group by c.year
114
+    </select>
111 115
 </mapper>

Laddar…
Avbryt
Spara