Browse Source

区域统计学年搜索

tags/正式版本
雍文秀 2 years ago
parent
commit
b5e0d9e348

+ 1
- 1
sapi/src/main/java/com/xhkjedu/sapi/controller/region/RAppAnalyzeController.java View File

29
         Integer begintime = param.getBegintime();
29
         Integer begintime = param.getBegintime();
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});
33
         Map map = rAppAnalyzeService.listApp(level,begintime, endtime);
33
         Map map = rAppAnalyzeService.listApp(level,begintime, endtime);
34
         return new ResultVo(0,"获取应用统计成功",map);
34
         return new ResultVo(0,"获取应用统计成功",map);
35
     }
35
     }

+ 6
- 18
sapi/src/main/java/com/xhkjedu/sapi/controller/region/RPaperAnalyzeController.java View File

28
     //作业试题统计
28
     //作业试题统计
29
     @PostMapping("/pnum")
29
     @PostMapping("/pnum")
30
     public ResultVo getResourceQuestionNum(@RequestBody RegionParam param){
30
     public ResultVo getResourceQuestionNum(@RequestBody RegionParam param){
31
-        Integer begintime = param.getBegintime();
32
-        Integer endtime = param.getEndtime();
33
         Integer level = param.getLevel();
31
         Integer level = param.getLevel();
34
-        N_Utils.validation(new Object[]{level,"学段",1,begintime,"开始时间",1,endtime,"结束时间",1});
32
+        N_Utils.validation(new Object[]{level,"学段",1});
35
         Map map = rPaperAnalyzeService.getRegionPaperNum(param);
33
         Map map = rPaperAnalyzeService.getRegionPaperNum(param);
36
         return new ResultVo(0,"获取作业数量统计成功",map);
34
         return new ResultVo(0,"获取作业数量统计成功",map);
37
     }
35
     }
39
     //作业率统计--作业
37
     //作业率统计--作业
40
     @PostMapping("/ratep")
38
     @PostMapping("/ratep")
41
     public ResultVo listRegionSchoolRatePaper(@RequestBody RegionParam param){
39
     public ResultVo listRegionSchoolRatePaper(@RequestBody RegionParam param){
42
-        Integer begintime = param.getBegintime();
43
-        Integer endtime = param.getEndtime();
44
         Integer level = param.getLevel();
40
         Integer level = param.getLevel();
45
-        N_Utils.validation(new Object[]{level,"学段",1,begintime,"开始时间",1,endtime,"结束时间",1});
41
+        N_Utils.validation(new Object[]{level,"学段",1});
46
         Map map = rPaperAnalyzeService.listRegionSchoolRatePaper(param);
42
         Map map = rPaperAnalyzeService.listRegionSchoolRatePaper(param);
47
         return new ResultVo(0,"获取作业率统计成功",map);
43
         return new ResultVo(0,"获取作业率统计成功",map);
48
     }
44
     }
50
     //作业率统计--背诵
46
     //作业率统计--背诵
51
     @PostMapping("/rater")
47
     @PostMapping("/rater")
52
     public ResultVo listRegionSchoolRateRecite(@RequestBody RegionParam param){
48
     public ResultVo listRegionSchoolRateRecite(@RequestBody RegionParam param){
53
-        Integer begintime = param.getBegintime();
54
-        Integer endtime = param.getEndtime();
55
         Integer level = param.getLevel();
49
         Integer level = param.getLevel();
56
-        N_Utils.validation(new Object[]{level,"学段",1,begintime,"开始时间",1,endtime,"结束时间",1});
50
+        N_Utils.validation(new Object[]{level,"学段",1});
57
         Map map = rPaperAnalyzeService.listRegionSchoolRateRecite(param);
51
         Map map = rPaperAnalyzeService.listRegionSchoolRateRecite(param);
58
         return new ResultVo(0,"获取背诵率统计成功",map);
52
         return new ResultVo(0,"获取背诵率统计成功",map);
59
     }
53
     }
61
     //作业率统计--预习率
55
     //作业率统计--预习率
62
     @PostMapping("/ratepre")
56
     @PostMapping("/ratepre")
63
     public ResultVo getRegionSchoolRatePreview(@RequestBody RegionParam param){
57
     public ResultVo getRegionSchoolRatePreview(@RequestBody RegionParam param){
64
-        Integer begintime = param.getBegintime();
65
-        Integer endtime = param.getEndtime();
66
         Integer level = param.getLevel();
58
         Integer level = param.getLevel();
67
-        N_Utils.validation(new Object[]{level,"学段",1,begintime,"开始时间",1,endtime,"结束时间",1});
59
+        N_Utils.validation(new Object[]{level,"学段",1});
68
         Map map = rPaperAnalyzeService.getRegionSchoolRatePreview(param);
60
         Map map = rPaperAnalyzeService.getRegionSchoolRatePreview(param);
69
         return new ResultVo(0,"获取预习率统计成功",map);
61
         return new ResultVo(0,"获取预习率统计成功",map);
70
     }
62
     }
