|
@@ -29,6 +29,18 @@
|
29
|
29
|
#{item.mpcttid}
|
30
|
30
|
</foreach>
|
31
|
31
|
</update>
|
|
32
|
+ <!--更新教师阅卷任务状态-->
|
|
33
|
+ <update id="updateCheckStatus">
|
|
34
|
+ update ms_paper_check_teacher_task
|
|
35
|
+ set checkstate = #{checkstate}
|
|
36
|
+ where mpid=#{mpid} and mpsbid=#{mpsbid} and teacherid=#{teacherid}
|
|
37
|
+ </update>
|
|
38
|
+ <!--教师批阅-批阅试题-->
|
|
39
|
+ <update id="correct">
|
|
40
|
+ update ms_paper_check_teacher_task
|
|
41
|
+ set checkstate = 3,checkscore = #{checkscore}
|
|
42
|
+ where mpid=#{mpid} and mpsbid=#{mpsbid} and teacherid=#{teacherid}
|
|
43
|
+ </update>
|
32
|
44
|
<!--删除教师阅卷任务-->
|
33
|
45
|
<delete id="deleteByMpsbids">
|
34
|
46
|
delete from ms_paper_check_teacher_task where mpsbid in (${mpsbids})
|
|
@@ -101,30 +113,65 @@
|
101
|
113
|
<!--阅卷进度-按教师-->
|
102
|
114
|
<resultMap id="teacherResultMap" type="java.util.Map">
|
103
|
115
|
<id property="teacherid" column="teacherid"/>
|
104
|
|
- <id property="teachername" column="teachername"/>
|
105
|
|
- <collection property="blocks" ofType="java.util.Map">
|
|
116
|
+ <result property="teachername" column="teachername"/>
|
|
117
|
+ <collection property="blocks" ofType="java.util.Map" javaType="java.util.List">
|
106
|
118
|
<id property="mblockid" column="mblockid"/>
|
107
|
|
- <id property="blockname" column="blockname"/>
|
108
|
|
- <id property="totalNum" column="total_num"/>
|
109
|
|
- <id property="checkedNum" column="checked_num"/>
|
110
|
|
- <id property="uncheckedNum" column="uncheck_num"/>
|
|
119
|
+ <result property="qorder" column="qorder"/>
|
|
120
|
+ <result property="qn" column="qn"/>
|
|
121
|
+ <result property="blockname" column="blockname"/>
|
|
122
|
+ <result property="totalNum" column="total_num"/>
|
|
123
|
+ <result property="checkedNum" column="checked_num"/>
|
|
124
|
+ <result property="uncheckedNum" column="uncheck_num"/>
|
111
|
125
|
</collection>
|
112
|
126
|
</resultMap>
|
113
|
127
|
<select id="listByTeacher" resultMap="teacherResultMap">
|
114
|
|
- select pct.teacherid,u.username as teachername
|
115
|
|
- ,if(pc.dispenseway=2,count(psb.mpsbid)*pc.checktype
|
116
|
|
- ,count(if(psb.firstcid=pct.teacherid or psb.secondcid=pct.teacherid,psb.mpsbid,null))
|
117
|
|
- ) as total_num
|
118
|
|
- ,count(if((psb.firstcid=pct.teacherid and psb.firstcime>0) or (psb.secondcid=pct.teacherid and psb.secondctime>0),psb.mpsbid,null)) as checked_num
|
119
|
|
- ,count(if((psb.firstcid=pct.teacherid and psb.firstcime=0) or (psb.secondcid=pct.teacherid and psb.secondctime=0),psb.mpsbid,null)) as uncheck_num
|
120
|
|
- ,pct.mblockid,pb.blockname
|
121
|
|
- from ms_paper_check_teacher pct left join t_user u on u.userid = pct.teacherid
|
122
|
|
- left join ms_paper_block pb on pct.mblockid = pb.mblockid
|
123
|
|
- left join ms_paper_check pc on pct.mblockid = pc.mblockid
|
124
|
|
- left join ms_paper_student_block psb on psb.mblockid = pct.mblockid
|
125
|
|
- where pct.mpid=#{mpid}
|
126
|
|
- group by pct.teacherid,pct.mblockid
|
127
|
|
- order by teachername,pb.blockorder
|
|
128
|
+ <if test="correcttype==1">
|
|
129
|
+ select pct.teacherid,u.username as teachername
|
|
130
|
+ ,if(pc.dispenseway=2,count(psb.mpsqid)*pc.checktype
|
|
131
|
+ ,count(if(psb.firstcid=pct.teacherid or psb.secondcid=pct.teacherid,psb.mpsqid,null))
|
|
132
|
+ ) as total_num
|
|
133
|
+ ,count(if((psb.firstcid=pct.teacherid and psb.firstcime>0) or (psb.secondcid=pct.teacherid and psb.secondctime>0),psb.mpsqid,null)) as checked_num
|
|
134
|
+ ,count(if((psb.firstcid=pct.teacherid and psb.firstcime=0) or (psb.secondcid=pct.teacherid and psb.secondctime=0),psb.mpsqid,null)) as uncheck_num
|
|
135
|
+ ,psb.mptqid as mblockid,psb.qorder,psb.qn
|
|
136
|
+ from ms_paper_check_teacher pct left join t_user u on u.userid = pct.teacherid
|
|
137
|
+ left join ms_paper_check pc on pct.mblockid = pc.mblockid and pct.mpid = pc.mpid
|
|
138
|
+ left join ms_paper_student_question psb on pct.mpid = psb.mpid
|
|
139
|
+ inner join ms_class c on c.examid=psb.examid and c.subjectid=psb.subjectid and c.classid=pct.mblockid
|
|
140
|
+ where pct.mpid=#{mpid} and psb.ctype in (3, 13, 14, 15)
|
|
141
|
+ group by pct.teacherid,psb.mptqid
|
|
142
|
+ order by teachername,psb.qorder,psb.qn
|
|
143
|
+ </if>
|
|
144
|
+ <if test="correcttype==2">
|
|
145
|
+ select pct.teacherid,u.username as teachername
|
|
146
|
+ ,if(pc.dispenseway=2,count(psb.mpsqid)*pc.checktype
|
|
147
|
+ ,count(if(psb.firstcid=pct.teacherid or psb.secondcid=pct.teacherid,psb.mpsqid,null))
|
|
148
|
+ ) as total_num
|
|
149
|
+ ,count(if((psb.firstcid=pct.teacherid and psb.firstcime>0) or (psb.secondcid=pct.teacherid and psb.secondctime>0),psb.mpsqid,null)) as checked_num
|
|
150
|
+ ,count(if((psb.firstcid=pct.teacherid and psb.firstcime=0) or (psb.secondcid=pct.teacherid and psb.secondctime=0),psb.mpsqid,null)) as uncheck_num
|
|
151
|
+ ,pct.mblockid,psb.qorder,psb.qn
|
|
152
|
+ from ms_paper_check_teacher pct left join t_user u on u.userid = pct.teacherid
|
|
153
|
+ left join ms_paper_check pc on pct.mblockid = pc.mblockid and pct.mpid = pc.mpid
|
|
154
|
+ left join ms_paper_student_question psb on psb.mptqid = pct.mblockid and pct.mpid = psb.mpid
|
|
155
|
+ where pct.mpid=#{mpid}
|
|
156
|
+ group by pct.teacherid,pct.mblockid
|
|
157
|
+ order by teachername,psb.qorder,psb.qn
|
|
158
|
+ </if>
|
|
159
|
+ <if test="correcttype==3">
|
|
160
|
+ select pct.teacherid,u.username as teachername
|
|
161
|
+ ,if(pc.dispenseway=2,count(psb.mpsbid)*pc.checktype
|
|
162
|
+ ,count(if(psb.firstcid=pct.teacherid or psb.secondcid=pct.teacherid,psb.mpsbid,null))
|
|
163
|
+ ) as total_num
|
|
164
|
+ ,count(if((psb.firstcid=pct.teacherid and psb.firstcime>0) or (psb.secondcid=pct.teacherid and psb.secondctime>0),psb.mpsbid,null)) as checked_num
|
|
165
|
+ ,count(if((psb.firstcid=pct.teacherid and psb.firstcime=0) or (psb.secondcid=pct.teacherid and psb.secondctime=0),psb.mpsbid,null)) as uncheck_num
|
|
166
|
+ ,pct.mblockid,pb.blockname
|
|
167
|
+ from ms_paper_check_teacher pct left join t_user u on u.userid = pct.teacherid
|
|
168
|
+ left join ms_paper_block pb on pct.mblockid = pb.mblockid and pct.mpid = pb.mpid
|
|
169
|
+ left join ms_paper_check pc on pct.mblockid = pc.mblockid and pct.mpid = pc.mpid
|
|
170
|
+ left join ms_paper_student_block psb on psb.mblockid = pct.mblockid and pct.mpid = psb.mpid
|
|
171
|
+ where pct.mpid=#{mpid}
|
|
172
|
+ group by pct.teacherid,pct.mblockid
|
|
173
|
+ order by teachername,pb.blockorder
|
|
174
|
+ </if>
|
128
|
175
|
</select>
|
129
|
176
|
<!--教师阅卷-待批阅列表-->
|
130
|
177
|
<select id="listPending" resultType="java.util.Map">
|
|
@@ -138,7 +185,7 @@
|
138
|
185
|
from ms_subject s inner join ms_exam e on s.examid = e.examid
|
139
|
186
|
inner join ms_paper_check pc on pc.msid = s.msid
|
140
|
187
|
<if test="param.usertype==1 and param.handleid!=null">
|
141
|
|
- inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid
|
|
188
|
+ inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid
|
142
|
189
|
</if>
|
143
|
190
|
inner join ms_paper_student_block psb on psb.mblockid = pc.mblockid
|
144
|
191
|
where e.schoolid=#{param.schoolid} and s.checkstate=1 and e.deleted=1
|
|
@@ -161,10 +208,10 @@
|
161
|
208
|
,count(if((psb.firstcime=0 and psb.firstcid=#{param.handleid})
|
162
|
209
|
or (psb.secondctime=0 and psb.secondcid=#{param.handleid}) or pc.dispenseway=2
|
163
|
210
|
,psb.mpsbid,null)) as my_unchecked_num
|
164
|
|
- from ms_paper_check pc left join ms_paper_student_block psb on psb.mblockid = pc.mblockid
|
165
|
|
- inner join ms_paper_block pb on pc.mblockid = pb.mblockid
|
|
211
|
+ from ms_paper_check pc left join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
|
|
212
|
+ inner join ms_paper_block pb on pc.mblockid = pb.mblockid and pb.mpid = pc.mpid
|
166
|
213
|
<if test="param.usertype==1 and param.handleid!=null">
|
167
|
|
- inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.teacherid = #{param.handleid}
|
|
214
|
+ inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid and pct.teacherid = #{param.handleid}
|
168
|
215
|
and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or pc.dispenseway=2)
|
169
|
216
|
</if>
|
170
|
217
|
where pc.mpid=#{param.mpid}
|
|
@@ -172,7 +219,20 @@
|
172
|
219
|
order by pb.blockorder
|
173
|
220
|
</select>
|
174
|
221
|
<!--教师阅卷-题块列表-->
|
175
|
|
- <select id="listTeacherBlock" resultType="java.util.Map">
|
|
222
|
+ <resultMap id="teacherBlockResultMap" type="java.util.Map">
|
|
223
|
+ <result property="mblockid" column="mblockid"/>
|
|
224
|
+ <result property="blockname" column="blockname"/>
|
|
225
|
+ <result property="blockorder" column="blockorder"/>
|
|
226
|
+ <result property="bqnum" column="bqnum"/>
|
|
227
|
+ <collection property="questions" select="listQuestion" column="mblockid"/>
|
|
228
|
+ </resultMap>
|
|
229
|
+ <select id="listQuestion" resultType="java.util.Map">
|
|
230
|
+ select pbq.mbqid,pbq.mptqid,pbq.mbqtype,pbq.bqscore,pbq.bqorder,pbq.bqn
|
|
231
|
+ ,pbq.mergeqid,pbq.mergeqn,pbq.mergescore,pbq.scorestepway,pbq.scorestep
|
|
232
|
+ from ms_paper_block_question pbq where pbq.mblockid=#{mblockid}
|
|
233
|
+ order by pbq.bqn
|
|
234
|
+ </select>
|
|
235
|
+ <select id="listTeacherBlock" resultMap="teacherBlockResultMap">
|
176
|
236
|
select pct.mblockid,pb.blockname,pb.blockorder,pb.bqnum
|
177
|
237
|
from ms_paper_block pb inner join ms_paper_check_teacher pct on pb.mblockid = pct.mblockid
|
178
|
238
|
and pct.teacherid = #{param.handleid}
|
|
@@ -180,40 +240,39 @@
|
180
|
240
|
group by pb.mblockid
|
181
|
241
|
order by pb.blockorder
|
182
|
242
|
</select>
|
183
|
|
- <!--获取题块阅卷状态-->
|
184
|
|
- <select id="listPaperCheck" resultType="com.xhkjedu.smarking.model.papercheck.MsPaperCheck">
|
|
243
|
+ <!--教师阅卷-待批题块列表-->
|
|
244
|
+ <select id="listBlockCheck" resultType="com.xhkjedu.smarking.model.papercheck.MsPaperCheck">
|
185
|
245
|
select pc.mblockid,pc.checktype,pc.hidefirstscore,pc.scoreway,pc.finalscore,pc.roundvalue,pc.dispenseway,pc.numtype
|
186
|
|
- ,pc.checkstate
|
187
|
|
- from ms_paper_check pc inner join ms_paper_student_block psb on psb.mblockid = pc.mblockid
|
188
|
|
- inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.teacherid = #{param.handleid}
|
189
|
|
- where pc.checkstate=1 and psb.checked!=2 and pc.mblockid in
|
190
|
|
- <foreach collection="param.mblockids" item="mblockid" open="(" separator="," close=")">
|
191
|
|
- #{mblockid}
|
192
|
|
- </foreach>
|
|
246
|
+ ,pc.checkstate,pc.correcttype,pc.mpid
|
|
247
|
+ from ms_paper_check pc inner join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
|
|
248
|
+ inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid = pc.mpid and pct.teacherid = #{param.handleid}
|
|
249
|
+ where pc.checkstate=1 and psb.checked!=2 and pc.mpid=#{param.mpid}
|
|
250
|
+ group by pc.mblockid
|
193
|
251
|
order by pc.mpcid
|
194
|
252
|
</select>
|
195
|
|
- <!--获取待批试题(平均、定量分配)-->
|
|
253
|
+ <!--教师阅卷-按题块-获取待批试题-->
|
196
|
254
|
<select id="getCorrectBlock" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
|
197
|
|
- select pctt.mblockid,psb.mpsbid,psb.stuanswer,psb.checked
|
198
|
|
- ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime
|
199
|
|
- from ms_paper_student_block psb inner join ms_paper_check_teacher_task pctt on psb.mpsbid = pctt.mpsbid
|
200
|
|
- where pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.handleid}
|
201
|
|
- order by field(pctt.checkstate,2,1,3),pctt.taskorder
|
202
|
|
- limit 1
|
203
|
|
- </select>
|
204
|
|
- <!--获取待批试题(效率优先)-->
|
205
|
|
- <select id="getCorrectBlock2" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
|
206
|
|
- select pctt.mblockid,psb.mpsbid,psb.answertype,psb.stuanswer,psb.qscore,psb.checked
|
207
|
|
- ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime
|
208
|
|
- from ms_paper_student_block psb
|
209
|
|
- where psb.mblockid = #{param.mblockid}
|
210
|
|
- and (psb.checked=0 or psb.firstcid=#{param.handleid}
|
211
|
|
- <if test="param.checktype==2">
|
212
|
|
- or psb.secondcid=#{param.handleid}
|
213
|
|
- </if>
|
214
|
|
- )
|
215
|
|
- order by field(psb.checked,2,1,3),pctt.taskorder
|
216
|
|
- limit 1
|
|
255
|
+ <if test="param.dispenseway!=null and param.dispenseway!=2">
|
|
256
|
+ select pctt.mblockid,pctt.mpsbid,pctt.checktype,psb.stuanswer,psb.checked
|
|
257
|
+ ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime,psb.studentid
|
|
258
|
+ from ms_paper_student_block psb inner join ms_paper_check_teacher_task pctt on psb.mpsbid = pctt.mpsbid and psb.mpid=pctt.mpid
|
|
259
|
+ where pctt.mpid=#{param.mpid} and pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.teacherid}
|
|
260
|
+ order by field(pctt.checkstate,2,1,3),pctt.taskorder
|
|
261
|
+ limit 1
|
|
262
|
+ </if>
|
|
263
|
+ <if test="param.dispenseway!=null and param.dispenseway==2">
|
|
264
|
+ select psb.mblockid,psb.mpsbid,psb.answertype,psb.stuanswer,psb.qscore,psb.checked
|
|
265
|
+ ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime,psb.studentid
|
|
266
|
+ from ms_paper_student_block psb
|
|
267
|
+ where psb.mpid=#{param.mpid} and psb.mblockid = #{param.mblockid}
|
|
268
|
+ and (psb.checked=0 or (psb.checked=1 and (psb.firstcid=#{param.teacherid}
|
|
269
|
+ <if test="param.checktype==2">
|
|
270
|
+ or psb.secondcid=#{param.teacherid}
|
|
271
|
+ </if>
|
|
272
|
+ )))
|
|
273
|
+ order by field(psb.checked,1,0,2)
|
|
274
|
+ limit 1
|
|
275
|
+ </if>
|
217
|
276
|
</select>
|
218
|
277
|
<!--阅卷进度-按试题-->
|
219
|
278
|
<resultMap id="questionResultMap" type="java.util.Map">
|
|
@@ -239,4 +298,130 @@
|
239
|
298
|
group by q.mptqid
|
240
|
299
|
order by q.qorder,q.qn
|
241
|
300
|
</select>
|
|
301
|
+ <!--阅卷进度-按试题-查看详情-->
|
|
302
|
+ <select id="detailByQuestion" resultType="java.util.Map">
|
|
303
|
+ <if test="dispenseway!=null and dispenseway!=2">
|
|
304
|
+ select pctt.teacherid,u.username as teachername
|
|
305
|
+ ,count(pctt.mpcttid) as total_num,count(if(pctt.checkstate=3,1,null)) as checked_num
|
|
306
|
+ ,count(if(pctt.checkstate!=3,1,null))as uncheck_num
|
|
307
|
+ from ms_paper_check_teacher_task pctt left join t_user u on u.userid = pctt.teacherid
|
|
308
|
+ where pctt.mpid=#{mpid} and pctt.mblockid=#{mblockid}
|
|
309
|
+ group by pctt.teacherid
|
|
310
|
+ </if>
|
|
311
|
+ <if test="dispenseway!=null and dispenseway==2">
|
|
312
|
+ select t.teacherid,u.username as teachername
|
|
313
|
+ ,sum(t.total_num) as total_num,sum(t.checked_num) as checked_num,sum(t.uncheck_num) as uncheck_num
|
|
314
|
+ from(select psb.firstcid as teacherid,count(*) as total_num,count(if(psb.firstcime is not null,1,null)) as checked_num
|
|
315
|
+ ,count(if(psb.firstcime is null,1,null)) as uncheck_num
|
|
316
|
+ from ms_paper_student_question psb
|
|
317
|
+ where psb.mpid=#{mpid} and psb.mptqid=#{mblockid}
|
|
318
|
+ group by psb.firstcid
|
|
319
|
+ <if test="checktype!=null and checktype==2">
|
|
320
|
+ union
|
|
321
|
+ select psb.secondcid as teacherid,count(*) as total_num,count(if(psb.secondctime is not null,1,null)) as checked_num
|
|
322
|
+ ,count(if(psb.secondctime is null,1,null)) as uncheck_num
|
|
323
|
+ from ms_paper_student_question psb
|
|
324
|
+ where psb.mpid=#{mpid} and psb.mptqid=#{mblockid}
|
|
325
|
+ group by psb.secondcid
|
|
326
|
+ </if>)t left join t_user u on t.teacherid=u.userid
|
|
327
|
+ group by t.teacherid
|
|
328
|
+ </if>
|
|
329
|
+ </select>
|
|
330
|
+ <!--教师阅卷-待批试题列表-->
|
|
331
|
+ <select id="listQuestionCheck" resultType="com.xhkjedu.smarking.model.papercheck.MsPaperCheck">
|
|
332
|
+ select pc.mblockid,pc.checktype,pc.hidefirstscore,pc.scoreway,pc.finalscore,pc.roundvalue,pc.dispenseway,pc.numtype
|
|
333
|
+ ,pc.checkstate,pc.correcttype,pc.mpid
|
|
334
|
+ from ms_paper_check pc inner join ms_paper_student_question psb on psb.mptqid = pc.mblockid and psb.mpid = pc.mpid
|
|
335
|
+ inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid = pc.mpid and pct.teacherid = #{param.handleid}
|
|
336
|
+ where pc.checkstate=1 and psb.checked!=2 and pc.mpid=#{param.mpid}
|
|
337
|
+ group by pc.mblockid
|
|
338
|
+ order by pc.mpcid
|
|
339
|
+ </select>
|
|
340
|
+ <!--教师阅卷-按试题-获取待批试题-->
|
|
341
|
+ <select id="getCorrectQuestion" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
|
|
342
|
+ <if test="param.dispenseway!=null and param.dispenseway!=2">
|
|
343
|
+ select pctt.mblockid,pctt.mpsbid,pctt.checktype,psb.stuanswer,psb.checked
|
|
344
|
+ ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime
|
|
345
|
+ from ms_paper_student_question psb inner join ms_paper_check_teacher_task pctt on psb.mpsqid = pctt.mpsbid and psb.mpid=pctt.mpid
|
|
346
|
+ where pctt.mpid=#{param.mpid} and pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.teacherid}
|
|
347
|
+ order by field(pctt.checkstate,2,1,3),pctt.taskorder
|
|
348
|
+ limit 1
|
|
349
|
+ </if>
|
|
350
|
+ <if test="param.dispenseway!=null and param.dispenseway==2">
|
|
351
|
+ select psb.mptqid as mblockid,psb.mpsqid as mpsbid,psb.answertype,psb.stuanswer,psb.qscore,psb.checked
|
|
352
|
+ ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime
|
|
353
|
+ from ms_paper_student_question psb
|
|
354
|
+ where psb.mpid=#{param.mpid} and psb.mptqid = #{param.mblockid}
|
|
355
|
+ and (psb.checked=0 or (psb.checked=1 and (psb.firstcid=#{param.teacherid}
|
|
356
|
+ <if test="param.checktype==2">
|
|
357
|
+ or psb.secondcid=#{param.teacherid}
|
|
358
|
+ </if>
|
|
359
|
+ )))
|
|
360
|
+ order by field(psb.checked,1,0,2)
|
|
361
|
+ limit 1
|
|
362
|
+ </if>
|
|
363
|
+ </select>
|
|
364
|
+ <!--教师阅卷-待批班级列表-->
|
|
365
|
+ <select id="listClassCheck" resultType="com.xhkjedu.smarking.model.papercheck.MsPaperCheck">
|
|
366
|
+ select pc.mblockid,pc.checktype,pc.hidefirstscore,pc.scoreway,pc.finalscore,pc.roundvalue,pc.dispenseway,pc.numtype
|
|
367
|
+ ,pc.checkstate,pc.correcttype,pc.mpid
|
|
368
|
+ from ms_paper_check pc inner join ms_paper_student_question psb on psb.mpid = pc.mpid
|
|
369
|
+ inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid = pc.mpid and pct.teacherid = #{param.handleid}
|
|
370
|
+ where pc.checkstate=1 and psb.checked!=2 and pc.mpid=#{param.mpid}
|
|
371
|
+ group by pc.mblockid
|
|
372
|
+ order by pc.mpcid
|
|
373
|
+ </select>
|
|
374
|
+ <!--教师阅卷-按班级-获取待批试题-->
|
|
375
|
+ <select id="getCorrectClassQuestion" resultType="com.xhkjedu.smarking.vo.papercheck.MsPaperCheckVo">
|
|
376
|
+ <if test="param.dispenseway!=null and param.dispenseway!=2">
|
|
377
|
+ select pctt.mblockid,pctt.mpsbid,pctt.checktype,psb.stuanswer,psb.checked
|
|
378
|
+ ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime,psb.mptqid
|
|
379
|
+ from ms_paper_student_question psb inner join ms_paper_check_teacher_task pctt on psb.mpsqid = pctt.mpsbid and psb.mpid=pctt.mpid
|
|
380
|
+ where pctt.mpid=#{param.mpid} and pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.teacherid}
|
|
381
|
+ order by field(pctt.checkstate,2,1,3),pctt.taskorder
|
|
382
|
+ limit 1
|
|
383
|
+ </if>
|
|
384
|
+ <if test="param.dispenseway!=null and param.dispenseway==2">
|
|
385
|
+ select c.classid as mblockid,psb.mpsqid as mpsbid,psb.answertype,psb.stuanswer,psb.qscore,psb.checked
|
|
386
|
+ ,psb.firstcid,psb.firstcime,psb.secondcid,psb.secondctime,psb.mptqid
|
|
387
|
+ from ms_paper_student_question psb inner join ms_class c on psb.mpid=c.mpid
|
|
388
|
+ where psb.mpid=#{param.mpid} and c.classid = #{param.mblockid}
|
|
389
|
+ and (psb.checked=0 or (psb.checked=1 and (psb.firstcid=#{param.teacherid}
|
|
390
|
+ <if test="param.checktype==2">
|
|
391
|
+ or psb.secondcid=#{param.teacherid}
|
|
392
|
+ </if>
|
|
393
|
+ )))
|
|
394
|
+ order by field(psb.checked,1,0,2),psb.mptqid
|
|
395
|
+ limit 1
|
|
396
|
+ </if>
|
|
397
|
+ </select>
|
|
398
|
+ <!--获取教师批阅数量-->
|
|
399
|
+ <select id="getCheckNum" resultType="com.xhkjedu.smarking.model.papercheck.MsPaperCheckTeacher">
|
|
400
|
+ <if test="param.dispenseway!=null and param.dispenseway!=2">
|
|
401
|
+ select pct.tasknum,count(if(pctt.checkstate=3,1,null)) as checkednum
|
|
402
|
+ from ms_paper_check_teacher pct left join ms_paper_check_teacher_task pctt on pct.mpid=pctt.mpid and pct.teacherid=pctt.teacherid pct.mblockid=pctt.mblockid
|
|
403
|
+ where pct.mpid=#{param.mpid} and pct.teacherid=#{param.handleid} and pct.mblockid=#{param.mblockid}
|
|
404
|
+ </if>
|
|
405
|
+ <if test="param.dispenseway!=null and param.dispenseway==2">
|
|
406
|
+ <if test="param.correcttype==3">
|
|
407
|
+ select count(psb.mpsbid*#{param.checktype}) as tasknum
|
|
408
|
+ ,count(if(pctt.checkstate=3,1,null)) as checkednum
|
|
409
|
+ 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
|
|
410
|
+ where psb.mpid=#{param.mpid} and psb.mblockid=#{param.mblockid}
|
|
411
|
+ </if>
|
|
412
|
+ <if test="param.correcttype==2">
|
|
413
|
+ select count(psb.mpsqid*#{param.checktype}) as tasknum
|
|
414
|
+ ,count(if(pctt.checkstate=3,1,null)) as checkednum
|
|
415
|
+ 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
|
|
416
|
+ where psb.mpid=#{param.mpid} and psb.mptqid=#{param.mblockid}
|
|
417
|
+ </if>
|
|
418
|
+ <if test="param.correcttype==1">
|
|
419
|
+ select count(psb.mpsqid*#{param.checktype}) as tasknum
|
|
420
|
+ ,count(if(pctt.checkstate=3,1,null)) as checkednum
|
|
421
|
+ 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
|
|
422
|
+ inner join ms_class_student cs on psb.examid=cs.examid and psb.subjectid=cs.subjectid and psb.studentid=cs.studentid
|
|
423
|
+ where psb.mpid=#{param.mpid} and psb.mptqid=#{param.mptqid} and cs.classid=#{param.mblockid}
|
|
424
|
+ </if>
|
|
425
|
+ </if>
|
|
426
|
+ </select>
|
242
|
427
|
</mapper>
|