Browse Source

试题是视频讲解,区域统计

tags/正式3.10.0
王宁 1 year ago
parent
commit
8519eb2161

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

@@ -26,10 +26,8 @@ public class RAppAnalyzeController {
26 26
 
27 27
     @PostMapping("/list_app")
28 28
     public ResultVo listApp(@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});
30
+        N_Utils.validation(new Object[]{level,"学段",1,param.getYear(),"学年",1});
33 31
         Map map = rAppAnalyzeService.listApp(param);
34 32
         return new ResultVo(0,"获取应用统计成功",map);
35 33
     }

+ 0
- 2
sapi/src/main/java/com/xhkjedu/sapi/service/region/RSchoolAnalyzeService.java View File

@@ -319,8 +319,6 @@ public class RSchoolAnalyzeService {
319 319
 
320 320
     public Map listAccess(RegionParam param) {
321 321
         Map map = new HashMap();
322
-        Integer begintime = param.getBegintime();
323
-        Integer endtime = param.getEndtime();
324 322
         List<Map> access = rSchoolAnalyzeMapper.listAccess(param);
325 323
         map.put("access",access);
326 324
         Map<Integer, List<Map>> lcollect = access.stream().collect(Collectors.groupingBy(m -> (Integer) m.get("level")));

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

@@ -5,10 +5,7 @@
5 5
     <select id="getLoginNum" resultType="java.lang.Integer">
6 6
         select count(ul.ulid)
7 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
9
-        <if test="year!=null and year!=0">
10
-            and ul.year=#{year}
11
-        </if>
8
+        where s.schoollevel=#{level} and s.schoolstate=1 and ul.year=#{year}
12 9
         <if test="begintime!=null and begintime!=0">
13 10
             and ul.logtime between #{begintime} and #{endtime}
14 11
         </if>
@@ -18,10 +15,7 @@
18 15
         select m.schoolid,s.schoolname,s.shortname,m.modulecode,count(m.amid)dknum,sum(m.costtime)costtime
19 16
         ,(select m2.modulename from t_moduledefault m2 where m2.mabbrevname=m.modulecode limit 1)modulename
20 17
         from t_school s right join t_app_monitor m on m.schoolid=s.schoolid
21
-        where s.schoollevel=#{level} and s.schoolstate=1
22
-        <if test="year!=null and year!=0">
23
-            and m.year=#{year}
24
-        </if>
18
+        where s.schoollevel=#{level} and s.schoolstate=1 and m.year=#{year}
25 19
         <if test="begintime!=null and begintime!=0">
26 20
             and m.createtime between #{begintime} and #{endtime}
27 21
         </if>

+ 12
- 67
sapi/src/main/resources/mapper/region/RPaperAnalyzeMapper.xml View File

@@ -7,13 +7,7 @@
7 7
       select count(DISTINCT pg.paperid) from t_paper_class pg left join t_paper p on pg.paperid=p.paperid
8 8
         LEFT JOIN t_school s on p.schoolid=s.schoolid and pg.schoolid=s.schoolid
9 9
         left join t_class c on c.classid=pg.classid
10
-        where s.schoollevel=#{param.level}
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>
10
+        where s.schoollevel=#{param.level} and s.schoolstate=1 and p.year=#{param.year}
17 11
         <if test="param.begintime!=null and param.begintime!=0">
18 12
             and pg.starttime between #{param.begintime} and #{param.endtime}
19 13
         </if>
@@ -23,13 +17,7 @@
23 17
         select count(DISTINCT g.guideid) from t_guide_group gg left join t_guide g on gg.guideid=g.guideid
24 18
         LEFT JOIN t_school s on g.schoolid=s.schoolid and gg.schoolid=s.schoolid
25 19
         left join t_class c on c.classid=gg.classid
26
-        where s.schoollevel=#{param.level}
27
-        <if test="param.year!=null and param.year!=0">
28
-            and c.year=#{param.year}
29
-        </if>
30
-        <if test="param.year==null || param.year==0">
31
-            and c.year=s.year
32
-        </if>
20
+        where s.schoollevel=#{param.level} and s.schoolstate=1 and g.year=#{param.year}
33 21
         <if test="param.begintime!=null and param.begintime!=0">
34 22
             and g.createtime between #{param.begintime} and #{param.endtime}
35 23
         </if>
@@ -39,32 +27,20 @@
39 27
        select count(DISTINCT rg.reciteid) from t_recite_group rg left join t_recite r on rg.reciteid=r.reciteid
40 28
         LEFT JOIN t_school s on r.schoolid=s.schoolid and rg.schoolid=s.schoolid
41 29
         left join t_class c on c.classid=rg.classid
42
-        where s.schoollevel=#{param.level}
43
-        <if test="param.year!=null and param.year!=0">
44
-            and c.year=#{param.year}
45
-        </if>
46
-        <if test="param.year==null || param.year==0">
47
-            and c.year=s.year
48
-        </if>
30
+        where s.schoollevel=#{param.level} and s.schoolstate=1 and r.year=#{param.year}
49 31
         <if test="param.begintime!=null and param.begintime!=0">
50 32
             and rg.starttime between #{param.begintime} and #{param.endtime}
51 33
         </if>
52 34
     </select>
53 35
     <!--作业数量统计——错题视频数量-->
54 36
     <select id="getRegionPaperNumQueexp" resultType="java.lang.Integer">
55
-       select count(distinct qe.qcpid) from t_question_explain qe left join t_question_class qc on qe.questionid=qe.questionid
56
-      left JOIN t_school s on qc.schoolid=s.schoolid
57
-      left join t_class c on c.classid=qc.classid
58
-      where s.schoollevel=#{param.level}
37
+        select count(distinct qe.qcpid) from t_question_explain qe left join t_question_class qc on qe.questionid=qe.questionid
38
+        left JOIN t_school s on qc.schoolid=s.schoolid
39
+        left join t_class c on c.classid=qc.classid
40
+        where s.schoollevel=#{param.level} and s.schoolstate=1 and qe.year=#{param.year}
59 41
         <if test="param.begintime!=null and param.begintime!=0">
60 42
             and qe.createtime between #{param.begintime} and #{param.endtime}
61 43
         </if>
62
-        <if test="param.year!=null and param.year!=0">
63
-            and c.year=#{param.year}
64
-        </if>
65
-        <if test="param.year==null || param.year==0">
66
-            and c.year=s.year
67
-        </if>
68 44
     </select>
69 45
 
70 46
     <!--作业各类率统计-->
@@ -82,7 +58,6 @@
82 58
             <result column="paperscore" property="paperscore"></result>
83 59
             <result column="stuscore" property="stuscore"></result>
84 60
         </collection>
85
-
86 61
     </resultMap>
87 62
     <!--作业各类率统计——作业-->
88 63
     <select id="listRegionSchoolRatePaper" resultMap="rpaperMap">
@@ -95,13 +70,7 @@
95 70
         left join t_paper_student ps on ps.paperid=p.paperid and ps.classid=pg.classid
96 71
         left join t_school s on p.schoolid=s.schoolid and pg.schoolid=s.schoolid
97 72
         left join t_class c on c.classid=pg.classid
98
-        where s.schoollevel=#{param.level}
99
-        <if test="param.year!=null and param.year!=0">
100
-            and c.year=#{param.year}
101
-        </if>
102
-        <if test="param.year==null || param.year==0">
103
-            and c.year=s.year
104
-        </if>
73
+        where s.schoollevel=#{param.level} and s.schoolstate=1 and p.year=#{param.year}
105 74
         <if test="param.begintime!=null and param.begintime!=0">
106 75
             and pg.starttime between #{param.begintime} and #{param.endtime}
107 76
         </if>
@@ -117,13 +86,7 @@
117 86
         left join t_recite_student rs on rs.reciteid=r.reciteid and rs.classid=rg.classid
118 87
         left join t_school s on r.schoolid=s.schoolid and rg.schoolid=s.schoolid
119 88
         left join t_class c on c.classid=rg.classid
120
-        where s.schoollevel=#{param.level}
121
-        <if test="param.year!=null and param.year!=0">
122
-            and c.year=#{param.year}
123
-        </if>
124
-        <if test="param.year==null || param.year==0">
125
-            and c.year=s.year
126
-        </if>
89
+        where s.schoollevel=#{param.level} and s.schoolstate=1 and r.year=#{param.year}
127 90
         <if test="param.begintime!=null and param.begintime!=0">
128 91
             and rg.starttime between #{param.begintime} and #{param.endtime}
129 92
         </if>
@@ -139,13 +102,7 @@
139 102
         left join t_guide_group_student ggs on ggs.guideid=g.guideid and ggs.classid=gg.classid
140 103
         left join t_school s on s.schoolid=g.schoolid and s.schoolid=gg.schoolid
141 104
         left join t_class c on c.classid=gg.classid
142
-        where s.schoollevel=#{param.level}
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>
105
+        where s.schoollevel=#{param.level} and s.schoolstate=1 and g.year=#{param.year}
149 106
         <if test="param.begintime!=null and param.begintime!=0">
150 107
             and g.createtime between #{param.begintime} and #{param.endtime}
151 108
         </if>
@@ -161,13 +118,7 @@
161 118
         left join t_school s on p.schoolid=s.schoolid and pg.schoolid=s.schoolid
162 119
         left join t_paper_student ps on pg.paperid=ps.paperid and pg.classid=ps.classid and ps.psstate!=0
163 120
         left join t_class c on c.classid=pg.classid
164
-        where s.schoollevel=#{param.level}
165
-        <if test="param.year!=null and param.year!=0">
166
-            and c.year=#{param.year}
167
-        </if>
168
-        <if test="param.year==null || param.year==0">
169
-            and c.year=s.year
170
-        </if>
121
+        where s.schoollevel=#{param.level} and s.schoolstate=1 and p.year=#{param.year}
171 122
         <if test="param.begintime!=null and param.begintime!=0">
172 123
             and pg.starttime between #{param.begintime} and #{param.endtime}
173 124
         </if>
@@ -182,13 +133,7 @@
182 133
         left join t_guide g on gs.guideid=g.guideid
183 134
         left join t_school s on g.schoolid=s.schoolid and gs.schoolid=s.schoolid
184 135
         left join t_class c on c.classid=gs.classid
185
-        where s.schoollevel=#{param.level} and gs.readtime>0
186
-        <if test="param.year!=null and param.year!=0">
187
-            and c.year=#{param.year}
188
-        </if>
189
-        <if test="param.year==null || param.year==0">
190
-            and c.year=s.year
191
-        </if>
136
+        where s.schoollevel=#{param.level} and s.schoolstate=1 and gs.readtime>0 and g.year=#{param.year}
192 137
         <if test="param.begintime!=null and param.begintime!=0">
193 138
             and g.createtime between #{param.begintime} and #{param.endtime}
194 139
         </if>

+ 0
- 3
sapi/src/main/resources/mapper/region/RSchoolAnalyzeMapper.xml View File

@@ -50,9 +50,6 @@
50 50
         select s.schoolid,s.schoolname,s.shortname,ceil(ifnull(count(l.ulid)/count(distinct u.userid),0))num,s.schoollevel level
51 51
         from t_school s left join t_user u on u.schoolid=s.schoolid and u.usertype in(1,2)
52 52
         left join t_user_log l on u.userid=l.userid and s.year=l.year
53
-        <if test="param.begintime!=null and param.begintime!=0 and param.endtime!=null and param.endtime!=0">
54
-            and l.logtime between #{param.begintime} and #{param.endtime}
55
-        </if>
56 53
         where s.schoolstate=1 and s.year=#{param.year}
57 54
         group by s.schoolid order by num desc
58 55
     </select>

+ 3
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/question/QuestionClassMapper.java View File

@@ -81,4 +81,7 @@ public interface QuestionClassMapper extends TkMapper<TQuestionClass> {
81 81
 
82 82
     //删除作业错题
83 83
     void deleteQuestionByPaperId(Integer paperid);
84
+
85
+    //取上传视频讲解老师归属学校年份
86
+    Integer getYearBySchoolTeacherid(@Param("userid") Integer userid);
84 87
 }

+ 3
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/model/question/TQuestionExplain.java View File

@@ -45,4 +45,7 @@ public class TQuestionExplain extends BaseBean {
45 45
 
46 46
     //上传时间
47 47
     private Integer createtime;
48
+
49
+    //学校年份
50
+    private Integer year;
48 51
 }

+ 2
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/service/question/QuestionClassService.java View File

@@ -212,6 +212,8 @@ public class QuestionClassService {
212 212
     public void addExplain(TQuestionExplain explain) {
213 213
         explain.setCreatetime(N_Utils.getSecondTimestamp());
214 214
         explain.setReadcount(0);
215
+        int schoolyear = questionClassMapper.getYearBySchoolTeacherid(explain.getCreateid());
216
+        explain.setYear(schoolyear);
215 217
         questionExplainMapper.insertUseGeneratedKeys(explain);
216 218
         explain.setQcpid(explain.getId());
217 219
         convertVideo(explain);//视频转换mq

+ 5
- 0
sstudy/src/main/resources/mapper/question/QuestionClassMapper.xml View File

@@ -273,4 +273,9 @@
273 273
         delete from t_question_class where paperid=#{paperid};
274 274
         delete from t_question_student where paperid=#{paperid} and errornum=1;
275 275
     </delete>
276
+
277
+    <!--获取上传视频讲解老师归属学校年份-->
278
+    <select id="getYearBySchoolTeacherid" resultType="java.lang.Integer">
279
+        select s.`year` from t_school s left join t_user u on s.schoolid=u.schoolid where u.userid=#{userid} limit 1
280
+    </select>
276 281
 </mapper>

Loading…
Cancel
Save