72
     //人均作业用时
64
     //人均作业用时
73
     @PostMapping("/avgp")
65
     @PostMapping("/avgp")
74
     public ResultVo listRegionSchoolUsetimePaper(@RequestBody RegionParam param){
66
     public ResultVo listRegionSchoolUsetimePaper(@RequestBody RegionParam param){
75
-        Integer begintime = param.getBegintime();
76
-        Integer endtime = param.getEndtime();
77
         Integer level = param.getLevel();
67
         Integer level = param.getLevel();
78
-        N_Utils.validation(new Object[]{level,"学段",1,begintime,"开始时间",1,endtime,"结束时间",1});
68
+        N_Utils.validation(new Object[]{level,"学段",1});
79
         List<Map> lst= rPaperAnalyzeService.listRegionSchoolUsetimePaper(param);
69
         List<Map> lst= rPaperAnalyzeService.listRegionSchoolUsetimePaper(param);
80
         return new ResultVo(0,"获取人均作业用时成功",lst);
70
         return new ResultVo(0,"获取人均作业用时成功",lst);
81
     }
71
     }
82
     //人均预习用时
72
     //人均预习用时
83
     @PostMapping("/avgpre")
73
     @PostMapping("/avgpre")
84
     public ResultVo listRegionSchoolUsetimePreview(@RequestBody RegionParam param){
74
     public ResultVo listRegionSchoolUsetimePreview(@RequestBody RegionParam param){
85
-        Integer begintime = param.getBegintime();
86
-        Integer endtime = param.getEndtime();
87
         Integer level = param.getLevel();
75
         Integer level = param.getLevel();
88
-        N_Utils.validation(new Object[]{level,"学段",1,begintime,"开始时间",1,endtime,"结束时间",1});
76
+        N_Utils.validation(new Object[]{level,"学段",1});
89
         List<Map> lst= rPaperAnalyzeService.listRegionSchoolUsetimePreview(param);
77
         List<Map> lst= rPaperAnalyzeService.listRegionSchoolUsetimePreview(param);
90
         return new ResultVo(0,"获取人均预习用时成功",lst);
78
         return new ResultVo(0,"获取人均预习用时成功",lst);
91
     }
79
     }

+ 1
- 3
sapi/src/main/java/com/xhkjedu/sapi/controller/region/RRoomAnalyzeController.java View File

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

+ 6
- 2
sapi/src/main/resources/mapper/region/RAppAnalyzeMapper.xml View File

6
         select count(ul.ulid)
6
         select count(ul.ulid)
7
         from t_school s right join t_user_log ul on s.schoolid=ul.schoolid
7
         from t_school s right join t_user_log ul on s.schoolid=ul.schoolid
8
         where s.schoollevel=#{level} and s.schoolstate=1
8
         where s.schoollevel=#{level} and s.schoolstate=1
9
-        and ul.logtime between #{begintime} and #{endtime}
9
+        <if test="begintime!=null and begintime!=0">
10
+            and ul.logtime between #{begintime} and #{endtime}
11
+        </if>
10
     </select>
12
     </select>
11
     <!--学校应用时长、次数统计-->
13
     <!--学校应用时长、次数统计-->
12
     <select id="listApp" resultType="com.xhkjedu.sapi.vo.region.RAppVo">
14
     <select id="listApp" resultType="com.xhkjedu.sapi.vo.region.RAppVo">
14
         ,(select m2.modulename from t_moduledefault m2 where m2.mabbrevname=m.modulecode limit 1)modulename
16
         ,(select m2.modulename from t_moduledefault m2 where m2.mabbrevname=m.modulecode limit 1)modulename
15
         from t_school s right join t_app_monitor m on m.schoolid=s.schoolid
17
         from t_school s right join t_app_monitor m on m.schoolid=s.schoolid
16
         where s.schoollevel=#{level} and s.schoolstate=1
18
         where s.schoollevel=#{level} and s.schoolstate=1
17
-        and m.createtime between #{begintime} and #{endtime}
19
+        <if test="begintime!=null and begintime!=0">
20
+            and m.createtime between #{begintime} and #{endtime}
21
+        </if>
18
         group by m.schoolid,m.modulecode
22
         group by m.schoolid,m.modulecode
19
     </select>
23
     </select>
20
 </mapper>
24
 </mapper>

+ 36
- 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 pg.starttime between #{param.begintime} and #{param.endtime}
10
+        where s.schoollevel=#{param.level}
11
+        <if test="param.begintime!=null and param.begintime!=0">
12
+            and pg.starttime between #{param.begintime} and #{param.endtime}
13
+        </if>
11
         <if test="param.year!=null and param.year!=0">
