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

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

@@ -28,10 +28,8 @@ public class RPaperAnalyzeController {
28 28
     //作业试题统计
29 29
     @PostMapping("/pnum")
30 30
     public ResultVo getResourceQuestionNum(@RequestBody RegionParam param){
31
-        Integer begintime = param.getBegintime();
32
-        Integer endtime = param.getEndtime();
33 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 33
         Map map = rPaperAnalyzeService.getRegionPaperNum(param);
36 34
         return new ResultVo(0,"获取作业数量统计成功",map);
37 35
     }
@@ -39,10 +37,8 @@ public class RPaperAnalyzeController {
39 37
     //作业率统计--作业
40 38
     @PostMapping("/ratep")
41 39
     public ResultVo listRegionSchoolRatePaper(@RequestBody RegionParam param){
42
-        Integer begintime = param.getBegintime();
43
-        Integer endtime = param.getEndtime();
44 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 42
         Map map = rPaperAnalyzeService.listRegionSchoolRatePaper(param);
47 43
         return new ResultVo(0,"获取作业率统计成功",map);
48 44
     }
@@ -50,10 +46,8 @@ public class RPaperAnalyzeController {
50 46
     //作业率统计--背诵
51 47
     @PostMapping("/rater")
52 48
     public ResultVo listRegionSchoolRateRecite(@RequestBody RegionParam param){
53
-        Integer begintime = param.getBegintime();
54
-        Integer endtime = param.getEndtime();
55 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 51
         Map map = rPaperAnalyzeService.listRegionSchoolRateRecite(param);
58 52
         return new ResultVo(0,"获取背诵率统计成功",map);
59 53
     }
@@ -61,10 +55,8 @@ public class RPaperAnalyzeController {
61 55
     //作业率统计--预习率
62 56
     @PostMapping("/ratepre")
63 57
     public ResultVo getRegionSchoolRatePreview(@RequestBody RegionParam param){
64
-        Integer begintime = param.getBegintime();
65
-        Integer endtime = param.getEndtime();
66 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 60
         Map map = rPaperAnalyzeService.getRegionSchoolRatePreview(param);
69 61
         return new ResultVo(0,"获取预习率统计成功",map);
70 62
     }
@@ -72,20 +64,16 @@ public class RPaperAnalyzeController {
72 64
     //人均作业用时
73 65
     @PostMapping("/avgp")
74 66
     public ResultVo listRegionSchoolUsetimePaper(@RequestBody RegionParam param){
75
-        Integer begintime = param.getBegintime();
76
-        Integer endtime = param.getEndtime();
77 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 69
         List<Map> lst= rPaperAnalyzeService.listRegionSchoolUsetimePaper(param);
80 70
         return new ResultVo(0,"获取人均作业用时成功",lst);
81 71
     }
82 72
     //人均预习用时
83 73
     @PostMapping("/avgpre")
84 74
     public ResultVo listRegionSchoolUsetimePreview(@RequestBody RegionParam param){
85
-        Integer begintime = param.getBegintime();
86
-        Integer endtime = param.getEndtime();
87 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 77
         List<Map> lst= rPaperAnalyzeService.listRegionSchoolUsetimePreview(param);
90 78
         return new ResultVo(0,"获取人均预习用时成功",lst);
91 79
     }

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

@@ -26,10 +26,8 @@ public class RRoomAnalyzeController {
26 26
 
27 27
     @PostMapping("/list_room")
28 28
     public ResultVo listRoom(@RequestBody RegionParam param){
29
-        Integer begintime = param.getBegintime();
30
-        Integer endtime = param.getEndtime();
31 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 31
         Map map = rRoomAnalyzeService.listRoom(param);
34 32
         return new ResultVo(0,"获取课堂统计成功",map);
35 33
     }

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

@@ -6,7 +6,9 @@
6 6
         select count(ul.ulid)
7 7
         from t_school s right join t_user_log ul on s.schoolid=ul.schoolid
8 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 12
     </select>
11 13
     <!--学校应用时长、次数统计-->
12 14
     <select id="listApp" resultType="com.xhkjedu.sapi.vo.region.RAppVo">
@@ -14,7 +16,9 @@
14 16
         ,(select m2.modulename from t_moduledefault m2 where m2.mabbrevname=m.modulecode limit 1)modulename
15 17
         from t_school s right join t_app_monitor m on m.schoolid=s.schoolid
16 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 22
         group by m.schoolid,m.modulecode
19 23
     </select>
20 24
 </mapper>

+ 36
- 9
sapi/src/main/resources/mapper/region/RPaperAnalyzeMapper.xml View File

@@ -7,7 +7,10 @@
7 7
       select count(DISTINCT pg.paperid) from t_paper_group pg left join t_paper p on pg.paperid=p.paperid
8 8
         LEFT JOIN t_school s on p.schoolid=s.schoolid
9 9
         left join t_class c on c.classid=pg.classid
10
-        where s.schoollevel=#{param.level} and 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 14
         <if test="param.year!=null and param.year!=0">
12 15
             and c.year=#{param.year}
13 16
         </if>
@@ -20,7 +23,10 @@
20 23
         select count(DISTINCT g.guideid) from t_guide_group gg left join t_guide g on gg.guideid=g.guideid
21 24
         LEFT JOIN t_school s on g.schoolid=s.schoolid
22 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 30
         <if test="param.year!=null and param.year!=0">
25 31
             and c.year=#{param.year}
26 32
         </if>
@@ -33,7 +39,10 @@
33 39
        select count(DISTINCT rg.reciteid) from t_recite_group rg left join t_recite r on rg.reciteid=r.reciteid
34 40
         LEFT JOIN t_school s on r.schoolid=s.schoolid
35 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 46
         <if test="param.year!=null and param.year!=0">
38 47
             and c.year=#{param.year}
39 48
         </if>
@@ -46,7 +55,10 @@
46 55
        select count(distinct qe.qcpid) from t_question_explain qe left join t_question_class qc on qe.questionid=qe.questionid
47 56
       left JOIN t_school s on qc.schoolid=s.schoolid
48 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 62
         <if test="param.year!=null and param.year!=0">
51 63
             and c.year=#{param.year}
52 64
         </if>
@@ -83,7 +95,10 @@
83 95
         left join t_paper_student ps on ps.paperid=p.paperid and ps.classid=pg.classid
84 96
         left join t_school s on p.schoolid=s.schoolid
85 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 102
         <if test="param.year!=null and param.year!=0">
88 103
             and c.year=#{param.year}
89 104
         </if>
@@ -102,7 +117,10 @@
102 117
         left join t_recite_student rs on rs.reciteid=r.reciteid and rs.classid=rg.classid
103 118
         left join t_school s on r.schoolid=s.schoolid
104 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 124
         <if test="param.year!=null and param.year!=0">
107 125
             and c.year=#{param.year}
108 126
         </if>
@@ -121,7 +139,10 @@
121 139
         left join t_guide_group_student ggs on ggs.guideid=g.guideid and ggs.classid=gg.classid
122 140
         left join t_school s on s.schoolid=g.schoolid
123 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 146
         <if test="param.year!=null and param.year!=0">
126 147
             and c.year=#{param.year}
127 148
         </if>
@@ -139,7 +160,10 @@
139 160
          from t_paper_student ps
140 161
         left join t_school s on ps.schoolid=s.schoolid
141 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 167
         <if test="param.year!=null and param.year!=0">
144 168
             and c.year=#{param.year}
145 169
         </if>
@@ -157,7 +181,10 @@
157 181
         left join t_guide g on gs.guideid=g.guideid
158 182
         left join t_school s on g.schoolid=s.schoolid
159 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 188
         <if test="param.year!=null and param.year!=0">
162 189
             and c.year=#{param.year}
163 190
         </if>

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

@@ -31,7 +31,9 @@
31 31
         <if test="param.year==null || param.year==0">
32 32
             and c.year=s.year
33 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 37
         group by r.roomid
36 38
     </select>
37 39
 </mapper>

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

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

Loading…
Cancel
Save