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

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

319
 
319
 
320
     public Map listAccess(RegionParam param) {
320
     public Map listAccess(RegionParam param) {
321
         Map map = new HashMap();
321
         Map map = new HashMap();
322
-        Integer begintime = param.getBegintime();
323
-        Integer endtime = param.getEndtime();
324
         List<Map> access = rSchoolAnalyzeMapper.listAccess(param);
322
         List<Map> access = rSchoolAnalyzeMapper.listAccess(param);
325
         map.put("access",access);
323
         map.put("access",access);
326
         Map<Integer, List<Map>> lcollect = access.stream().collect(Collectors.groupingBy(m -> (Integer) m.get("level")));
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
     <select id="getLoginNum" resultType="java.lang.Integer">
5
     <select id="getLoginNum" resultType="java.lang.Integer">
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
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
         <if test="begintime!=null and begintime!=0">
9
         <if test="begintime!=null and begintime!=0">
13
             and ul.logtime between #{begintime} and #{endtime}
10
             and ul.logtime between #{begintime} and #{endtime}
14
         </if>
11
         </if>
18
         select m.schoolid,s.schoolname,s.shortname,m.modulecode,count(m.amid)dknum,sum(m.costtime)costtime
15
         select m.schoolid,s.schoolname,s.shortname,m.modulecode,count(m.amid)dknum,sum(m.costtime)costtime
19
         ,(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
20
         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
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
         <if test="begintime!=null and begintime!=0">
19
         <if test="begintime!=null and begintime!=0">
26
             and m.createtime between #{begintime} and #{endtime}
20
             and m.createtime between #{begintime} and #{endtime}
27
         </if>
21
         </if>

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

7
       select count(DISTINCT pg.paperid) from t_paper_class pg left join t_paper p on pg.paperid=p.paperid
7
       select count(DISTINCT pg.paperid) from t_paper_class pg left join t_paper p on pg.paperid=p.paperid
8
         LEFT JOIN t_school s on p.schoolid=s.schoolid and pg.schoolid=s.schoolid
8
         LEFT JOIN t_school s on p.schoolid=s.schoolid and pg.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}
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
         <if test="param.begintime!=null and param.begintime!=0">
11
         <if test="param.begintime!=null and param.begintime!=0">
18
             and pg.starttime between #{param.begintime} and #{param.endtime}
12
             and pg.starttime between #{param.begintime} and #{param.endtime}
19
         </if>
13
         </if>
23
         select count(DISTINCT g.guideid) from t_guide_group gg left join t_guide g on gg.guideid=g.guideid
17
         select count(DISTINCT g.guideid) from t_guide_group gg left join t_guide g on gg.guideid=g.guideid
24
         LEFT JOIN t_school s on g.schoolid=s.schoolid and gg.schoolid=s.schoolid
18
         LEFT JOIN t_school s on g.schoolid=s.schoolid and gg.schoolid=s.schoolid
25
         left join t_class c on c.classid=gg.classid
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
         <if test="param.begintime!=null and param.begintime!=0">
21
         <if test="param.begintime!=null and param.begintime!=0">
34
             and g.createtime between #{param.begintime} and #{param.endtime}
22
             and g.createtime between #{param.begintime} and #{param.endtime}
35
         </if>
23
         </if>
39
        select count(DISTINCT rg.reciteid) from t_recite_group rg left join t_recite r on rg.reciteid=r.reciteid
27
        select count(DISTINCT rg.reciteid) from t_recite_group rg left join t_recite r on rg.reciteid=r.reciteid
40
         LEFT JOIN t_school s on r.schoolid=s.schoolid and rg.schoolid=s.schoolid
28
         LEFT JOIN t_school s on r.schoolid=s.schoolid and rg.schoolid=s.schoolid
41
         left join t_class c on c.classid=rg.classid
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
         <if test="param.begintime!=null and param.begintime!=0">
31
         <if test="param.begintime!=null and param.begintime!=0">
50
             and rg.starttime between #{param.begintime} and #{param.endtime}
32
             and rg.starttime between #{param.begintime} and #{param.endtime}
51
         </if>
33
         </if>
52
     </select>
34
     </select>
53
     <!--作业数量统计——错题视频数量-->
35
     <!--作业数量统计——错题视频数量-->
54
     <select id="getRegionPaperNumQueexp" resultType="java.lang.Integer">
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
         <if test="param.begintime!=null and param.begintime!=0">
41
         <if test="param.begintime!=null and param.begintime!=0">
60
             and qe.createtime between #{param.begintime} and #{param.endtime}
42
             and qe.createtime between #{param.begintime} and #{param.endtime}
61
         </if>
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
     </select>
44
     </select>
69
 
45
 
70
     <!--作业各类率统计-->
46
     <!--作业各类率统计-->
82
             <result column="paperscore" property="paperscore"></result>
58
             <result column="paperscore" property="paperscore"></result>
83
             <result column="stuscore" property="stuscore"></result>
59
             <result column="stuscore" property="stuscore"></result>
84
         </collection>
60
         </collection>
85
-
86
     </resultMap>
61
     </resultMap>
87
     <!--作业各类率统计——作业-->
62
     <!--作业各类率统计——作业-->
88
     <select id="listRegionSchoolRatePaper" resultMap="rpaperMap">
63
     <select id="listRegionSchoolRatePaper" resultMap="rpaperMap">
95
         left join t_paper_student ps on ps.paperid=p.paperid and ps.classid=pg.classid
70
         left join t_paper_student ps on ps.paperid=p.paperid and ps.classid=pg.classid
96
         left join t_school s on p.schoolid=s.schoolid and pg.schoolid=s.schoolid
71
         left join t_school s on p.schoolid=s.schoolid and pg.schoolid=s.schoolid
97
         left join t_class c on c.classid=pg.classid
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
         <if test="param.begintime!=null and param.begintime!=0">
74
         <if test="param.begintime!=null and param.begintime!=0">
106
             and pg.starttime between #{param.begintime} and #{param.endtime}
75
             and pg.starttime between #{param.begintime} and #{param.endtime}
107
         </if>
76
         </if>
117
         left join t_recite_student rs on rs.reciteid=r.reciteid and rs.classid=rg.classid
86
         left join t_recite_student rs on rs.reciteid=r.reciteid and rs.classid=rg.classid
118
         left join t_school s on r.schoolid=s.schoolid and rg.schoolid=s.schoolid
87
         left join t_school s on r.schoolid=s.schoolid and rg.schoolid=s.schoolid
119
         left join t_class c on c.classid=rg.classid
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
         <if test="param.begintime!=null and param.begintime!=0">
90
         <if test="param.begintime!=null and param.begintime!=0">
128
             and rg.starttime between #{param.begintime} and #{param.endtime}
91
             and rg.starttime between #{param.begintime} and #{param.endtime}
129
         </if>
92
         </if>
139
         left join t_guide_group_student ggs on ggs.guideid=g.guideid and ggs.classid=gg.classid
102
         left join t_guide_group_student ggs on ggs.guideid=g.guideid and ggs.classid=gg.classid
140
         left join t_school s on s.schoolid=g.schoolid and s.schoolid=gg.schoolid
103
         left join t_school s on s.schoolid=g.schoolid and s.schoolid=gg.schoolid
141
         left join t_class c on c.classid=gg.classid
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
         <if test="param.begintime!=null and param.begintime!=0">
106
         <if test="param.begintime!=null and param.begintime!=0">
150
             and g.createtime between #{param.begintime} and #{param.endtime}
107
             and g.createtime between #{param.begintime} and #{param.endtime}
151
         </if>
108
         </if>
161
         left join t_school s on p.schoolid=s.schoolid and pg.schoolid=s.schoolid
118
         left join t_school s on p.schoolid=s.schoolid and pg.schoolid=s.schoolid
162
         left join t_paper_student ps on pg.paperid=ps.paperid and pg.classid=ps.classid and ps.psstate!=0
119
         left join t_paper_student ps on pg.paperid=ps.paperid and pg.classid=ps.classid and ps.psstate!=0
163
         left join t_class c on c.classid=pg.classid
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
         <if test="param.begintime!=null and param.begintime!=0">
122
         <if test="param.begintime!=null and param.begintime!=0">
172
             and pg.starttime between #{param.begintime} and #{param.endtime}
123
             and pg.starttime between #{param.begintime} and #{param.endtime}
173
         </if>
124
         </if>
182
         left join t_guide g on gs.guideid=g.guideid
133
         left join t_guide g on gs.guideid=g.guideid
183
         left join t_school s on g.schoolid=s.schoolid and gs.schoolid=s.schoolid
134
         left join t_school s on g.schoolid=s.schoolid and gs.schoolid=s.schoolid
184
         left join t_class c on c.classid=gs.classid
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
         <if test="param.begintime!=null and param.begintime!=0">
137
         <if test="param.begintime!=null and param.begintime!=0">
193
             and g.createtime between #{param.begintime} and #{param.endtime}
138
             and g.createtime between #{param.begintime} and #{param.endtime}
194
         </if>
139
         </if>

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

50
         select s.schoolid,s.schoolname,s.shortname,ceil(ifnull(count(l.ulid)/count(distinct u.userid),0))num,s.schoollevel level
50
         select s.schoolid,s.schoolname,s.shortname,ceil(ifnull(count(l.ulid)/count(distinct u.userid),0))num,s.schoollevel level
51
         from t_school s left join t_user u on u.schoolid=s.schoolid and u.usertype in(1,2)
51
         from t_school s left join t_user u on u.schoolid=s.schoolid and u.usertype in(1,2)
52
         left join t_user_log l on u.userid=l.userid and s.year=l.year
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
         where s.schoolstate=1 and s.year=#{param.year}
53
         where s.schoolstate=1 and s.year=#{param.year}
57
         group by s.schoolid order by num desc
54
         group by s.schoolid order by num desc
58
     </select>
55
     </select>

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

81
 
81
 
82
     //删除作业错题
82
     //删除作业错题
83
     void deleteQuestionByPaperId(Integer paperid);
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
 
45
 
46
     //上传时间
46
     //上传时间
47
     private Integer createtime;
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
     public void addExplain(TQuestionExplain explain) {
212
     public void addExplain(TQuestionExplain explain) {
213
         explain.setCreatetime(N_Utils.getSecondTimestamp());
213
         explain.setCreatetime(N_Utils.getSecondTimestamp());
214
         explain.setReadcount(0);
214
         explain.setReadcount(0);
215
+        int schoolyear = questionClassMapper.getYearBySchoolTeacherid(explain.getCreateid());
216
+        explain.setYear(schoolyear);
215
         questionExplainMapper.insertUseGeneratedKeys(explain);
217
         questionExplainMapper.insertUseGeneratedKeys(explain);
216
         explain.setQcpid(explain.getId());
218
         explain.setQcpid(explain.getId());
217
         convertVideo(explain);//视频转换mq
219
         convertVideo(explain);//视频转换mq

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

273
         delete from t_question_class where paperid=#{paperid};
273
         delete from t_question_class where paperid=#{paperid};
274
         delete from t_question_student where paperid=#{paperid} and errornum=1;
274
         delete from t_question_student where paperid=#{paperid} and errornum=1;
275
     </delete>
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
 </mapper>
281
 </mapper>

Loading…
Cancel
Save