Browse Source

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

tags/正式版本
雍文秀 2 years ago
parent
commit
8e7bc7f153
21 changed files with 298 additions and 195 deletions
  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 View File

30
         Integer endtime = param.getEndtime();
30
         Integer endtime = param.getEndtime();
31
         Integer level = param.getLevel();
31
         Integer level = param.getLevel();
32
         N_Utils.validation(new Object[]{level,"学段",1,begintime,"开始时间",1,endtime,"结束时间",1});
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
         return new ResultVo(0,"获取课堂统计成功",map);
34
         return new ResultVo(0,"获取课堂统计成功",map);
35
     }
35
     }
36
 }
36
 }

+ 4
- 4
sapi/src/main/java/com/xhkjedu/sapi/controller/region/RSchoolAnalyzeController.java View File

25
     private RSchoolAnalyzeService rSchoolAnalyzeService;
25
     private RSchoolAnalyzeService rSchoolAnalyzeService;
26
 
26
 
27
     @PostMapping("/list_school")
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
         return new ResultVo(0,"获取学校列表成功",map);
30
         return new ResultVo(0,"获取学校列表成功",map);
31
     }
31
     }
32
 
32
 
37
     }
37
     }
38
 
38
 
39
     @PostMapping("/list_stu")
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
         return new ResultVo(0,"获取学生列表成功",map);
42
         return new ResultVo(0,"获取学生列表成功",map);
43
     }
43
     }
44
 
44
 

+ 9
- 9
sapi/src/main/java/com/xhkjedu/sapi/controller/region/RegionAnalyzeController.java View File

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

+ 5
- 5
sapi/src/main/java/com/xhkjedu/sapi/controller/region/SAnalyzeController.java View File

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

+ 13
- 0
sapi/src/main/java/com/xhkjedu/sapi/controller/system/SchoolController.java View File

188
         List<Integer> list = schoolService.listYear(schoolid);
188
         List<Integer> list = schoolService.listYear(schoolid);
189
         return new ResultVo(0, "获取列表成功", list);
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 View File

1
 package com.xhkjedu.sapi.mapper.region;
1
 package com.xhkjedu.sapi.mapper.region;
2
 
2
 
3
 import com.xhkjedu.sapi.vo.region.RRoomVo;
3
 import com.xhkjedu.sapi.vo.region.RRoomVo;
4
+import com.xhkjedu.sapi.vo.region.RegionParam;
4
 import org.apache.ibatis.annotations.Param;
5
 import org.apache.ibatis.annotations.Param;
5
 import org.springframework.stereotype.Repository;
6
 import org.springframework.stereotype.Repository;
6
 
7
 
8
 
9
 
9
 @Repository
10
 @Repository