14
         <if test="param.year!=null and param.year!=0">
12
             and c.year=#{param.year}
15
             and c.year=#{param.year}
13
         </if>
16
         </if>
20
         select count(DISTINCT g.guideid) from t_guide_group gg left join t_guide g on gg.guideid=g.guideid
23
         select count(DISTINCT g.guideid) from t_guide_group gg left join t_guide g on gg.guideid=g.guideid
21
         LEFT JOIN t_school s on g.schoolid=s.schoolid
24
         LEFT JOIN t_school s on g.schoolid=s.schoolid
22
         left join t_class c on c.classid=gg.classid
25
         left join t_class c on c.classid=gg.classid
23
-        where s.schoollevel=#{param.level} and g.createtime between #{param.begintime} and #{param.endtime}
26
+        where s.schoollevel=#{param.level}
27
+        <if test="param.begintime!=null and param.begintime!=0">
28
+            and g.createtime between #{param.begintime} and #{param.endtime}
29
+        </if>
24
         <if test="param.year!=null and param.year!=0">
30
         <if test="param.year!=null and param.year!=0">
25
             and c.year=#{param.year}
31
             and c.year=#{param.year}
26
         </if>
32
         </if>
33
        select count(DISTINCT rg.reciteid) from t_recite_group rg left join t_recite r on rg.reciteid=r.reciteid
39
        select count(DISTINCT rg.reciteid) from t_recite_group rg left join t_recite r on rg.reciteid=r.reciteid
34
         LEFT JOIN t_school s on r.schoolid=s.schoolid
40
         LEFT JOIN t_school s on r.schoolid=s.schoolid
35
         left join t_class c on c.classid=rg.classid
41
         left join t_class c on c.classid=rg.classid
36
-        where s.schoollevel=#{param.level} and rg.starttime between #{param.begintime} and #{param.endtime}
42
+        where s.schoollevel=#{param.level}
43
+        <if test="param.begintime!=null and param.begintime!=0">
44
+            and rg.starttime between #{param.begintime} and #{param.endtime}
45
+        </if>
37
         <if test="param.year!=null and param.year!=0">
46
         <if test="param.year!=null and param.year!=0">
38
             and c.year=#{param.year}
47
             and c.year=#{param.year}
39
         </if>
48
         </if>
46
        select count(distinct qe.qcpid) from t_question_explain qe left join t_question_class qc on qe.questionid=qe.questionid
55
        select count(distinct qe.qcpid) from t_question_explain qe left join t_question_class qc on qe.questionid=qe.questionid
47
       left JOIN t_school s on qc.schoolid=s.schoolid
56
       left JOIN t_school s on qc.schoolid=s.schoolid
48
       left join t_class c on c.classid=qc.classid
57
       left join t_class c on c.classid=qc.classid
49
-      where s.schoollevel=#{param.level} and qe.createtime between #{param.begintime} and #{param.endtime}
58
+      where s.schoollevel=#{param.level}
59
+        <if test="param.begintime!=null and param.begintime!=0">
60
+            and qe.createtime between #{param.begintime} and #{param.endtime}
61
+        </if>
50
         <if test="param.year!=null and param.year!=0">
62
         <if test="param.year!=null and param.year!=0">
51
             and c.year=#{param.year}
63
             and c.year=#{param.year}
52
         </if>
64
         </if>
83
         left join t_paper_student ps on ps.paperid=p.paperid and ps.classid=pg.classid
95
         left join t_paper_student ps on ps.paperid=p.paperid and ps.classid=pg.classid
84
         left join t_school s on p.schoolid=s.schoolid
96
         left join t_school s on p.schoolid=s.schoolid
85
         left join t_class c on c.classid=pg.classid
97
         left join t_class c on c.classid=pg.classid
86
-        where s.schoollevel=#{param.level} and pg.starttime between #{param.begintime} and #{param.endtime}
98
+        where s.schoollevel=#{param.level}
99
+        <if test="param.begintime!=null and param.begintime!=0">
100
+            and pg.starttime between #{param.begintime} and #{param.endtime}
101
+        </if>
87
         <if test="param.year!=null and param.year!=0">
102
         <if test="param.year!=null and param.year!=0">
88
             and c.year=#{param.year}
103
             and c.year=#{param.year}
89
         </if>
104
         </if>
102
         left join t_recite_student rs on rs.reciteid=r.reciteid and rs.classid=rg.classid
117
         left join t_recite_student rs on rs.reciteid=r.reciteid and rs.classid=rg.classid
103
         left join t_school s on r.schoolid=s.schoolid
118
         left join t_school s on r.schoolid=s.schoolid
