|
@@ -6,14 +6,14 @@
|
6
|
6
|
<foreach collection ="tasks" item="s" index= "index" separator =";">
|
7
|
7
|
insert into ms_paper_check_teacher_task (mpid, mblockid, teacherid, taskorder, mpsbid, checktype, createtime)
|
8
|
8
|
values (#{s.mpid},#{s.mblockid},#{s.teacherid},#{s.taskorder},#{s.mpsbid},#{s.checktype},#{s.createtime})
|
9
|
|
- on duplicate key update taskorder=#{s.taskorder},checktype=#{s.checktype}
|
|
9
|
+ on duplicate key update taskorder=#{s.taskorder},teacherid=#{s.teacherid}
|
10
|
10
|
</foreach>
|
11
|
11
|
</insert>
|
12
|
12
|
<!--保存或更新单个任务-->
|
13
|
13
|
<insert id="save">
|
14
|
14
|
insert into ms_paper_check_teacher_task (mpid, mblockid, teacherid, taskorder, mpsbid, checktype, createtime)
|
15
|
15
|
values (#{s.mpid},#{s.mblockid},#{s.teacherid},#{s.taskorder},#{s.mpsbid},#{s.checktype},#{s.createtime})
|
16
|
|
- on duplicate key update taskorder=#{s.taskorder},checktype=#{s.checktype}
|
|
16
|
+ on duplicate key update taskorder=#{s.taskorder},teacherid=#{s.teacherid}
|
17
|
17
|
</insert>
|
18
|
18
|
<!--批量更新任务信息-->
|
19
|
19
|
<update id="batchUpdate">
|
|
@@ -194,51 +194,52 @@
|
194
|
194
|
</select>
|
195
|
195
|
<!--教师阅卷-待/已阅卷列表-->
|
196
|
196
|
<select id="listCorrect" resultType="java.util.Map">
|
197
|
|
- select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype
|
198
|
|
- ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype
|
|
197
|
+ select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype,e.exammode
|
|
198
|
+ ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype,pc.correcttype
|
199
|
199
|
,truncate((count(distinct if(psb.firstcid = #{param.handleid} and psb.firstcime>0,psb.mpsbid,null))
|
200
|
200
|
+count(distinct if(pc.checktype=2 and psb.secondcid = #{param.handleid} and psb.secondctime>0,psb.mpsbid,null))
|
201
|
|
- )*100/count(distinct psb.mpsbid)*pc.checktype,2) as checkrate
|
|
201
|
+ )*100/count(distinct psb.mpsbid),2) as checkrate
|
202
|
202
|
from ms_subject s inner join ms_exam e on s.examid = e.examid
|
203
|
203
|
inner join ms_paper_check pc on pc.msid = s.msid
|
204
|
204
|
inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid
|
205
|
|
- inner join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid and psb.checked!=0
|
|
205
|
+ inner join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
|
206
|
206
|
where e.schoolid=#{param.schoolid} and s.checkstate=1 and e.deleted=1 and pc.dispenseway=2 and pc.correcttype=3
|
|
207
|
+ and (psb.checked=1 or (psb.checked in(2,3) and (psb.firstcid=#{param.handleid} or psb.secondcid=#{param.handleid})))
|
207
|
208
|
group by s.msid
|
208
|
209
|
<if test="param.checktype==0">having 100>checkrate</if>
|
209
|
210
|
<if test="param.checktype==1">having 100=checkrate</if>
|
210
|
211
|
union
|
211
|
|
- select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype
|
212
|
|
- ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype
|
213
|
|
- ,truncate((count(distinct if(psb.firstcid = #{param.handleid} and psb.firstcime>0,psb.mpsqid,null))
|
214
|
|
- +count(distinct if(pc.checktype=2 and psb.secondcid = #{param.handleid} and psb.secondctime>0,psb.mpsqid,null))
|
215
|
|
- )*100/count(distinct psb.mpsqid)*pc.checktype,2) as checkrate
|
|
212
|
+ select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype,e.exammode
|
|
213
|
+ ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype,pc.correcttype
|
|
214
|
+ ,truncate((count(distinct if(psb.firstcime>0 or psb.secondctime>0,psb.mpsqid,null))
|
|
215
|
+ )*100/count(distinct psb.mpsqid),2) as checkrate
|
216
|
216
|
from ms_subject s inner join ms_exam e on s.examid = e.examid
|
217
|
217
|
inner join ms_paper_check pc on pc.msid = s.msid
|
218
|
218
|
inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid
|
219
|
|
- inner join ms_paper_student_question psb on psb.mptqid = pc.mblockid and psb.mpid = pc.mpid and psb.checked!=0
|
|
219
|
+ inner join ms_paper_student_question psb on psb.mptqid = pc.mblockid and psb.mpid = pc.mpid
|
220
|
220
|
where e.schoolid=#{param.schoolid} and s.checkstate=1 and e.deleted=1 and pc.dispenseway=2 and pc.correcttype=2
|
|
221
|
+ and (psb.checked=1 or (psb.checked in(2,3) and (psb.firstcid=#{param.handleid} or psb.secondcid=#{param.handleid})))
|
221
|
222
|
group by s.msid
|
222
|
223
|
<if test="param.checktype==0">having 100>checkrate</if>
|
223
|
224
|
<if test="param.checktype==1">having 100=checkrate</if>
|
224
|
225
|
union
|
225
|
|
- select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype
|
226
|
|
- ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype
|
227
|
|
- ,truncate((count(distinct if(psb.firstcid = #{param.handleid} and psb.firstcime>0,psb.mpsqid,null))
|
228
|
|
- +count(distinct if(pc.checktype=2 and psb.secondcid = #{param.handleid} and psb.secondctime>0,psb.mpsqid,null))
|
229
|
|
- )*100/count(distinct psb.mpsqid)*pc.checktype,2) as checkrate
|
|
226
|
+ select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype,e.exammode
|
|
227
|
+ ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype,pc.correcttype
|
|
228
|
+ ,truncate((count(distinct if(psb.firstcime>0 or psb.secondctime>0,psb.mpsqid,null))
|
|
229
|
+ )*100/count(distinct psb.mpsqid),2) as checkrate
|
230
|
230
|
from ms_subject s inner join ms_exam e on s.examid = e.examid
|
231
|
231
|
inner join ms_paper_check pc on pc.msid = s.msid
|
232
|
232
|
inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid
|
233
|
233
|
inner join ms_class_student cs on cs.examid = e.examid and cs.subjectid = s.subjectid and cs.classid = pct.mblockid
|
234
|
|
- inner join ms_paper_student_question psb on psb.studentid = cs.studentid and psb.mpid = pc.mpid and psb.checked!=0
|
|
234
|
+ inner join ms_paper_student_question psb on psb.studentid = cs.studentid and psb.mpid = pc.mpid
|
235
|
235
|
where e.schoolid=#{param.schoolid} and s.checkstate=1 and e.deleted=1 and pc.dispenseway=2 and pc.correcttype=1
|
|
236
|
+ and (psb.checked=1 or (psb.checked in(2,3) and (psb.firstcid=#{param.handleid} or psb.secondcid=#{param.handleid})))
|
236
|
237
|
group by s.msid
|
237
|
238
|
<if test="param.checktype==0">having 100>checkrate</if>
|
238
|
239
|
<if test="param.checktype==1">having 100=checkrate</if>
|
239
|
240
|
union
|
240
|
|
- select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype
|
241
|
|
- ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype
|
|
241
|
+ select s.msid,s.subjectname,s.sdate,s.begintime,s.endtime,e.examname,e.gradeid,e.examtype,e.exammode
|
|
242
|
+ ,pc.mpid,pc.checktype,pc.dispenseway,pc.numtype,pc.correcttype
|
242
|
243
|
,truncate((count(distinct if(pctt.checkstate=3,pctt.mpcttid,null)))*100/count(distinct pctt.mpcttid),2) as checkrate
|
243
|
244
|
from ms_subject s inner join ms_exam e on s.examid = e.examid
|
244
|
245
|
inner join ms_paper_check pc on pc.msid = s.msid
|
|
@@ -255,13 +256,14 @@
|
255
|
256
|
<if test="param.correcttype==3">
|
256
|
257
|
select pb.blockname,pb.blockorder,pb.bqnum
|
257
|
258
|
,pc.mblockid,pc.checktype,pc.dispenseway,pc.numtype
|
258
|
|
- ,count(distinct psb.mpsbid)*pc.checktype as totalNum
|
259
|
|
- ,count(distinct if(psb.firstcime is not null,psb.mpsbid,null))+count(distinct if(psb.secondctime is not null,psb.mpsbid,null)) as totalCheckedNum
|
260
|
|
- ,count(distinct if(psb.firstcime is null,psb.mpsbid,null))+count(distinct if(pc.checktype=2 and psb.secondctime is null,psb.mpsbid,null)) as totalUncheckedNum
|
|
259
|
+ ,count(distinct psb.mpsbid) as totalNum
|
|
260
|
+ ,count(distinct if(psb.checked=3,psb.mpsbid,null)) as totalCheckedNum
|
|
261
|
+ ,count(distinct if(psb.checked in(1,2),psb.mpsbid,null)) as totalUncheckedNum
|
261
|
262
|
,count(distinct if((psb.firstcime is not null and psb.firstcid=#{param.handleid}) or (psb.secondctime is not null and psb.secondcid=#{param.handleid}),psb.mpsbid,null)) as myCheckedNum
|
262
|
263
|
,count(distinct if(((psb.firstcime is null and psb.firstcid=#{param.handleid})
|
263
|
|
- or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or pc.dispenseway=2) and psb.checked in(1,2)
|
|
264
|
+ or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or psb.checked=1)
|
264
|
265
|
,psb.mpsbid,null)) as myUncheckedNum
|
|
266
|
+ ,(select group_concat(pbbq.bqn separator '、') from ms_paper_block_question pbbq where pbbq.mblockid = pb.mblockid) as bqn
|
265
|
267
|
from ms_paper_check pc left join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
|
266
|
268
|
and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or pc.dispenseway=2)
|
267
|
269
|
inner join ms_paper_block pb on pc.mblockid = pb.mblockid and pb.mpid = pc.mpid
|
|
@@ -273,12 +275,12 @@
|
273
|
275
|
<if test="param.correcttype==2">
|
274
|
276
|
select pb.qorder,pb.qn
|
275
|
277
|
,pc.mblockid,pc.checktype,pc.dispenseway,pc.numtype
|
276
|
|
- ,count(distinct psb.mpsqid)*pc.checktype as totalNum
|
277
|
|
- ,count(distinct if(psb.firstcime>0,psb.mpsqid,null))+count(distinct if(psb.secondctime>0,psb.mpsqid,null)) as totalCheckedNum
|
278
|
|
- ,count(distinct if(psb.firstcime is null,psb.mpsqid,null))+count(distinct if(pc.checktype=2 and psb.secondctime is null,psb.mpsqid,null)) as totalUncheckedNum
|
|
278
|
+ ,count(distinct psb.mpsqid) as totalNum
|
|
279
|
+ ,count(distinct if(psb.checked=3,psb.mpsqid,null)) as totalCheckedNum
|
|
280
|
+ ,count(distinct if(psb.checked in(1,2),psb.mpsqid,null)) as totalUncheckedNum
|
279
|
281
|
,count(distinct if((psb.firstcime>0 and psb.firstcid=#{param.handleid}) or (psb.secondctime>0 and psb.secondcid=#{param.handleid}),psb.mpsqid,null)) as myCheckedNum
|
280
|
282
|
,count(distinct if(((psb.firstcime is null and psb.firstcid=#{param.handleid})
|
281
|
|
- or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or pc.dispenseway=2) and psb.checked in(1,2)
|
|
283
|
+ or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or psb.checked=1)
|
282
|
284
|
,psb.mpsqid,null)) as myUncheckedNum
|
283
|
285
|
from ms_paper_check pc left join ms_paper_student_question psb on psb.mptqid = pc.mblockid and psb.mpid = pc.mpid
|
284
|
286
|
and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or pc.dispenseway=2) and psb.answered=1
|
|
@@ -292,17 +294,17 @@
|
292
|
294
|
select c.classname,c.classtype
|
293
|
295
|
,pc.mblockid,pc.checktype,pc.dispenseway,pc.numtype
|
294
|
296
|
,count(distinct psb.mpsqid)*pc.checktype as totalNum
|
295
|
|
- ,count(distinct if(psb.firstcime is not null,psb.mpsqid,null))+count(distinct if(psb.secondctime is not null,psb.mpsqid,null)) as totalCheckedNum
|
296
|
|
- ,count(distinct if(psb.firstcime is null,psb.mpsqid,null))+count(distinct if(pc.checktype=2 and psb.secondctime is null,psb.mpsqid,null)) as totalUncheckedNum
|
|
297
|
+ ,count(distinct if(psb.checked=3,psb.mpsqid,null)) as totalCheckedNum
|
|
298
|
+ ,count(distinct if(psb.checked in(1,2),psb.mpsqid,null)) as totalUncheckedNum
|
297
|
299
|
,count(distinct if((psb.firstcime is not null and psb.firstcid=#{param.handleid}) or (psb.secondctime is not null and psb.secondcid=#{param.handleid}),psb.mpsqid,null)) as myCheckedNum
|
298
|
300
|
,count(distinct if(((psb.firstcime is null and psb.firstcid=#{param.handleid})
|
299
|
|
- or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or pc.dispenseway=2) and psb.checked in(1,2)
|
|
301
|
+ or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or psb.checked=1)
|
300
|
302
|
,psb.mpsqid,null)) as myUncheckedNum
|
301
|
303
|
from ms_paper_check pc inner join ms_class c on pc.mblockid = c.classid
|
302
|
304
|
inner join ms_class_student cs on c.examid=cs.examid and c.subjectid=cs.subjectid and pc.mblockid=cs.classid
|
303
|
305
|
inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid and pct.teacherid = #{param.handleid}
|
304
|
306
|
left join ms_paper_student_question psb on psb.mpid = pc.mpid and psb.studentid=cs.studentid and psb.answered=1 and psb.ctype in(3,13,14,15)
|
305
|
|
- and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or pc.dispenseway=2)
|
|
307
|
+ and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or psb.checked=1)
|
306
|
308
|
where pc.mpid=#{param.mpid} and c.subjectid=#{param.subjectid}
|
307
|
309
|
group by c.classid
|
308
|
310
|
order by c.mcid
|
|
@@ -576,23 +578,23 @@
|
576
|
578
|
</if>
|
577
|
579
|
<if test="param.dispenseway!=null and param.dispenseway==2">
|
578
|
580
|
<if test="param.correcttype==3">
|
579
|
|
- select count(psb.mpsbid*#{param.checktype}) as tasknum
|
|
581
|
+ select count(psb.mpsbid) as tasknum
|
580
|
582
|
,count(if(pctt.checkstate=3,1,null)) as checkednum
|
581
|
583
|
from ms_paper_student_block psb left join ms_paper_check_teacher_task pctt on psb.mpid=pctt.mpid and pctt.teacherid=#{param.teacherid} and psb.mpsbid=pctt.mpsbid
|
582
|
|
- where psb.mpid=#{param.mpid} and psb.mblockid=#{param.mblockid}
|
|
584
|
+ where psb.mpid=#{param.mpid} and psb.mblockid=#{param.mblockid} and psb.checked!=0
|
583
|
585
|
</if>
|
584
|
586
|
<if test="param.correcttype==2">
|
585
|
|
- select count(psb.mpsqid*#{param.checktype}) as tasknum
|
|
587
|
+ select count(psb.mpsqid) as tasknum
|
586
|
588
|
,count(if(pctt.checkstate=3,1,null)) as checkednum
|
587
|
589
|
from ms_paper_student_question psb left join ms_paper_check_teacher_task pctt on psb.mpid=pctt.mpid and pctt.teacherid=#{param.teacherid} and psb.mpsqid=pctt.mpsbid
|
588
|
|
- where psb.mpid=#{param.mpid} and psb.mptqid=#{param.mblockid}
|
|
590
|
+ where psb.mpid=#{param.mpid} and psb.mptqid=#{param.mblockid} and psb.checked!=0
|
589
|
591
|
</if>
|
590
|
592
|
<if test="param.correcttype==1">
|
591
|
|
- select count(psb.mpsqid*#{param.checktype}) as tasknum
|
|
593
|
+ select count(psb.mpsqid) as tasknum
|
592
|
594
|
,count(if(pctt.checkstate=3,1,null)) as checkednum
|
593
|
595
|
from ms_paper_student_question psb left join ms_paper_check_teacher_task pctt on psb.mpid=pctt.mpid and pctt.teacherid=#{param.teacherid} and psb.mpsqid=pctt.mpsbid
|
594
|
596
|
inner join ms_class_student cs on psb.examid=cs.examid and psb.subjectid=cs.subjectid and psb.studentid=cs.studentid
|
595
|
|
- where psb.mpid=#{param.mpid} and psb.mptqid=#{param.mptqid} and cs.classid=#{param.mblockid}
|
|
597
|
+ where psb.mpid=#{param.mpid} and psb.mptqid=#{param.mptqid} and cs.classid=#{param.mblockid} and psb.checked!=0
|
596
|
598
|
</if>
|
597
|
599
|
</if>
|
598
|
600
|
</select>
|