10
 public interface RRoomAnalyzeMapper {
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 View File

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

+ 11
- 15
sapi/src/main/java/com/xhkjedu/sapi/mapper/region/RegionAnalyzeMapper.java View File

1
 package com.xhkjedu.sapi.mapper.region;
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
 import org.springframework.stereotype.Repository;
5
 import org.springframework.stereotype.Repository;
8
 
6
 
9
 import java.util.List;
7
 import java.util.List;
29
     List<RSubjectVo> listQuestionSubjectNum();
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 View File

1
 package com.xhkjedu.sapi.mapper.region;
1
 package com.xhkjedu.sapi.mapper.region;
2
 
2
 
3
+import com.xhkjedu.sapi.vo.analyze.SchoolParams;
3
 import com.xhkjedu.sapi.vo.region.AccessVo;
4
 import com.xhkjedu.sapi.vo.region.AccessVo;
5
+import com.xhkjedu.sapi.vo.region.RegionParam;
4
 import com.xhkjedu.sapi.vo.region.ResourceTypeVo;
6
 import com.xhkjedu.sapi.vo.region.ResourceTypeVo;
5
 import com.xhkjedu.sapi.vo.region.SWorkVo;
7
 import com.xhkjedu.sapi.vo.region.SWorkVo;
6
 import org.apache.ibatis.annotations.Param;
8
 import org.apache.ibatis.annotations.Param;
30
     List<ResourceTypeVo> listResourceSubjectNum(Integer schoolid);
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
     List<AccessVo> listAccess(Integer schoolid, Integer begintime, Integer endtime);
37
     List<AccessVo> listAccess(Integer schoolid, Integer begintime, Integer endtime);
37
 
38
 
38
     //近一个月应用监控统计
39
     //近一个月应用监控统计
39
     List<AccessVo> listAppMonitorMonth(Integer schoolid, Integer begintime, Integer endtime);
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 View File

63
 
63
 
64
     //获取学年列表
64
     //获取学年列表
65
     List<Integer> listYear(@Param("schoolid") Integer schoolid);
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 View File

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

+ 7
- 5
sapi/src/main/java/com/xhkjedu/sapi/service/region/RSchoolAnalyzeService.java View File

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

+ 17
- 61
sapi/src/main/java/com/xhkjedu/sapi/service/region/RegionAnalyzeService.java View File

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
         Map map = new HashMap();
184
         Map map = new HashMap();
185
 
185
 
186
         if (works != null && works.size() > 0) {
186
         if (works != null && works.size() > 0) {
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
         List<WorkRtnVo> rtnmap = new ArrayList<>();
212
         List<WorkRtnVo> rtnmap = new ArrayList<>();
213
         boolean noexist = false;
213
         boolean noexist = false;
214
 
214
 
215
         //作业
215
         //作业
216
-        List<WorkVo> papers = regionAnalyzeMapper.listPaperCommitMonth(begintime, endtime);
216
+        List<WorkVo> papers = regionAnalyzeMapper.listPaperCommitMonth(param);
217
         if (N_Utils.isListNotEmpty(papers)) {
217
         if (N_Utils.isListNotEmpty(papers)) {
218
             for (WorkVo w : papers) {
218
             for (WorkVo w : papers) {
219
                 List<WorkDetailVo> detials = w.getDetails();
219
                 List<WorkDetailVo> detials = w.getDetails();
238
             }
238
             }
239
         }
239
         }
240
         //课堂考勤
240
         //课堂考勤
241
-        List<Map> rooms = regionAnalyzeMapper.listRoomCommitMonth(begintime, endtime);
241
+        List<Map> rooms = regionAnalyzeMapper.listRoomCommitMonth(param);
242
         if (N_Utils.isListNotEmpty(rooms)) {
242
         if (N_Utils.isListNotEmpty(rooms)) {
243
             for (Map map : rooms) {
243
             for (Map map : rooms) {
244
                 Integer stunum = Integer.parseInt(map.get("stunum").toString());
244
                 Integer stunum = Integer.parseInt(map.get("stunum").toString());
262
             }
262
             }
263
         }
263
         }
264
         //预习
264
         //预习
265
-        List<WorkVo> guides = regionAnalyzeMapper.listGuideCommitMonth(begintime, endtime);
265
+        List<WorkVo> guides = regionAnalyzeMapper.listGuideCommitMonth(param);
266
         if (N_Utils.isListNotEmpty(guides)) {
266
         if (N_Utils.isListNotEmpty(guides)) {
267
             for (WorkVo w : guides) {
267
             for (WorkVo w : guides) {
268
                 List<WorkDetailVo> detials = w.getDetails();
268
                 List<WorkDetailVo> detials = w.getDetails();
286
             }
286
             }
287
         }
287
         }
288
         //背诵
288
         //背诵
289
-        List<WorkVo> recites = regionAnalyzeMapper.listReciteCommitMonth(begintime, endtime);
289
+        List<WorkVo> recites = regionAnalyzeMapper.listReciteCommitMonth(param);
290
         if (N_Utils.isListNotEmpty(recites)) {
290
         if (N_Utils.isListNotEmpty(recites)) {
291
             for (WorkVo w : recites) {
291
             for (WorkVo w : recites) {
292
                 List<WorkDetailVo> detials = w.getDetails();
292
                 List<WorkDetailVo> detials = w.getDetails();
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
         Map map = new HashMap();
330
         Map map = new HashMap();
331
         if (papers != null && papers.size() > 0) {
331
         if (papers != null && papers.size() > 0) {
347
     }
347
     }
348
 
348
 
349
     //近一个月课堂使用情况统计——使用次数
349
     //近一个月课堂使用情况统计——使用次数
350
-    public Map listRoomNumMonth(Integer begintime, Integer endtime) {
350
+    public Map listRoomNumMonth(RegionParam param) {
351
         Map map = new HashMap();
351
         Map map = new HashMap();
352
 
352
 
353
-        List<WorkVo> rooms = regionAnalyzeMapper.listRoomNumMonth(begintime, endtime);
353
+        List<WorkVo> rooms = regionAnalyzeMapper.listRoomNumMonth(param);
354
         if (rooms != null && rooms.size() > 0) {
354
         if (rooms != null && rooms.size() > 0) {
355
             //最大数量对象
355
             //最大数量对象
356
             WorkVo maxnum = rooms.stream().max(Comparator.comparing(WorkVo::getNum)).get();
356
             WorkVo maxnum = rooms.stream().max(Comparator.comparing(WorkVo::getNum)).get();
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 View File

1
 package com.xhkjedu.sapi.service.region;
1
 package com.xhkjedu.sapi.service.region;
2
 
2
 
3
-import com.xhkjedu.sapi.mapper.system.SchoolMapper;
4
 import com.xhkjedu.sapi.mapper.region.SAnalyzeMapper;
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
 import com.xhkjedu.utils.N_Utils;
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
 import org.springframework.stereotype.Service;
8
 import org.springframework.stereotype.Service;
11
 
9
 
12
 import javax.annotation.Resource;
10
 import javax.annotation.Resource;
99
     }
97
     }
100
 
98
 
101
     //获取班级、教师、学生总量
99
     //获取班级、教师、学生总量
102
-    public Map listClassTeacherStudentNum(Integer schoolid) {
100
+    public Map listClassTeacherStudentNum(SchoolParams param) {
103
 //        Map map = sAnalyzeMapper.listClassTeacherStudentNum(schoolid);
101
 //        Map map = sAnalyzeMapper.listClassTeacherStudentNum(schoolid);
104
         Map map = new HashMap();
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
         Map<Integer,List<Map>> grades = list.stream().collect(Collectors.groupingBy(m->(Integer) m.get("gradeid")));
107
         Map<Integer,List<Map>> grades = list.stream().collect(Collectors.groupingBy(m->(Integer) m.get("gradeid")));
107
         grades = grades.entrySet().stream().sorted(Map.Entry.comparingByKey())
108
         grades = grades.entrySet().stream().sorted(Map.Entry.comparingByKey())
108
                 .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (c1, c2) -> c1, LinkedHashMap::new));
109
                 .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (c1, c2) -> c1, LinkedHashMap::new));
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
         return getPaperGuide(works);
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
         return getPaperGuide(works);
249
         return getPaperGuide(works);
245
     }
250
     }
246
 
251
 
269
     }
274
     }
270
 
275
 
271
     //近一个月课堂使用情况统计——使用次数
276
     //近一个月课堂使用情况统计——使用次数
272
-    public Map listRoomNumMonth(Integer schoolid, Integer begintime, Integer endtime) {
277
+    public Map listRoomNumMonth(RegionParam param) {
273
         Map map = new HashMap();
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
         if (rooms != null && rooms.size() > 0) {
284
         if (rooms != null && rooms.size() > 0) {
278
             //最大数量对象
285
             //最大数量对象
279
             SWorkVo maxnum = rooms.stream().max(Comparator.comparing(SWorkVo::getNum)).get();
286
             SWorkVo maxnum = rooms.stream().max(Comparator.comparing(SWorkVo::getNum)).get();
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 View File

521
     public List<Integer> listYear(Integer schoolid) {
521
     public List<Integer> listYear(Integer schoolid) {
522
         return schoolMapper.listYear(schoolid);
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 View File

7
       select count(DISTINCT pg.paperid) from t_paper_group pg left join t_paper p on pg.paperid=p.paperid
7
       select count(DISTINCT pg.paperid) from t_paper_group pg left join t_paper p on pg.paperid=p.paperid
8
         LEFT JOIN t_school s on p.schoolid=s.schoolid
8
         LEFT JOIN t_school s on p.schoolid=s.schoolid
9
         left join t_class c on c.classid=pg.classid
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
     </select>
17
     </select>
12
     <!--作业数量统计——预习数量-->
18
     <!--作业数量统计——预习数量-->
13
     <select id="getRegionPaperNumPreview" resultType="java.lang.Integer">
19
     <select id="getRegionPaperNumPreview" resultType="java.lang.Integer">
14
         select count(DISTINCT g.guideid) from t_guide_group gg left join t_guide g on gg.guideid=g.guideid
20
         select count(DISTINCT g.guideid) from t_guide_group gg left join t_guide g on gg.guideid=g.guideid
15
         LEFT JOIN t_school s on g.schoolid=s.schoolid
21
         LEFT JOIN t_school s on g.schoolid=s.schoolid
16
         left join t_class c on c.classid=gg.classid
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
     </select>
30
     </select>
19
     <!--作业数量统计——背诵数量-->
31
     <!--作业数量统计——背诵数量-->
20
     <select id="getRegionPaperNumRecite" resultType="java.lang.Integer">
32
     <select id="getRegionPaperNumRecite" resultType="java.lang.Integer">
21
        select count(DISTINCT rg.reciteid) from t_recite_group rg left join t_recite r on rg.reciteid=r.reciteid
33
        select count(DISTINCT rg.reciteid) from t_recite_group rg left join t_recite r on rg.reciteid=r.reciteid
22
         LEFT JOIN t_school s on r.schoolid=s.schoolid
34
         LEFT JOIN t_school s on r.schoolid=s.schoolid
23
         left join t_class c on c.classid=rg.classid
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
     </select>
43
     </select>
26
     <!--作业数量统计——错题视频数量-->
44
     <!--作业数量统计——错题视频数量-->
27
     <select id="getRegionPaperNumQueexp" resultType="java.lang.Integer">
45
     <select id="getRegionPaperNumQueexp" resultType="java.lang.Integer">
28
        select count(distinct qe.qcpid) from t_question_explain qe left join t_question_class qc on qe.questionid=qe.questionid
46
        select count(distinct qe.qcpid) from t_question_explain qe left join t_question_class qc on qe.questionid=qe.questionid
29
       left JOIN t_school s on qc.schoolid=s.schoolid
47
       left JOIN t_school s on qc.schoolid=s.schoolid
30
       left join t_class c on c.classid=qc.classid
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
     </select>
56
     </select>
33
 
57
 
34
     <!--作业各类率统计-->
58
     <!--作业各类率统计-->
59
         left join t_paper_student ps on ps.paperid=p.paperid and ps.classid=pg.classid
83
         left join t_paper_student ps on ps.paperid=p.paperid and ps.classid=pg.classid
60
         left join t_school s on p.schoolid=s.schoolid
84
         left join t_school s on p.schoolid=s.schoolid
61
         left join t_class c on c.classid=pg.classid
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
         group by p.schoolid,p.paperid order by p.schoolid
93
         group by p.schoolid,p.paperid order by p.schoolid
64
     </select>
94
     </select>
65
     <!--作业各类率统计——背诵-->
95
     <!--作业各类率统计——背诵-->
72
         left join t_recite_student rs on rs.reciteid=r.reciteid and rs.classid=rg.classid
102
         left join t_recite_student rs on rs.reciteid=r.reciteid and rs.classid=rg.classid
73
         left join t_school s on r.schoolid=s.schoolid
103
         left join t_school s on r.schoolid=s.schoolid
74
         left join t_class c on c.classid=rg.classid
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
         group by r.schoolid,r.reciteid order by r.schoolid
112
         group by r.schoolid,r.reciteid order by r.schoolid
77
     </select>
113
     </select>
78
     <!--作业各类率统计——预习-->
114
     <!--作业各类率统计——预习-->
85
         left join t_guide_group_student ggs on ggs.guideid=g.guideid and ggs.classid=gg.classid
121
         left join t_guide_group_student ggs on ggs.guideid=g.guideid and ggs.classid=gg.classid
86
         left join t_school s on s.schoolid=g.schoolid
122
         left join t_school s on s.schoolid=g.schoolid
87
         left join t_class c on c.classid=gg.classid
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
         group by s.schoolid, g.guideid order by s.schoolid
131
         group by s.schoolid, g.guideid order by s.schoolid
90
     </select>
132
     </select>
91
 
133
 
97
          from t_paper_student ps
139
          from t_paper_student ps
98
         left join t_school s on ps.schoolid=s.schoolid
140
         left join t_school s on ps.schoolid=s.schoolid
99
         left join t_class c on c.classid=ps.classid
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
         group by ps.schoolid order by ps.schoolid
149
         group by ps.schoolid order by ps.schoolid
102
     </select>
150
     </select>
103
     <!--人均用时——预习-->
151
     <!--人均用时——预习-->
109
         left join t_guide g on gs.guideid=g.guideid
157
         left join t_guide g on gs.guideid=g.guideid
110
         left join t_school s on g.schoolid=s.schoolid
158
         left join t_school s on g.schoolid=s.schoolid
111
         left join t_class c on c.classid=gs.classid
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
         group by s.schoolid order by s.schoolid
167
         group by s.schoolid order by s.schoolid
114
     </select>
168
     </select>
115
 
169
 

+ 8
- 9
sapi/src/main/resources/mapper/region/RRoomAnalyzeMapper.xml View File

24
         left join t_classroom_paper p on p.paperid=rt.paperid
24
         left join t_classroom_paper p on p.paperid=rt.paperid
25
         left join t_classroom_paper_student ps on p.paperid=ps.paperid
25
         left join t_classroom_paper_student ps on p.paperid=ps.paperid
26
         left join t_classroom_paper_student_scantron pss on ps.psid=pss.psid
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
         group by r.roomid
35
         group by r.roomid
30
     </select>
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
 </mapper>
37
 </mapper>

+ 14
- 2
sapi/src/main/resources/mapper/region/RSchoolAnalyzeMapper.xml View File

6
         select s.schoollevel,s.schoolname,s.shortname,s.coordinate,count(c.classid)bjnum
6
         select s.schoollevel,s.schoolname,s.shortname,s.coordinate,count(c.classid)bjnum
7
         ,(select count(*) from t_user u where u.schoolid=c.schoolid and u.usertype=1 and u.userstate=1)jsnum
7
         ,(select count(*) from t_user u where u.schoolid=c.schoolid and u.usertype=1 and u.userstate=1)jsnum
8
         ,sum((select count(distinct cs.studentid) from t_class_student cs where cs.classid=c.classid))xsnum
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
         where s.schoolstate=1 group by s.schoolid order by s.schoollevel,s.schoolid
16
         where s.schoolstate=1 group by s.schoolid order by s.schoollevel,s.schoolid
11
     </select>
17
     </select>
12
     <!--教师性别统计-->
18
     <!--教师性别统计-->
31
         from t_class_student cs left join t_user u on cs.studentid=u.userid
37
         from t_class_student cs left join t_user u on cs.studentid=u.userid
32
         left join t_class c on cs.classid=c.classid
38
         left join t_class c on cs.classid=c.classid
33
         left join t_school s on c.schoolid=s.schoolid
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
     </select>
47
     </select>
36
     <!--活跃度统计-->
48
     <!--活跃度统计-->
37
     <select id="listAccess" resultType="java.util.Map">
49
     <select id="listAccess" resultType="java.util.Map">

+ 77
- 24
sapi/src/main/resources/mapper/region/RegionAnalyzeMapper.xml View File

36
         ,(select cloudmap from t_cloud limit 1)cloudmap
36
         ,(select cloudmap from t_cloud limit 1)cloudmap
37
         ,(select count(*) from t_user u where u.schoolid=c.schoolid and u.usertype=1 and u.userstate=1)jsnum
37
         ,(select count(*) from t_user u where u.schoolid=c.schoolid and u.usertype=1 and u.userstate=1)jsnum
38
         ,sum((select count(distinct cs.studentid) from t_class_student cs where cs.classid=c.classid))xsnum
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
         where s.schoolstate=1
46
         where s.schoolstate=1
41
         group by s.schoolid order by s.schoolid
47
         group by s.schoolid order by s.schoolid
42
     </select>
48
     </select>
46
         ,(select count(*) from t_user u where u.schoolid=c.schoolid and u.usertype=1 and u.userstate=1)jsnum
52
         ,(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
53
         ,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
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
         group by s.schoollevel
62
         group by s.schoollevel
51
     </select>
63
     </select>
52
 
64
 
70
         count(distinct case when ps.psstate!=0 then ps.psid else null end)commitnum,
82
         count(distinct case when ps.psstate!=0 then ps.psid else null end)commitnum,
71
         count(distinct case when ps.psstate!=0 and ps.pschecked=1 then ps.psid else null end)checknum
83
         count(distinct case when ps.psstate!=0 and ps.pschecked=1 then ps.psid else null end)checknum
72
         from t_paper_group pg
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
         left join t_paper_student ps on ps.paperid=pg.paperid
87
         left join t_paper_student ps on ps.paperid=pg.paperid
75
         left join t_class c on c.classid=pg.classid
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
         group by s.schoolid,pg.paperid order by s.schoolid
96
         group by s.schoolid,pg.paperid order by s.schoolid
78
     </select>
97
     </select>
79
     <!--预习-->
98
     <!--预习-->
81
         select s.schoolid,s.schoolname,s.shortname,g.guideid as rid,
100
         select s.schoolid,s.schoolname,s.shortname,g.guideid as rid,
82
         count(distinct gs.rgsid) stunum,
101
         count(distinct gs.rgsid) stunum,
83
         count(distinct case when gs.readtime>0 then gs.rgsid else null end) commitnum
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
         left join t_guide_group_student gs on gs.guideid=g.guideid
105
         left join t_guide_group_student gs on gs.guideid=g.guideid
86
         left join t_class c on c.classid=gs.classid
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
         group by s.schoolid,g.guideid order by g.schoolid
114
         group by s.schoolid,g.guideid order by g.schoolid
89
     </select>
115
     </select>
90
 
116
 
93
         select s.schoolid,s.schoolname,s.shortname,rg.reciteid as wid,
119
         select s.schoolid,s.schoolname,s.shortname,rg.reciteid as wid,
94
         count(distinct rs.rsid) stunum,
120
         count(distinct rs.rsid) stunum,
95
         count(distinct case when rs.rsstate!=0 then rs.rsid else null end) commitnum
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
         left join t_recite_student rs on rs.reciteid=rg.reciteid and rs.classid=rg.classid
124
         left join t_recite_student rs on rs.reciteid=rg.reciteid and rs.classid=rg.classid
98
         left join t_class c on c.classid=rg.classid
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
         group by s.schoolid,rg.reciteid order by s.schoolid
133
         group by s.schoolid,rg.reciteid order by s.schoolid
101
     </select>
134
     </select>
102
     <!--课堂出勤率-->
135
     <!--课堂出勤率-->
103
     <select id="listRoomCommitMonth" resultType="java.util.Map">
136
     <select id="listRoomCommitMonth" resultType="java.util.Map">
104
         select s.schoolid,s.schoolname,s.shortname,ifnull(SUM(c.classnum),0) stunum,ifnull(SUM(c.realstunum),0) commitnum
137
         select s.schoolid,s.schoolname,s.shortname,ifnull(SUM(c.classnum),0) stunum,ifnull(SUM(c.realstunum),0) commitnum
105
         from t_classroom c left join t_class c2 on c.classid=c2.classid
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
         group by s.schoolid order by s.schoolid
148
         group by s.schoolid order by s.schoolid
109
     </select>
149
     </select>
110
 
150
 
112
     <select id="listPapernumMonth" resultType="com.xhkjedu.sapi.vo.region.WorkVo">
152
     <select id="listPapernumMonth" resultType="com.xhkjedu.sapi.vo.region.WorkVo">
113
         select s.schoolid,s.schoolname,s.shortname,count(distinct pg.paperid) num
153
         select s.schoolid,s.schoolname,s.shortname,count(distinct pg.paperid) num
114
         from t_paper_group pg left join t_class c on c.classid=pg.classid
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
         group by s.schoolid order by s.schoolid
164
         group by s.schoolid order by s.schoolid
118
 
165
 
119
     </select>
166
     </select>
121
     <!--课堂使用情况统计——使用次数-->
168
     <!--课堂使用情况统计——使用次数-->
122
     <select id="listRoomNumMonth" resultType="com.xhkjedu.sapi.vo.region.WorkVo">
169
     <select id="listRoomNumMonth" resultType="com.xhkjedu.sapi.vo.region.WorkVo">
123
         select s.schoolid,s.schoolname,s.shortname,count(c.roomid) num from t_classroom c
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
         left join t_class c2 on c.classid=c2.classid
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
         group by s.schoolid order by s.schoolid
181
         group by s.schoolid order by s.schoolid
128
     </select>
182
     </select>
129
     <resultMap id="roomAsk" type="com.xhkjedu.sapi.vo.region.WorkVo">
183
     <resultMap id="roomAsk" type="com.xhkjedu.sapi.vo.region.WorkVo">
137
     </resultMap>
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
     <select id="listRoomAskNumMonth2" resultType="java.util.Map">
194
     <select id="listRoomAskNumMonth2" resultType="java.util.Map">
149
         select s.schoolname,s.shortname,count(distinct c.roomid)num
195
         select s.schoolname,s.shortname,count(distinct c.roomid)num
150
         ,sum(case when ca.asktype between 30 and 33 then 1 else 0 end)twnum
196
         ,sum(case when ca.asktype between 30 and 33 then 1 else 0 end)twnum
151
         ,sum(case when ca.asktype =40 then 1 else 0 end)tcnum
197
         ,sum(case when ca.asktype =40 then 1 else 0 end)tcnum
152
         ,sum(case when ca.asktype =21 then 1 else 0 end)dmnum
198
         ,sum(case when ca.asktype =21 then 1 else 0 end)dmnum
153
         ,sum(case when ca.asktype =20 then 1 else 0 end)qdnum
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
         left join t_classroom_askteacher ca on ca.roomid=c.roomid
202
         left join t_classroom_askteacher ca on ca.roomid=c.roomid
156
         left join t_class c2 on c.classid=c2.classid
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
         group by s.schoolid order by s.schoolid
211
         group by s.schoolid order by s.schoolid
159
     </select>
212
     </select>
160
 </mapper>
213
 </mapper>

+ 12
- 16
sapi/src/main/resources/mapper/region/SAnalyzeMapper.xml View File

40
         and ts.schoolid=#{schoolid}
40
         and ts.schoolid=#{schoolid}
41
         group by r.subjectid order by s.subjectorder
41
         group by r.subjectid order by s.subjectorder
42
     </select>
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
     <select id="listClassTeacherStudent" resultType="java.util.Map">
44
     <select id="listClassTeacherStudent" resultType="java.util.Map">
52
         select c.classid,c.classname,c.gradeid,c.classorder,tu.userid teacherid,cs.studentid,ifnull(u.usersex,0)usersex
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
         left join t_user tu on ct.teacherid=tu.userid and tu.usertype=1 and tu.userstate=1
47
         left join t_user tu on ct.teacherid=tu.userid and tu.usertype=1 and tu.userstate=1
56
         left join t_class_student cs on c.classid=cs.classid
48
         left join t_class_student cs on c.classid=cs.classid
57
         left join t_user u on cs.studentid=u.userid
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
     </select>
51
     </select>
60
     <!--访问量统计-->
52
     <!--访问量统计-->
61
     <select id="listAccess" resultType="com.xhkjedu.sapi.vo.region.AccessVo">
53
     <select id="listAccess" resultType="com.xhkjedu.sapi.vo.region.AccessVo">
80
         left join t_subject s on p.subjectid=s.subjectid
72
         left join t_subject s on p.subjectid=s.subjectid
81
         left join t_class c on pg.classid=c.classid
73
         left join t_class c on pg.classid=c.classid
82
         left join t_paper_student ps on ps.paperid=pg.paperid
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
         group by c.gradeid,p.subjectid
77
         group by c.gradeid,p.subjectid
85
     </select>
78
     </select>
86
     <!--预习-->
79
     <!--预习-->
90
         from t_guide g left join t_subject s on g.subjectid=s.subjectid
83
         from t_guide g left join t_subject s on g.subjectid=s.subjectid
91
         left join t_guide_group_student gs on gs.guideid=g.guideid
84
         left join t_guide_group_student gs on gs.guideid=g.guideid
92
         left join t_class c on gs.classid=c.classid
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
         group by c.gradeid,g.subjectid
88
         group by c.gradeid,g.subjectid
95
     </select>
89
     </select>
96
 
90
 
98
     <select id="listRoomNumMonth" resultType="com.xhkjedu.sapi.vo.region.SWorkVo">
92
     <select id="listRoomNumMonth" resultType="com.xhkjedu.sapi.vo.region.SWorkVo">
99
         select s.classid,s.classname,s.gradeid,count(c.roomid) num from t_classroom c
93
         select s.classid,s.classname,s.gradeid,count(c.roomid) num from t_classroom c
100
         left join t_class s on c.classid=s.classid
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
         group by c.classid order by s.gradeid,s.classorder
97
         group by c.classid order by s.gradeid,s.classorder
103
     </select>
98
     </select>
104
 
99
 
109
         ,sum(case when ca.asktype =40 then 1 else 0 end)tcnum
104
         ,sum(case when ca.asktype =40 then 1 else 0 end)tcnum
110
         ,sum(case when ca.asktype =21 then 1 else 0 end)dmnum
105
         ,sum(case when ca.asktype =21 then 1 else 0 end)dmnum
111
         ,sum(case when ca.asktype =20 then 1 else 0 end)qdnum
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
         left join t_classroom_askteacher ca on ca.roomid=c.roomid
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
         group by c.classid order by s.gradeid,s.classorder
111
         group by c.classid order by s.gradeid,s.classorder
116
     </select>
112
     </select>
117
 </mapper>
113
 </mapper>

+ 4
- 0
sapi/src/main/resources/mapper/system/SchoolMapper.xml View File

108
     <select id="listYear" resultType="java.lang.Integer">
108
     <select id="listYear" resultType="java.lang.Integer">
109
         select c.year from t_class c where c.schoolid=#{schoolid} and c.classtype=1 and c.classstate=1 group by c.year
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
     </select>
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
 </mapper>
115
 </mapper>

Loading…
Cancel
Save