104
         left join t_class c on c.classid=rg.classid
119
         left join t_class c on c.classid=rg.classid
105
-        where s.schoollevel=#{param.level} and rg.starttime between #{param.begintime} and #{param.endtime}
120
+        where s.schoollevel=#{param.level}
121
+        <if test="param.begintime!=null and param.begintime!=0">
122
+            and rg.starttime between #{param.begintime} and #{param.endtime}
123
+        </if>
106
         <if test="param.year!=null and param.year!=0">
124
         <if test="param.year!=null and param.year!=0">
107
             and c.year=#{param.year}
125
             and c.year=#{param.year}
108
         </if>
126
         </if>
121
         left join t_guide_group_student ggs on ggs.guideid=g.guideid and ggs.classid=gg.classid
139
         left join t_guide_group_student ggs on ggs.guideid=g.guideid and ggs.classid=gg.classid
122
         left join t_school s on s.schoolid=g.schoolid
140
         left join t_school s on s.schoolid=g.schoolid
123
         left join t_class c on c.classid=gg.classid
141
         left join t_class c on c.classid=gg.classid
124
-        where s.schoollevel=#{param.level} and g.createtime between #{param.begintime} and #{param.endtime}
142
+        where s.schoollevel=#{param.level}
143
+        <if test="param.begintime!=null and param.begintime!=0">
144
+            and g.createtime between #{param.begintime} and #{param.endtime}
145
+        </if>
125
         <if test="param.year!=null and param.year!=0">
146
         <if test="param.year!=null and param.year!=0">
126
             and c.year=#{param.year}
147
             and c.year=#{param.year}
127
         </if>
148
         </if>
139
          from t_paper_student ps
160
          from t_paper_student ps
140
         left join t_school s on ps.schoolid=s.schoolid
161
         left join t_school s on ps.schoolid=s.schoolid
141
         left join t_class c on c.classid=ps.classid
162
         left join t_class c on c.classid=ps.classid
142
-        where s.schoollevel=#{param.level} and ps.stoptime between #{param.begintime} and #{param.endtime}
163
+        where s.schoollevel=#{param.level}
164
+        <if test="param.begintime!=null and param.begintime!=0">
165
+            and ps.stoptime between #{param.begintime} and #{param.endtime}
166
+        </if>
143
         <if test="param.year!=null and param.year!=0">
167
         <if test="param.year!=null and param.year!=0">
144
             and c.year=#{param.year}
168
             and c.year=#{param.year}
145
         </if>
169
         </if>
157
         left join t_guide g on gs.guideid=g.guideid
181
         left join t_guide g on gs.guideid=g.guideid
158
         left join t_school s on g.schoolid=s.schoolid
182
         left join t_school s on g.schoolid=s.schoolid
159
         left join t_class c on c.classid=gs.classid
183
         left join t_class c on c.classid=gs.classid
160
-        where s.schoollevel=#{param.level} and gs.readtime between #{param.begintime} and #{param.endtime} and gs.readtime>0
184
+        where s.schoollevel=#{param.level} and gs.readtime>0
185
+        <if test="param.begintime!=null and param.begintime!=0">
186
+            and gs.readtime between #{param.begintime} and #{param.endtime}
187
+        </if>
161
         <if test="param.year!=null and param.year!=0">
188
         <if test="param.year!=null and param.year!=0">
162
             and c.year=#{param.year}
189
             and c.year=#{param.year}
163
         </if>
190
         </if>

+ 3
- 1
sapi/src/main/resources/mapper/region/RRoomAnalyzeMapper.xml View File

31
         <if test="param.year==null || param.year==0">
31
         <if test="param.year==null || param.year==0">
32
             and c.year=s.year
32
             and c.year=s.year
33
         </if>
33
         </if>
34
-        and r.createtime between #{param.begintime} and #{param.endtime}
34
+        <if test="param.begintime!=null and param.begintime!=0">
35
+            and r.createtime between #{param.begintime} and #{param.endtime}
36
+        </if>
35
         group by r.roomid
37
         group by r.roomid
36
     </select>
38
     </select>
37
 </mapper>
39
 </mapper>

+ 1
- 0
scommons/src/main/java/com/xhkjedu/utils/N_Utils.java View File

124
 
124
 
125
     //计算两个时间戳相差的天数
125
     //计算两个时间戳相差的天数
126
     public static Integer getTimestampDay(Integer begintime,Integer endtime){
126
     public static Integer getTimestampDay(Integer begintime,Integer endtime){
127
+        if(isEmptyInteger(begintime)) return 365;//默认时间差为一年
127
         Integer day = 0;
128
         Integer day = 0;
128
 
129
 
129
         Integer cha = endtime - begintime;
130
         Integer cha = endtime - begintime;

Loading…
Cancel
Save