|
@@ -23,30 +23,31 @@
|
23
|
23
|
</select>
|
24
|
24
|
<!--教师监考-监控列表-->
|
25
|
25
|
<select id="listJkSubject" resultType="java.util.Map">
|
26
|
|
- select es.esid,es.sdate,es.begintime,es.endtime,es.esstate,es.subjectname
|
27
|
|
- ,eb.examname,eb.gradeid,eb.examtype,sum(ec.classnum)examnum
|
|
26
|
+ select es.*,count(eps.epsid)examnum
|
28
|
27
|
,count(case when eps.sstate=0 then eps.epsid else null end) wjcnum
|
29
|
|
- ,count(case when eps.sstate=1 then eps.epsid else null end)jcnum
|
30
|
|
- ,truncate(count(case when eps.sstate=1 then eps.epsid else null end)*100/sum(ec.classnum),2) jcrate
|
|
28
|
+ ,count(case when eps.sstate!=0 then eps.epsid else null end)jcnum
|
|
29
|
+ ,truncate(count(case when eps.sstate!=0 then eps.epsid else null end)*100/count(eps.epsid),2) jcrate
|
31
|
30
|
,count(case when eps.sstate=2 then eps.epsid else null end)tjnum
|
32
|
31
|
,count(case when eps.sstate=3 then eps.epsid else null end)qknum
|
|
32
|
+ from(select es.esid,es.sdate,es.begintime,es.endtime,es.esstate,es.subjectname
|
|
33
|
+ ,eb.examname,eb.gradeid,eb.examtype
|
|
34
|
+ ,(case when max(ei.majored)=0 then group_concat(distinct ei.classid) else group_concat(distinct ec.classid) end)classids
|
33
|
35
|
from e_subject_invigilate ei left join e_subject es on ei.esid=es.esid
|
34
|
36
|
left join e_base eb on eb.examid = es.examid
|
35
|
37
|
left join e_class ec on eb.examid = ec.examid
|
36
|
|
- left join e_paper_student eps on es.esid = eps.esid
|
37
|
38
|
<where>
|
38
|
|
- <if test="teacherid!=null and teacherid!=0">
|
39
|
|
- and ei.teacherid=#{teacherid}
|
40
|
|
- </if>
|
41
|
|
- <if test="examid!=null and examid!=0">
|
42
|
|
- and es.examid=#{examid}
|
43
|
|
- </if>
|
44
|
|
- <if test="esstate==1">
|
45
|
|
- and concat(es.sdate,' ',es.endtime)>now()
|
46
|
|
- </if>
|
47
|
|
- <if test="esstate==2">
|
48
|
|
- and concat(es.sdate,' ',es.endtime)<=now()
|
49
|
|
- </if>
|
|
39
|
+ <if test="teacherid!=null and teacherid!=0">
|
|
40
|
+ and ei.teacherid=#{teacherid}
|
|
41
|
+ </if>
|
|
42
|
+ <if test="examid!=null and examid!=0">
|
|
43
|
+ and es.examid=#{examid}
|
|
44
|
+ </if>
|
|
45
|
+ <if test="esstate==1">
|
|
46
|
+ and concat(es.sdate,' ',es.endtime)>now()
|
|
47
|
+ </if>
|
|
48
|
+ <if test="esstate==2">
|
|
49
|
+ and concat(es.sdate,' ',es.endtime)<=now()
|
|
50
|
+ </if>
|
50
|
51
|
</where>
|
51
|
52
|
group by es.esid
|
52
|
53
|
<if test="esstate==1">
|
|
@@ -54,7 +55,7 @@
|
54
|
55
|
</if>
|
55
|
56
|
<if test="esstate==2">
|
56
|
57
|
order by es.sdate desc,es.endtime desc
|
57
|
|
- </if>
|
|
58
|
+ </if>)es left join e_paper_student eps on es.esid = eps.esid and eps.classid in(es.classids)
|
58
|
59
|
</select>
|
59
|
60
|
|
60
|
61
|
</mapper>
|