|
@@ -94,7 +94,7 @@
|
94
|
94
|
|
95
|
95
|
<!--我的空间-->
|
96
|
96
|
<select id="listMySpaces" resultType="java.util.Map">
|
97
|
|
- select r.resourceid,r.resourcename,r.resourceclass,r.suffix,r.resourcesize,r.resourcecover,
|
|
97
|
+ select r.resourceid,r.resourcename,r.resourceclass,r.suffix,r.resourcesize,r.resourcecover,r.resourceurl,
|
98
|
98
|
r.createtime from t_resource r
|
99
|
99
|
left join t_resource_director d on r.resourceid=d.resourceid
|
100
|
100
|
left join t_teacher_powersb p on p.teacherid=r.createid and p.lsbid=d.lsbid
|
|
@@ -104,7 +104,7 @@
|
104
|
104
|
|
105
|
105
|
<!--校本资源库-->
|
106
|
106
|
<select id="listSchoolResources" resultType="java.util.Map">
|
107
|
|
- select r.resourceid,r.resourcename,r.resourceclass,r.suffix,r.resourcesize,r.resourcecover,
|
|
107
|
+ select r.resourceid,r.resourcename,r.resourceclass,r.suffix,r.resourcesize,r.resourcecover,resourceurl,
|
108
|
108
|
r.createtime from t_resource r
|
109
|
109
|
left join t_resource_director rd on r.resourceid=rd.resourceid
|
110
|
110
|
left join t_director d on rd.directorid=d.directorid
|
|
@@ -126,17 +126,400 @@
|
126
|
126
|
group by r.resourceid order by r.createtime desc limit #{limitSize}
|
127
|
127
|
</select>
|
128
|
128
|
|
129
|
|
- <select id="listGuides" resultType="java.util.Map">
|
130
|
|
- select g.guideid,g.guidename,g.createtime,g.createid,u.username as createname,r.resourcesize
|
|
129
|
+ <resultMap id="guidesForMap" type="java.util.Map">
|
|
130
|
+ <result column="guideid" property="guideid"/>
|
|
131
|
+ <result column="guidename" property="guidename"/>
|
|
132
|
+ <result column="createid" property="createid"/>
|
|
133
|
+ <result column="createtime" property="createtime"/>
|
|
134
|
+ <result column="totalnum" property="totalnum"/>
|
|
135
|
+ <result column="commitnum" property="commitnum"/>
|
|
136
|
+ <collection property="resources" ofType="java.util.Map"
|
|
137
|
+ javaType="java.util.List" select="listResourcesByGuideid" column="guideid">
|
|
138
|
+ </collection>
|
|
139
|
+ </resultMap>
|
|
140
|
+
|
|
141
|
+ <!--预习-->
|
|
142
|
+ <select id="listGuides" resultMap="guidesForMap">
|
|
143
|
+ select g.guideid,g.guidename,g.createtime,g.createid
|
131
|
144
|
,count(DISTINCT gs.rgsid) totalnum,
|
132
|
145
|
count(DISTINCT(if(gs.readtime is not null,gs.rgsid,null))) commitnum
|
133
|
|
- from t_guide g left join t_user u on g.createid=u.userid
|
|
146
|
+ from t_guide g
|
134
|
147
|
left join t_guide_group_student gs on g.guideid=gs.guideid and g.schoolid=gs.schoolid
|
135
|
|
- left join t_guide_resource gr on g.guideid=gr.guideid
|
136
|
|
- left join t_resource r on gr.resourceid=r.resourceid
|
137
|
148
|
left join t_director d on g.directorid=d.directorid
|
138
|
149
|
left join t_teacher_powersb p on p.teacherid=g.createid and p.lsbid=g.lsbid
|
139
|
150
|
where d.disabled=0 and g.createid=#{userid}
|
140
|
151
|
group by g.guideid order by g.createtime desc,g.guidename LIMIT #{limitSize}
|
141
|
152
|
</select>
|
|
153
|
+ <select id="listResourcesByGuideid" resultType="java.util.Map">
|
|
154
|
+ select r.resourceid, r.resourcename,r.resourceurl,r.resourcecover,r.converted,r.pdfurl,
|
|
155
|
+ r.suffix,r.mp4code,r.resourcesize,r.duration,r.resourceclass
|
|
156
|
+ from t_resource r left join t_guide_resource gr on r.resourceid=gr.resourceid
|
|
157
|
+ where gr.guideid=#{guideid} order by gr.grid
|
|
158
|
+ </select>
|
|
159
|
+
|
|
160
|
+ <!--背诵-->
|
|
161
|
+ <select id="listReciteds" resultType="java.util.Map">
|
|
162
|
+ select r.reciteid,r.recitetitle,r.subjectid,r.createid,r.createtime,r.recitestate,r.recitecont
|
|
163
|
+ ,rg.starttime,rg.stoptime,count(DISTINCT rs.rsid) totalnum,
|
|
164
|
+ count(DISTINCT(if (rs.rsstate>0,rs.rsid,null))) commitnum
|
|
165
|
+ from t_recite r left join t_recite_group rg on r.reciteid=rg.reciteid
|
|
166
|
+ left join t_recite_student rs on r.reciteid=rs.reciteid and r.schoolid=rs.schoolid
|
|
167
|
+ where r.createid=#{userid} and r.recitestate=22 group by r.reciteid order by r.createtime desc limit #{limitSize}
|
|
168
|
+ </select>
|
|
169
|
+
|
|
170
|
+ <!--课堂回顾-->
|
|
171
|
+ <select id="listClassrooms" resultType="java.util.Map">
|
|
172
|
+ SELECT c.roomid,c.roomname,c.classid,g.classname,g.gradeid,c.createtime,c.endtime,
|
|
173
|
+ c.realstunum,u.username createname,c.classnum,d.directorname,
|
|
174
|
+ (select rfpath from t_classroom_file where roomid=c.roomid order by rfid limit 1) rfpath,
|
|
175
|
+ (select count(rs.asksid)+(select count(ps.psid) from t_classroom_paper p
|
|
176
|
+ left join t_classroom_paper_student ps on p.paperid=ps.paperid and ps.pschecked!=1 where p.roomid=c.roomid)
|
|
177
|
+ from t_classroom_askteacher rt
|
|
178
|
+ left join t_classroom_askstudent rs on rt.asktid=rs.asktid and rs.radiocorrect=0
|
|
179
|
+ where rt.roomid=c.roomid and rt.asktype between 32 and 33)wpynum
|
|
180
|
+ FROM t_classroom c LEFT JOIN t_class g ON c.classid=g.classid
|
|
181
|
+ left join t_user u on c.teacherid=u.userid
|
|
182
|
+ left join t_director d on c.directorid=d.directorid
|
|
183
|
+ WHERE d.disabled=0 and c.teacherid=#{userid}
|
|
184
|
+ ORDER BY c.createtime DESC limit #{limitSize}
|
|
185
|
+ </select>
|
|
186
|
+
|
|
187
|
+ <!--预习统计-班级-->
|
|
188
|
+ <select id="listGuidesStatisticClass" resultType="com.xhkjedu.sapi.vo.component.StudyStatisticVo">
|
|
189
|
+ select g.guideid as id,g.createtime,gg.classid,c.gradeid,c.classname
|
|
190
|
+ ,count(DISTINCT(gs.rgsid)) totalnum
|
|
191
|
+ ,count(DISTINCT(if(gs.readtime is not null,gs.rgsid,null))) commitnum
|
|
192
|
+ from t_guide_group gg left join t_guide g on gg.guideid=g.guideid and g.schoolid=gg.schoolid
|
|
193
|
+ left join t_class c on gg.classid=c.classid
|
|
194
|
+ left join t_guide_group_student gs on g.guideid=gs.guideid and gg.classid=gs.classid
|
|
195
|
+ where g.schoolid=#{params.schoolid} and g.createtime BETWEEN #{params.starttime} and #{params.stoptime}
|
|
196
|
+ <if test="params.usertype == 1"> and g.createid=#{params.userid}</if>
|
|
197
|
+ group by gg.rgid order by c.gradeid,c.classtype,c.classorder
|
|
198
|
+ </select>
|
|
199
|
+ <!--预习统计-科目-->
|
|
200
|
+ <select id="listGuidesStatisticSubject" resultType="com.xhkjedu.sapi.vo.component.StudyStatisticVo">
|
|
201
|
+ select g.guideid as id,g.createtime,g.subjectid,s.subjectname
|
|
202
|
+ ,count(DISTINCT(gs.rgsid)) totalnum
|
|
203
|
+ ,count(DISTINCT(if(gs.readtime is not null,gs.rgsid,null))) commitnum
|
|
204
|
+ from t_guide_group_student gs left join t_guide g on gs.guideid=g.guideid and gs.schoolid=g.schoolid
|
|
205
|
+ left join t_subject s on g.subjectid=s.subjectid
|
|
206
|
+ where g.schoolid=#{params.schoolid} and g.createtime BETWEEN #{params.starttime} and #{params.stoptime}
|
|
207
|
+ <if test="params.usertype == 1"> and g.createid=#{params.userid}</if>
|
|
208
|
+ group by g.guideid order by s.subjectorder
|
|
209
|
+ </select>
|
|
210
|
+
|
|
211
|
+ <!--作业统计-班级-->
|
|
212
|
+ <select id="listPapersStatisticClass" resultType="com.xhkjedu.sapi.vo.component.StudyStatisticVo">
|
|
213
|
+ select p.paperid as id,pc.createtime,pc.classid,c.gradeid,c.classname
|
|
214
|
+ ,count(DISTINCT(ps.psid)) totalnum
|
|
215
|
+ ,count(DISTINCT(if(ps.psstate>0,ps.psid,null))) commitnum
|
|
216
|
+ ,count(DISTINCT(if(ps.pschecked=1,ps.psid,null))) checknum
|
|
217
|
+ from t_paper_class pc left join t_paper p on pc.paperid=p.paperid and p.schoolid=pc.schoolid
|
|
218
|
+ left join t_class c on pc.classid=c.classid
|
|
219
|
+ left join t_paper_student ps on ps.paperid=p.paperid and ps.classid=pc.classid
|
|
220
|
+ where p.schoolid=#{params.schoolid} and pc.pgstate=22 and pc.createtime BETWEEN #{params.starttime} and #{params.stoptime}
|
|
221
|
+ <if test="params.usertype == 1"> and p.createid=#{params.userid}</if>
|
|
222
|
+ group by pc.pcid order by c.gradeid,c.classtype,c.classorder
|
|
223
|
+ </select>
|
|
224
|
+
|
|
225
|
+ <!--作业统计-科目-->
|
|
226
|
+ <select id="listPapersStatisticSubject" resultType="com.xhkjedu.sapi.vo.component.StudyStatisticVo">
|
|
227
|
+ select p.paperid as id,pc.createtime,p.subjectid,s.subjectname
|
|
228
|
+ ,count(DISTINCT(ps.psid)) totalnum
|
|
229
|
+ ,count(DISTINCT(if(ps.psstate>0,ps.psid,null))) commitnum
|
|
230
|
+ ,count(DISTINCT(if(ps.pschecked=1,ps.psid,null))) checknum
|
|
231
|
+ from t_paper_student ps left join t_paper p on ps.paperid=p.paperid and ps.schoolid=p.schoolid
|
|
232
|
+ left join t_paper_class pc on pc.paperid=p.paperid and pc.schoolid=p.schoolid
|
|
233
|
+ left join t_subject s on p.subjectid=s.subjectid
|
|
234
|
+ where p.schoolid=#{params.schoolid} and pc.pgstate=22 and pc.createtime BETWEEN #{params.starttime} and #{params.stoptime}
|
|
235
|
+ <if test="params.usertype == 1"> and p.createid=#{params.userid}</if>
|
|
236
|
+ group by p.paperid order by s.subjectorder
|
|
237
|
+ </select>
|
|
238
|
+
|
|
239
|
+ <!--直播巡课-->
|
|
240
|
+ <select id="listLivePatrol" resultType="java.util.Map">
|
|
241
|
+ select cs.sectiondate as timestr,count(distinct cs.sectionid)as num,
|
|
242
|
+ count(distinct case when cs.sectionstate=0 then cs.sectionid else null end)wksnum,
|
|
243
|
+ count(distinct case when cs.sectionstate=2 then cs.sectionid else null end)jxznum,
|
|
244
|
+ count(distinct case when cs.sectionstate=3 then cs.sectionid else null end)yjsnum,
|
|
245
|
+ count(distinct case when cs.sectionstate=4 then cs.sectionid else null end)ygqnum
|
|
246
|
+ from l_course_section cs left join l_course c on cs.courseid=c.courseid
|
|
247
|
+ <if test="params.usertype == 1 and params.classids!=null and params.classids!=''">
|
|
248
|
+ left join l_course_class cc on cc.courseid=c.courseid
|
|
249
|
+ </if>
|
|
250
|
+ where c.deleted=1 and c.schoolid=#{params.schoolid}
|
|
251
|
+ and cs.sectiondate=#{params.todayDate}
|
|
252
|
+ <if test="params.usertype == 1 and params.classids!=null and params.classids!=''">
|
|
253
|
+ and cc.classid in (${params.classids})
|
|
254
|
+ </if>
|
|
255
|
+ <if test="params.usertype==1">
|
|
256
|
+ and cs.teacherid=#{params.userid}
|
|
257
|
+ </if>
|
|
258
|
+ group by cs.sectionid
|
|
259
|
+ </select>
|
|
260
|
+
|
|
261
|
+ <!--教师直播-->
|
|
262
|
+ <select id="listLiveTeachers" resultType="java.util.Map">
|
|
263
|
+ select c.courseid,c.gradeid,c.stunum,c.comm,c.classid,s.subjectname,u.username teachername,u.headpic,
|
|
264
|
+ (select t.typename from l_course_type t where t.ctypeid=c.ctypeid)typename,
|
|
265
|
+ cs.sectionid,cs.sectionname,cs.sectiondate,cs.teacherid,cs.stunum cynum ,cs.planbegintime,cs.planendtime,cs.sectionstate,
|
|
266
|
+ cs.begintime,cs.endtime,
|
|
267
|
+ timestampdiff(second,CONCAT(cs.sectiondate,' ',cs.planbegintime),CONCAT(cs.sectiondate,' ',cs.planendtime)) totaltime,
|
|
268
|
+ (select count(*) from l_course_section_playback p where p.sectionid=cs.sectionid and p.pb is not null)playnum
|
|
269
|
+ from l_course_section cs left join l_course c on cs.courseid = c.courseid
|
|
270
|
+ left join t_subject s on c.subjectid=s.subjectid
|
|
271
|
+ left join t_user u on cs.teacherid=u.userid
|
|
272
|
+ where cs.teacherid=#{params.userid} and c.deleted=1 and cs.sectiondate=#{params.selectDate}
|
|
273
|
+ order by cs.sectionstate,abs(timestampdiff(second,concat(cs.sectiondate,' ',cs.planbegintime),#{params.todayDatetime})),
|
|
274
|
+ cs.sectionid limit #{params.limitSize}
|
|
275
|
+ </select>
|
|
276
|
+
|
|
277
|
+ <!--班级错题集-最近一次作业错题数量-->
|
|
278
|
+ <select id="getClassErrorQuesLastPaper" resultType="java.lang.Integer">
|
|
279
|
+ select count(qc.qcid) lastnum
|
|
280
|
+ from t_question_class qc left join t_paper p on qc.paperid=p.paperid
|
|
281
|
+ where p.deleted=0 and p.hasreport=1 and p.createid=#{params.userid} and qc.classid=#{params.classid} and qc.qctype!=3
|
|
282
|
+ group by p.paperid order by qc.createtime desc limit 1
|
|
283
|
+ </select>
|
|
284
|
+ <!--班级做提及-错题数量和错题讲解数量-->
|
|
285
|
+ <select id="getClassErrorQuesAndExplain" resultType="java.util.Map">
|
|
286
|
+ select count(DISTINCT qc.qcid) quesnum,count(DISTINCT qe.qcpid) explainnum
|
|
287
|
+ from t_question_class qc left join t_paper p on qc.paperid=p.paperid
|
|
288
|
+ left join t_question_explain qe on qc.questionid=qe.questionid
|
|
289
|
+ where p.deleted=0 and p.hasreport=1 and p.createid=#{params.userid} and qc.classid=#{params.classid}
|
|
290
|
+ and qc.createtime BETWEEN #{params.starttime} and #{params.stoptime}
|
|
291
|
+ order by qc.createtime desc
|
|
292
|
+ </select>
|
|
293
|
+
|
|
294
|
+ <!--我的班级-权限班级-->
|
|
295
|
+ <select id="listClassidsForTeacher" resultType="java.lang.Integer">
|
|
296
|
+ select c.classid
|
|
297
|
+ from t_class_teacher ct left join t_class c on ct.classid=c.classid
|
|
298
|
+ left join t_school s on c.schoolid=s.schoolid and c.`year`=s.`year`
|
|
299
|
+ where s.schoolid=#{params.schoolid} and ct.teacherid=#{params.userid} and c.classstate=1 and c.classtype in (1,2,3)
|
|
300
|
+ and c.classnum > 0
|
|
301
|
+ order by c.classtype,c.classorder
|
|
302
|
+ </select>
|
|
303
|
+ <!--我的班级-学生数量分组数量-->
|
|
304
|
+ <select id="listClassStuAndGroup" resultType="java.lang.Integer">
|
|
305
|
+ select count(DISTINCT studentid) stunum from t_class_student where classid in (${classidsStr})
|
|
306
|
+ UNION
|
|
307
|
+ select count(distinct groupid) groupnum from t_group where
|
|
308
|
+ (grouptype=1 or (grouptype=2 and createid=#{userid})) and
|
|
309
|
+ classid in (${classidsStr})
|
|
310
|
+ </select>
|
|
311
|
+
|
|
312
|
+ <!--校本题库-试题数量-->
|
|
313
|
+ <select id="getQuestionStatistic" resultType="java.util.Map">
|
|
314
|
+ select count(DISTINCT q.questionid) totalnum,
|
|
315
|
+ count(DISTINCT(if(DATE(FROM_UNIXTIME(q.createtime)) = CURDATE(),q.questionid,null))) todaynum
|
|
316
|
+ from t_question q
|
|
317
|
+ left join t_subject s on q.subjectid=s.subjectid and s.`level`=#{params.schoollevel}
|
|
318
|
+ where q.belong and (q.belong in(1,2) or (q.belong in(3,10) and q.schoolid=#{params.schoolid})) and q.qlevel < 3
|
|
319
|
+ </select>
|
|
320
|
+ <!--校本题库-当前学科试题数量-->
|
|
321
|
+ <select id="getQuestionStatisticSubejct" resultType="java.lang.Integer">
|
|
322
|
+ select count(DISTINCT q.questionid) subjectnum
|
|
323
|
+ from t_question q
|
|
324
|
+ left join t_teacher_powersb tp on q.subjectid = tp.subjectid
|
|
325
|
+ where tp.teacherid=#{params.userid} and q.belong and (q.belong in(1,2) or (q.belong in(3,10) and q.schoolid=#{params.schoolid})) and q.qlevel < 3
|
|
326
|
+ </select>
|
|
327
|
+
|
|
328
|
+ <!--教学统计-班级学生教师数量-->
|
|
329
|
+ <select id="getTeachingSchoolClassNum" resultType="java.util.Map">
|
|
330
|
+ SELECT COUNT(DISTINCT c.classid) AS classnum,count(DISTINCT s.studentid) studentnum,
|
|
331
|
+ (SELECT COUNT(*) FROM t_user WHERE schoolid=c.schoolid AND usertype=1 AND userstate=1) AS teachernum
|
|
332
|
+ FROM t_class c LEFT JOIN t_class_student s ON c.classid=s.classid
|
|
333
|
+ WHERE c.schoolid=#{params.schoolid} AND c.year=#{params.year} and c.classtype=1 and c.classstate=1
|
|
334
|
+ </select>
|
|
335
|
+ <!--教学统计-作业-->
|
|
336
|
+ <select id="listTeachingPapers" resultType="com.xhkjedu.sapi.vo.analyze.work.SchoolWorkSubjectVo">
|
|
337
|
+ SELECT p.subjectid,count(distinct p.paperid)fabunum,
|
|
338
|
+ count(distinct if(pg.starttime<=#{params.timestamp},ps1.psid,null))stunum,
|
|
339
|
+ count(distinct if(ps1.psstate in(1,2,4),ps1.psid,null)) commitnum,
|
|
340
|
+ count(distinct if(ps1.psstate in(1,2,4) and ps1.pschecked=1,ps1.psid,null)) checknum
|
|
341
|
+ FROM t_paper p
|
|
342
|
+ left join t_paper_class pg on p.paperid=pg.paperid
|
|
343
|
+ LEFT JOIN t_paper_student ps1 ON p.paperid=ps1.paperid and ps1.classid=pg.classid
|
|
344
|
+ LEFT JOIN t_class c ON pg.classid=c.classid
|
|
345
|
+ LEFT JOIN T_USER U ON p.createid=u.userid
|
|
346
|
+ left join t_director d on p.directorid=d.directorid
|
|
347
|
+ where p.deleted=0 and p.paperstate=22 AND p.schoolid=#{params.schoolid} AND pg.schoolid=#{params.schoolid}
|
|
348
|
+ and p.year=#{params.year} AND u.userstate=1 and (d.disabled=0 or p.directorid is null)
|
|
349
|
+ AND pg.starttime>=#{params.starttime} AND pg.stoptime <![CDATA[ <= ]]>#{params.stoptime}
|
|
350
|
+ GROUP BY p.subjectid
|
|
351
|
+ </select>
|
|
352
|
+ <!--教学统计-预习-->
|
|
353
|
+ <select id="listTeachingGuides" resultType="com.xhkjedu.sapi.vo.analyze.work.SchoolWorkSubjectVo">
|
|
354
|
+ SELECT g.subjectid,count(distinct g.guideid)fabunum,
|
|
355
|
+ count(distinct ggs.rgsid)stunum,
|
|
356
|
+ count(distinct if(ggs.costtime!=0,ggs.rgsid,null)) commitnum
|
|
357
|
+ FROM t_guide g left join t_guide_group_student ggs on ggs.guideid=g.guideid
|
|
358
|
+ LEFT JOIN t_class c ON ggs.classid=c.classid
|
|
359
|
+ LEFT JOIN T_USER U ON g.createid=u.userid
|
|
360
|
+ left join t_director d on g.directorid=d.directorid
|
|
361
|
+ where d.disabled=0 and g.schoolid=#{params.schoolid} AND ggs.schoolid=#{params.schoolid}
|
|
362
|
+ and g.year=#{params.year} and u.userstate=1 AND g.createtime >= #{params.starttime} AND g.createtime <![CDATA[ <= ]]>#{params.stoptime}
|
|
363
|
+ GROUP BY g.subjectid
|
|
364
|
+ </select>
|
|
365
|
+ <!--教学统计-背诵-->
|
|
366
|
+ <select id="listTeachingRecites" resultType="com.xhkjedu.sapi.vo.analyze.work.SchoolWorkSubjectVo">
|
|
367
|
+ SELECT r.subjectid,count(distinct r.reciteid)fabunum,
|
|
368
|
+ count(distinct rs.rsid) stunum,
|
|
369
|
+ count(distinct if(rs.rsstate!=0,rs.rsid,null)) commitnum
|
|
370
|
+ FROM t_recite r left join t_recite_group rg on rg.reciteid=r.reciteid
|
|
371
|
+ LEFT JOIN t_recite_student rs ON rg.reciteid=rs.reciteid and rg.classid=rs.classid
|
|
372
|
+ LEFT JOIN t_class c ON rg.classid=c.classid
|
|
373
|
+ LEFT JOIN T_USER U ON r.createid=u.userid
|
|
374
|
+ WHERE r.recitestate=22 AND r.schoolid=#{params.schoolid} AND rg.schoolid=#{params.schoolid}
|
|
375
|
+ and r.year=#{params.year} AND u.userstate=1 AND rg.starttime>=#{params.starttime} AND rg.starttime <![CDATA[ <= ]]>#{params.stoptime}
|
|
376
|
+ GROUP BY r.subjectid
|
|
377
|
+ </select>
|
|
378
|
+
|
|
379
|
+ <!--常用应用-->
|
|
380
|
+ <select id="listUserModules" resultType="java.util.Map">
|
|
381
|
+ SELECT um.umid, um.moduleid,m.modulename,m.moduleurl,m.moduleico,m.minout,m.mabbrevname
|
|
382
|
+ FROM t_user_module um LEFT JOIN t_module m ON um.moduleid=m.moduleid
|
|
383
|
+ WHERE um.userid=#{params.userid} and m.display=1
|
|
384
|
+ <if test="params.belongcode!=null and params.belongcode==1">and um.belongcode in (1,3)</if>
|
|
385
|
+ <if test="params.belongcode!=null and params.belongcode==2">and um.belongcode in (2,3)</if>
|
|
386
|
+ ORDER BY um.umorder
|
|
387
|
+ </select>
|
|
388
|
+
|
|
389
|
+ <!--考试-待出卷-->
|
|
390
|
+ <select id="listExamPaperGiv" resultType="java.util.Map">
|
|
391
|
+ select es.esid,es.subjectid,es.subjectname,es.sdate,es.begintime,es.endtime,es.teacherid,u2.username as teachername,
|
|
392
|
+ es.esstate ,ep.epid,ep.ptype,ep.pnum,ep.pscore,ep.answered,ep.handleid,u.username as handlename,
|
|
393
|
+ ep.scantronpdf,es.examid,e.examname,e.examtype,e.exammode,e.examstate,e.hashb,e.schoolid
|
|
394
|
+ from e_subject es left join e_paper ep on es.esid=ep.esid
|
|
395
|
+ left join e_base e on es.examid=e.examid
|
|
396
|
+ left join t_user u on ep.handleid=u.userid
|
|
397
|
+ left join t_user u2 on es.teacherid=u2.userid
|
|
398
|
+ where e.deleted=1 and es.teacherid=#{params.userid}
|
|
399
|
+ group by es.esid
|
|
400
|
+ order by abs(timediff(concat(es.sdate,' ',es.begintime),#{params.todayDatetime})) limit #{params.limitSize}
|
|
401
|
+ </select>
|
|
402
|
+ <!--考试-待批阅-->
|
|
403
|
+ <select id="listExamPaperCheck" resultType="java.util.Map">
|
|
404
|
+ select a.*,eb.examname,eb.gradeid,eb.examtype,eb.examstate,eb.hashb,eb.schoolid,es.sdate,es.begintime,es.endtime,es.subjectname
|
|
405
|
+ ,truncate(a.pynum*100/a.tjnum,2)pgrate
|
|
406
|
+ from(select p.esid,p.epid,group_concat(distinct concat(psq.qn,'_',psq.eptqid) order by psq.eptqid)qns
|
|
407
|
+ ,group_concat(distinct pc.classid)classids
|
|
408
|
+ ,count(case when psq.answered=1 then psq.epsqid else null end)tjnum
|
|
409
|
+ ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
|
|
410
|
+ from e_paper p left join e_paper_correctclass pc on p.epid = pc.epid
|
|
411
|
+ left join e_paper_student_question psq on psq.classid=pc.classid and psq.epid=p.epid
|
|
412
|
+ where pc.teacherid=#{params.userid} and psq.ctype in(3,13,14,15) group by p.epid
|
|
413
|
+ union
|
|
414
|
+ select p.esid,p.epid,group_concat(distinct concat(pq.qn,'_',pq.eptqid) order by pq.eptqid)qns
|
|
415
|
+ ,'' classids
|
|
416
|
+ ,count(case when psq.answered=1 then psq.epsqid else null end)tjnum
|
|
417
|
+ ,count(case when psq.answered=1 and psq.checked=2 then psq.epsqid else null end)pynum
|
|
418
|
+ from e_paper p left join e_paper_correctquestion pq on p.epid = pq.epid
|
|
419
|
+ left join e_paper_student_question psq on psq.eptqid=pq.eptqid
|
|
420
|
+ where pq.teacherid=#{params.userid} group by p.epid)a left join e_subject es on a.esid = es.esid
|
|
421
|
+ left join e_base eb on es.examid = eb.examid
|
|
422
|
+ where a.tjnum!=a.pynum and eb.deleted=1 limit #{params.limitSize}
|
|
423
|
+ </select>
|
|
424
|
+ <!--考试-待监考-->
|
|
425
|
+ <select id="listExamInvigilate" resultType="java.util.Map">
|
|
426
|
+ select es.*,count(eps.epsid)examnum
|
|
427
|
+-- ,count(if(eps.sstate in(0,3), eps.epsid, null)) wjcnum
|
|
428
|
+-- ,count(if(eps.sstate in(1,2), eps.epsid, null))jcnum
|
|
429
|
+ ,truncate(count(if(eps.sstate in(1,2), eps.epsid, null))*100/count(eps.epsid),2) jcrate
|
|
430
|
+-- ,count(if(eps.sstate=2, eps.epsid, null))tjnum
|
|
431
|
+-- ,count(if(eps.sstate=3, eps.epsid, null))qknum
|
|
432
|
+ from(select es.esid,es.sdate,es.begintime,es.endtime,es.esstate,es.subjectname,es.pstate
|
|
433
|
+ ,eb.examname,eb.gradeid,eb.examtype,eb.examstate,eb.hashb,eb.schoolid,max(ei.majored)majored
|
|
434
|
+ ,(if(max(ei.majored)=0, group_concat(distinct ei.classid), group_concat(distinct ec.classid)))classids
|
|
435
|
+ ,concat('[',group_concat(distinct json_object('classid',ec.classid,'classname',ec.classname
|
|
436
|
+ ,'schoolid',ec.schoolid,'schoolname',s.schoolname)),']')classnames
|
|
437
|
+ from e_subject_invigilate ei left join e_subject es on ei.esid=es.esid
|
|
438
|
+ left join e_base eb on eb.examid = es.examid
|
|
439
|
+ left join e_class ec on eb.examid = ec.examid
|
|
440
|
+ left join t_school s on ec.schoolid = s.schoolid
|
|
441
|
+ where eb.deleted=1 and eb.examstate!=0 and eb.exammode=1 and eb.monitored=1
|
|
442
|
+ and ei.teacherid=#{params.userid} and es.pstate!=2
|
|
443
|
+ group by es.esid having classids is not null
|
|
444
|
+ )es left join e_paper_student eps on es.esid = eps.esid and find_in_set(eps.classid,es.classids)
|
|
445
|
+ group by es.esid
|
|
446
|
+ order by abs(timediff(concat(es.sdate,' ',es.begintime),#{params.todayDatetime})) limit #{params.limitSize}
|
|
447
|
+ </select>
|
|
448
|
+ <!--考试-校级报告-获取最近一次生成报告的考试-->
|
|
449
|
+ <select id="getExamReportSchoolBase" resultType="java.util.Map">
|
|
450
|
+ select re.* from e_base e left join e_rbase re on e.examid=re.examid
|
|
451
|
+ where e.schoolid=#{schoolid} and e.deleted=1 and e.examstate=3 order by examdate desc limit 1
|
|
452
|
+ </select>
|
|
453
|
+ <!--考试-校级报告-成绩概况-->
|
|
454
|
+ <select id="listExamReportSchoolStatistic" resultType="java.util.Map">
|
|
455
|
+ select rs.subjectid, rs.subjectname, score, maxscore, minscore, avgscore, stunum, missnum, yxrate, lhrate, jgrate, dfrate, bzc
|
|
456
|
+ from e_rsubject rs left join e_subject es on rs.examid = es.examid and rs.subjectid=es.subjectid
|
|
457
|
+ where rs.examid=#{examid}
|
|
458
|
+ order by es.begintime,es.esid
|
|
459
|
+ </select>
|
|
460
|
+
|
|
461
|
+ <!--考试-考试报告-班级参与班级-->
|
|
462
|
+ <select id="listExamReportClass" resultType="java.util.Map">
|
|
463
|
+ select ec.classid,c.gradeid,c.classname from e_class ec left join t_class c on ec.classid=c.classid
|
|
464
|
+ left join t_class_teacher ct on ec.classid = ct.classid
|
|
465
|
+ where examid=#{examid} and ct.teacherid=#{userid} group by ec.classid order by c.classorder,c.classid
|
|
466
|
+ </select>
|
|
467
|
+
|
|
468
|
+ <!--考试-班级报告-考试信息-->
|
|
469
|
+ <select id="getExamReportClassInfo" resultType="com.xhkjedu.sapi.vo.component.ExamInfoVo">
|
|
470
|
+ select e.examid,e.teashowrank,c.classid,c.classname
|
|
471
|
+ from e_base e left join e_class c on e.examid=c.examid
|
|
472
|
+ left join t_class_teacher ct on c.classid=ct.classid
|
|
473
|
+ where e.examstate=3 and e.deleted=1 and ct.teacherid=#{params.userid} and c.schoolid=#{params.schoolid}
|
|
474
|
+ group by e.examid order by e.examdate desc limit 1
|
|
475
|
+ </select>
|
|
476
|
+ <!--考试-班级报告-学科成绩对比-->
|
|
477
|
+ <select id="listExamReportClassScore" resultType="java.util.Map">
|
|
478
|
+ select er.allscore,er.classmaxscore,er.classminscore,er.classavgscore,er.schoolmaxscore,er.schoolavgscore
|
|
479
|
+ ,er.stunum,er.missnum,er.yxrate,er.lhrate,er.jgrate,er.dfrate,er.bzc,er.qkbzc
|
|
480
|
+ ,er.classid,(case when er.classid=0 then '全部班级' else ec.classname end)classname
|
|
481
|
+ ,(case when er.subjectid='zf' then '总分' else (select s.subjectname from t_subject s where
|
|
482
|
+ er.subjectid=s.subjectid) end)subjectname
|
|
483
|
+ from e_rclass er left join e_class ec on er.examid = ec.examid and er.classid = ec.classid
|
|
484
|
+ left join e_subject es on ec.examid = es.examid and er.subjectid=es.subjectid
|
|
485
|
+ where er.examid=#{params.examid} and er.classid=#{params.classid}
|
|
486
|
+ order by es.begintime,es.esid
|
|
487
|
+ </select>
|
|
488
|
+ <!--考试-单科报告-单科考试信息-->
|
|
489
|
+ <select id="getExamReportSingleInfo" resultType="com.xhkjedu.sapi.vo.component.ExamInfoVo">
|
|
490
|
+ select e.examid,e.teashowrank,e.stushowrank,s.subjectid,c.classid from e_base e
|
|
491
|
+ left join e_subject s on e.examid=s.examid
|
|
492
|
+ left join t_teacher_powersb tp on tp.teacherid=#{params.userid} and tp.subjectid=s.subjectid
|
|
493
|
+ left join e_class c on e.examid=c.examid
|
|
494
|
+ left join t_class_teacher ct on c.classid=ct.classid and tp.teacherid=ct.teacherid
|
|
495
|
+ where e.examstate=3 and e.deleted=1 and ct.teacherid=#{params.userid}
|
|
496
|
+ and c.schoolid=#{params.schoolid}
|
|
497
|
+ group by e.examid order by e.examdate desc,e.examid desc limit 1
|
|
498
|
+ </select>
|
|
499
|
+ <!--考试-单科报告-单科概况-->
|
|
500
|
+ <select id="getExamReportSingleBase" resultType="java.util.Map">
|
|
501
|
+ select er.stunum,er.yxrate,er.jgrate,er.lhrate,er.dfrate
|
|
502
|
+ <if test="params.showrank==0">
|
|
503
|
+ ,0 classmaxscore,0 classavgscore,0 classminscore,0 classavgscorerank,0 schoolmaxscore,0 schoolavgscore
|
|
504
|
+ </if>
|
|
505
|
+ <if test="params.showrank==1">
|
|
506
|
+ ,er.classmaxscore,er.classavgscore,er.classminscore,0 classavgscorerank,er.schoolmaxscore,er.schoolavgscore
|
|
507
|
+ </if>
|
|
508
|
+ <if test="params.showrank==2 or params.showrank==3">
|
|
509
|
+ ,er.classmaxscore,er.classavgscore,er.classminscore,er.classavgscorerank,er.schoolmaxscore,er.schoolavgscore
|
|
510
|
+ </if>
|
|
511
|
+ from e_rclass er
|
|
512
|
+ where er.examid=#{params.examid} and er.classid=#{params.classid} and er.subjectid=#{params.subjectid}
|
|
513
|
+ limit 1
|
|
514
|
+ </select>
|
|
515
|
+ <!--考试-单科报告-成绩等级分布-->
|
|
516
|
+ <select id="listExamReportSingleRank" resultType="java.util.Map">
|
|
517
|
+ select err.ranktype,err.rankname,err.stunum,err.stujson,err.sturate,er.minscore,er.maxscore
|
|
518
|
+ ,(case when er.linescore is null then '' else concat(er.linescore,'-',er.floatscore) end)rankrange
|
|
519
|
+ from e_rclass_rank err left join e_rrank er on err.examid = er.examid and err.subjectid = er.subjectid
|
|
520
|
+ and er.ranktype=1 and er.rankname=err.rankname
|
|
521
|
+ where err.examid=#{params.examid} and err.classid=#{params.classid}
|
|
522
|
+ and err.subjectid=#{params.subjectid} and err.ranktype=1
|
|
523
|
+ </select>
|
|
524
|
+
|
142
|
525
|
</mapper>
|