Browse Source

批阅、仲裁

ywx
雍文秀 1 month ago
parent
commit
146000a7b9

+ 32
- 0
smarking/src/main/java/com/xhkjedu/smarking/controller/papercheck/MsPaperCheckTeacherArbitrateController.java View File

204
         PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
204
         PageResult pageResult = PageUtil.getPageResult(new PageInfo<>(list));
205
         return new ResultVo(0, "查询成功", pageResult);
205
         return new ResultVo(0, "查询成功", pageResult);
206
     }
206
     }
207
+
208
+    /**
209
+     * @Description 仲裁历史详情
210
+     * @Date 2024/11/20 9:14
211
+     * @Author YWX
212
+     * @Param [param]
213
+     * @Return com.xhkjedu.vo.ResultVo
214
+     **/
215
+    @PostMapping("/detail_history")
216
+    public ResultVo detailHistory(@RequestBody MsCheckParam param) {
217
+        N_Utils.validation(new Object[]{
218
+                param.getMpctaid(), "任务ID", 1
219
+                , param.getMpid(), "批阅设置", 1
220
+        });
221
+        return new ResultVo(0, "查询成功", msPaperCheckTeacherArbitrateService.detailHistory(param));
222
+    }
223
+
224
+    /**
225
+     * @Description 初评分
226
+     * @Date 2024/11/20 9:31
227
+     * @Author YWX
228
+     * @Param [param]
229
+     * @Return com.xhkjedu.vo.ResultVo
230
+     **/
231
+    @PostMapping("/get_score")
232
+    public ResultVo getScore(@RequestBody MsCheckParam param) {
233
+        N_Utils.validation(new Object[]{
234
+                param.getMpsbid(), "学生题块ID", 1
235
+                , param.getCorrecttype(), "批阅设置", 1
236
+        });
237
+        return new ResultVo(0, "查询成功", msPaperCheckTeacherArbitrateService.getScore(param));
238
+    }
207
 }
239
 }

+ 4
- 4
smarking/src/main/java/com/xhkjedu/smarking/controller/papercheck/MsPaperCheckTeacherTaskController.java View File

297
      * @Param [param]
297
      * @Param [param]
298
      * @Return com.xhkjedu.vo.ResultVo
298
      * @Return com.xhkjedu.vo.ResultVo
299
      **/
299
      **/
300
-    @PostMapping("/detail_correct")
301
-    public ResultVo detailCorrect(@RequestBody MsCheckParam param) {
300
+    @PostMapping("/detail_history")
301
+    public ResultVo detailHistory(@RequestBody MsCheckParam param) {
302
         N_Utils.validation(new Object[]{
302
         N_Utils.validation(new Object[]{
303
                 param.getMpcttid(), "任务ID", 1
303
                 param.getMpcttid(), "任务ID", 1
304
-                , param.getMpid(), "试卷ID", 1
304
+                , param.getCorrecttype(), "试卷ID", 1
305
         });
305
         });
306
-        return new ResultVo(0, "查询成功", msPaperCheckTeacherTaskService.detailCorrect(param));
306
+        return new ResultVo(0, "查询成功", msPaperCheckTeacherTaskService.detailHistory(param));
307
     }
307
     }
308
 
308
 
309
     /**
309
     /**

+ 6
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/papercheck/MsPaperCheckTeacherArbitrateMapper.java View File

42
 
42
 
43
     //仲裁历史
43
     //仲裁历史
44
     List<Map> listArbitrateHistory(@Param("param") MsCheckParam param);
44
     List<Map> listArbitrateHistory(@Param("param") MsCheckParam param);
45
+
46
+    //仲裁历史详情
47
+    Map detailHistory(@Param("param") MsCheckParam param);
48
+
49
+    //初评分
50
+    List<Map> getScore(@Param("param") MsCheckParam param);
45
 }
51
 }

+ 4
- 1
smarking/src/main/java/com/xhkjedu/smarking/mapper/papercheck/MsPaperCheckTeacherTaskMapper.java View File

25
     //批量保存或更新
25
     //批量保存或更新
26
     void batchSave(@Param("tasks") List<MsPaperCheckTeacherTask> tasks);
26
     void batchSave(@Param("tasks") List<MsPaperCheckTeacherTask> tasks);
27
 
27
 
28
+    //保存或更新单个任务
29
+    void save(@Param("s") MsPaperCheckTeacherTask task);
30
+
28
     //阅卷进度-按题块
31
     //阅卷进度-按题块
29
     List<Map> listByBlock(@Param("mpid") Integer mpid);
32
     List<Map> listByBlock(@Param("mpid") Integer mpid);
30
 
33
 
102
     List<Map> listCorrectHistory(@Param("param") MsCheckParam param);
105
     List<Map> listCorrectHistory(@Param("param") MsCheckParam param);
103
 
106
 
104
     //教师阅卷-历史详情
107
     //教师阅卷-历史详情
105
-    Map detailCorrect(@Param("param") MsCheckParam param);
108
+    Map detailHistory(@Param("param") MsCheckParam param);
106
 
109
 
107
     //教师阅卷-平均分
110
     //教师阅卷-平均分
108
     Map avgScore(@Param("param") MsCheckParam param);
111
     Map avgScore(@Param("param") MsCheckParam param);

+ 37
- 0
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherArbitrateService.java View File

311
     public List<Map> listArbitrateHistory(MsCheckParam param) {
311
     public List<Map> listArbitrateHistory(MsCheckParam param) {
312
         return msPaperCheckTeacherArbitrateMapper.listArbitrateHistory(param);
312
         return msPaperCheckTeacherArbitrateMapper.listArbitrateHistory(param);
313
     }
313
     }
314
+
315
+    /**
316
+     * @Description 仲裁历史详情
317
+     * @Date 2024/11/20 9:13
318
+     * @Author YWX
319
+     * @Param [param]
320
+     * @Return java.util.Map
321
+     **/
322
+    public Map detailHistory(MsCheckParam param) {
323
+        return msPaperCheckTeacherArbitrateMapper.detailHistory(param);
324
+    }
325
+
326
+    /**
327
+     * @Description 初评分
328
+     * @Date 2024/11/20 9:31
329
+     * @Author YWX
330
+     * @Param [param]
331
+     * @Return java.util.List<java.util.Map>
332
+     **/
333
+    public List<Map> getScore(MsCheckParam param) {
334
+        List<Map> score = msPaperCheckTeacherArbitrateMapper.getScore(param);
335
+        for (Map map : score) {
336
+            double diffscore1 = 0;
337
+            double diffscore2 = 0;
338
+            if (map.get("scoreway").equals(2)) {
339
+                Object qscore = map.get("qscore");
340
+                Object diffscore = map.get("diffscore");
341
+                double scoreDiff1 = MarkingUtil.scoreDiff(map.get("firstccore"), qscore);
342
+                double scoreDiff2 = MarkingUtil.scoreDiff(map.get("secondcscore"), qscore);
343
+                diffscore1 = MarkingUtil.sub(diffscore, scoreDiff1);
344
+                diffscore2 = MarkingUtil.sub(diffscore, scoreDiff2);
345
+            }
346
+            map.put("diffscore1", diffscore1);
347
+            map.put("diffscore2", diffscore2);
348
+        }
349
+        return score;
350
+    }
314
 }
351
 }

+ 5
- 6
smarking/src/main/java/com/xhkjedu/smarking/service/papercheck/MsPaperCheckTeacherTaskService.java View File

228
         Integer totalNum = 0;
228
         Integer totalNum = 0;
229
         Integer checkedNum = 0;
229
         Integer checkedNum = 0;
230
         if (sq != null) {
230
         if (sq != null) {
231
+            sq.setMpid(param.getMpid());
231
             MsPaperCheckTeacher teacher = msPaperCheckTeacherTaskMapper.getCheckNum(paperCheck);
232
             MsPaperCheckTeacher teacher = msPaperCheckTeacherTaskMapper.getCheckNum(paperCheck);
232
             totalNum = teacher.getTasknum();
233
             totalNum = teacher.getTasknum();
233
             checkedNum = teacher.getCheckednum();
234
             checkedNum = teacher.getCheckednum();
259
                 task.setCheckstate(2);
260
                 task.setCheckstate(2);
260
                 task.setChecktype(checktype);
261
                 task.setChecktype(checktype);
261
                 task.setCreatetime(N_Utils.getSecondTimestamp());
262
                 task.setCreatetime(N_Utils.getSecondTimestamp());
262
-                msPaperCheckTeacherTaskMapper.insertSelective(task);
263
+                msPaperCheckTeacherTaskMapper.save(task);
263
             }
264
             }
264
             if (correcttype.equals(3)) {//按题块批阅
265
             if (correcttype.equals(3)) {//按题块批阅
265
                 MsPaperStudentBlock block = new MsPaperStudentBlock();
266
                 MsPaperStudentBlock block = new MsPaperStudentBlock();
274
             } else {//按试题/班级批阅
275
             } else {//按试题/班级批阅
275
                 MsPaperStudentQuestion question = new MsPaperStudentQuestion();
276
                 MsPaperStudentQuestion question = new MsPaperStudentQuestion();
276
                 question.setMpsqid(sq.getMpsbid());
277
                 question.setMpsqid(sq.getMpsbid());
277
-                question.setChecked(1);
278
+                question.setChecked(2);
278
                 if (checktype.equals(1)) {
279
                 if (checktype.equals(1)) {
279
                     question.setFirstcid(handleid);
280
                     question.setFirstcid(handleid);
280
                 } else {
281
                 } else {
677
      * @Param [param]
678
      * @Param [param]
678
      * @Return java.util.Map
679
      * @Return java.util.Map
679
      **/
680
      **/
680
-    public Map detailCorrect(MsCheckParam param) {
681
-        Integer correcttype = msPaperMapper.getCorrectTypeByMpId(param.getMpid());
682
-        param.setCorrecttype(correcttype);
683
-        return msPaperCheckTeacherTaskMapper.detailCorrect(param);
681
+    public Map detailHistory(MsCheckParam param) {
682
+        return msPaperCheckTeacherTaskMapper.detailHistory(param);
684
     }
683
     }
685
 
684
 
686
     /**
685
     /**

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/vo/papercheck/MsCheckParam.java View File

40
     private Integer mpcttid;
40
     private Integer mpcttid;
41
     //科目id
41
     //科目id
42
     private String subjectid;
42
     private String subjectid;
43
+    //阅卷仲裁教师任务ID
44
+    private Integer mpctaid;
43
 }
45
 }

+ 1
- 1
smarking/src/main/java/com/xhkjedu/smarking/vo/papercheck/MsPaperCheckVo.java View File

30
     private String stuanswer;
30
     private String stuanswer;
31
     //试题分值
31
     //试题分值
32
     private Double qscore;
32
     private Double qscore;
33
-    //是否批改0未批改1批改中2已批改
33
+    //是否批阅0默认1待批阅2批阅中3已批阅
34
     private Integer checked;
34
     private Integer checked;
35
     //单评批改人
35
     //单评批改人
36
     private Integer firstcid;
36
     private Integer firstcid;

+ 1
- 0
smarking/src/main/resources/mapper/papercheck/MsPaperCheckMapper.xml View File

66
     <!--根据题块id获取阅卷信息-->
66
     <!--根据题块id获取阅卷信息-->
67
     <select id="findByMBlockId" resultType="com.xhkjedu.smarking.model.papercheck.MsPaperCheck">
67
     <select id="findByMBlockId" resultType="com.xhkjedu.smarking.model.papercheck.MsPaperCheck">
68
         select mpcid,mpid,mblockid,checktype,arbitrateid,diffscore,hidefirstscore,scoreway,finalscore,roundvalue,dispenseway
68
         select mpcid,mpid,mblockid,checktype,arbitrateid,diffscore,hidefirstscore,scoreway,finalscore,roundvalue,dispenseway
69
+        ,checkstate,correcttype
69
         from ms_paper_check where mpid = #{mpid} and mblockid = #{mblockid}
70
         from ms_paper_check where mpid = #{mpid} and mblockid = #{mblockid}
70
     </select>
71
     </select>
71
     <!--获取学生作答及批阅信息(按题块)-->
72
     <!--获取学生作答及批阅信息(按题块)-->

+ 26
- 0
smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherArbitrateMapper.xml View File

161
         </if>
161
         </if>
162
         order by pcta.mpsbid desc
162
         order by pcta.mpsbid desc
163
     </select>
163
     </select>
164
+    <!--仲裁历史详情-->
165
+    <select id="detailHistory" resultType="java.util.Map">
166
+        select psq.stuanswer,mpcta.checkscore,mpcta.hasproblem,mpcta.problemtype,mpcta.problemcomm
167
+        ,mpcta.mpid,mpcta.mblockid,mpcta.mpsbid,mpcta.mptqid,mpcta.taskorder
168
+        from ms_paper_check_teacher_arbitrate mpcta
169
+        <if test="param.correcttype==3">
170
+            inner join ms_paper_student_block psq on mpcta.mpsbid=psq.mpsbid
171
+        </if>
172
+        <if test="param.correcttype==2">
173
+            inner join ms_paper_student_question psq on mpcta.mpsbid=psq.mpsqid
174
+        </if>
175
+        where mpcta.mpctaid=#{param.mpctaid}
176
+    </select>
177
+    <!--初评分-->
178
+    <select id="getScore" resultType="java.util.Map">
179
+        select psq.firstccore,psq.secondcscore,psq.qscore,psq.qorder,psq.qn
180
+        ,pc.diffscore,pc.scoreway
181
+        from ms_paper_student_question psq inner join ms_paper_check pc on psq.mpid=pc.mpid
182
+        <if test="param.correcttype==3">
183
+            where psq.mpsbid=#{param.mpsbid} and psq.mblockid=pc.mblockid
184
+        </if>
185
+        <if test="param.correcttype==2">
186
+            where psq.mpsqid=#{param.mpsbid} and psq.mptqid=pc.mblockid
187
+        </if>
188
+        order by psq.mpsqid
189
+    </select>
164
 </mapper>
190
 </mapper>

+ 68
- 43
smarking/src/main/resources/mapper/papercheck/MsPaperCheckTeacherTaskMapper.xml View File

9
             on duplicate key update taskorder=#{s.taskorder},checktype=#{s.checktype}
9
             on duplicate key update taskorder=#{s.taskorder},checktype=#{s.checktype}
10
         </foreach>
10
         </foreach>
11
     </insert>
11
     </insert>
12
+    <!--保存或更新单个任务-->
13
+    <insert id="save">
14
+        insert into ms_paper_check_teacher_task (mpid, mblockid, teacherid, taskorder, mpsbid, checktype, createtime)
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}
17
+    </insert>
12
     <!--批量更新任务信息-->
18
     <!--批量更新任务信息-->
13
     <update id="batchUpdate">
19
     <update id="batchUpdate">
14
         update ms_paper_check_teacher_task
20
         update ms_paper_check_teacher_task
69
         <result property="blockorder" column="blockorder"/>
75
         <result property="blockorder" column="blockorder"/>
70
         <result property="bqnum" column="bqnum"/>
76
         <result property="bqnum" column="bqnum"/>
71
         <result property="checktype" column="checktype"/>
77
         <result property="checktype" column="checktype"/>
78
+        <result property="checkstate" column="checkstate"/>
72
         <result property="totalNum" column="totalNum"/>
79
         <result property="totalNum" column="totalNum"/>
73
         <result property="checkedNum" column="checkedNum"/>
80
         <result property="checkedNum" column="checkedNum"/>
74
         <result property="uncheckedNum" column="uncheckedNum"/>
81
         <result property="uncheckedNum" column="uncheckedNum"/>
81
         where u.userid = mct.teacherid and mct.mblockid = #{mblockid}
88
         where u.userid = mct.teacherid and mct.mblockid = #{mblockid}
82
     </select>
89
     </select>
83
     <select id="listByBlock" resultMap="blockResultMap">
90
     <select id="listByBlock" resultMap="blockResultMap">
84
-        select pc.mblockid,pb.blockname,pb.bqscore,pb.blockorder,pb.bqnum
85
-        ,pc.checktype,count(pctt.mpcttid) as totalNum,count(if(pctt.checkstate=3,1,null)) as checkedNum
91
+        select pb.mblockid,pb.blockname,pb.bqscore,pb.blockorder,pb.bqnum
92
+        ,pc.checktype,pc.checkstate,count(pctt.mpcttid) as totalNum,count(if(pctt.checkstate=3,1,null)) as checkedNum
86
         ,count(if(pctt.checkstate!=3,1,null))as uncheckedNum
93
         ,count(if(pctt.checkstate!=3,1,null))as uncheckedNum
94
+        ,(select group_concat(pbbq.bqn separator '、') from ms_paper_block_question pbbq where pbbq.mblockid = pb.mblockid) as bqn
87
         from ms_paper_check pc left join ms_paper_check_teacher_task pctt on pc.mpid = pctt.mpid
95
         from ms_paper_check pc left join ms_paper_check_teacher_task pctt on pc.mpid = pctt.mpid
88
-        left join ms_paper_block pb on pc.mblockid = pb.mblockid
89
-        where pc.mpid=#{mpid}
90
-        group by pc.mblockid
96
+        right join ms_paper_block pb on pc.mblockid = pb.mblockid
97
+        where pb.mpid=#{mpid} and pb.blocktype= 2
98
+        group by pb.mblockid
91
         order by pb.blockorder
99
         order by pb.blockorder
92
     </select>
100
     </select>
93
     <!--阅卷进度-按题块-查看详情-->
101
     <!--阅卷进度-按题块-查看详情-->
194
         from ms_subject s inner join ms_exam e on s.examid = e.examid
202
         from ms_subject s inner join ms_exam e on s.examid = e.examid
195
         inner join ms_paper_check pc on pc.msid = s.msid
203
         inner join ms_paper_check pc on pc.msid = s.msid
196
         inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid
204
         inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid
197
-        inner join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.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
198
         where e.schoolid=#{param.schoolid} and s.checkstate=1 and e.deleted=1 and pc.dispenseway=2 and pc.correcttype=3
206
         where e.schoolid=#{param.schoolid} and s.checkstate=1 and e.deleted=1 and pc.dispenseway=2 and pc.correcttype=3
199
         group by s.msid
207
         group by s.msid
200
         <if test="param.checktype==0">having 100>checkrate</if>
208
         <if test="param.checktype==0">having 100>checkrate</if>
208
         from ms_subject s inner join ms_exam e on s.examid = e.examid
216
         from ms_subject s inner join ms_exam e on s.examid = e.examid
209
         inner join ms_paper_check pc on pc.msid = s.msid
217
         inner join ms_paper_check pc on pc.msid = s.msid
210
         inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid
218
         inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid
211
-        inner join ms_paper_student_question psb on psb.mptqid = pc.mblockid and psb.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
212
         where e.schoolid=#{param.schoolid} and s.checkstate=1 and e.deleted=1 and pc.dispenseway=2 and pc.correcttype=2
220
         where e.schoolid=#{param.schoolid} and s.checkstate=1 and e.deleted=1 and pc.dispenseway=2 and pc.correcttype=2
213
         group by s.msid
221
         group by s.msid
214
         <if test="param.checktype==0">having 100>checkrate</if>
222
         <if test="param.checktype==0">having 100>checkrate</if>
223
         inner join ms_paper_check pc on pc.msid = s.msid
231
         inner join ms_paper_check pc on pc.msid = s.msid
224
         inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid
232
         inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid
225
         inner join ms_class_student cs on cs.examid = e.examid and cs.subjectid = s.subjectid and cs.classid = pct.mblockid
233
         inner join ms_class_student cs on cs.examid = e.examid and cs.subjectid = s.subjectid and cs.classid = pct.mblockid
226
-        inner join ms_paper_student_question psb on psb.studentid = cs.studentid and psb.mpid = pc.mpid
234
+        inner join ms_paper_student_question psb on psb.studentid = cs.studentid and psb.mpid = pc.mpid and psb.checked!=0
227
         where e.schoolid=#{param.schoolid} and s.checkstate=1 and e.deleted=1 and pc.dispenseway=2 and pc.correcttype=1
235
         where e.schoolid=#{param.schoolid} and s.checkstate=1 and e.deleted=1 and pc.dispenseway=2 and pc.correcttype=1
228
         group by s.msid
236
         group by s.msid
229
         <if test="param.checktype==0">having 100>checkrate</if>
237
         <if test="param.checktype==0">having 100>checkrate</if>
252
             ,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
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
253
             ,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
261
             ,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
254
             ,count(distinct if(((psb.firstcime is null and psb.firstcid=#{param.handleid})
262
             ,count(distinct if(((psb.firstcime is null and psb.firstcid=#{param.handleid})
255
-            or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or pc.dispenseway=2) and psb.checked!=2
263
+            or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or pc.dispenseway=2) and psb.checked in(1,2)
256
             ,psb.mpsbid,null)) as myUncheckedNum
264
             ,psb.mpsbid,null)) as myUncheckedNum
257
             from ms_paper_check pc left join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
265
             from ms_paper_check pc left join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
258
             and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or pc.dispenseway=2)
266
             and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or pc.dispenseway=2)
266
             select pb.qorder,pb.qn
274
             select pb.qorder,pb.qn
267
             ,pc.mblockid,pc.checktype,pc.dispenseway,pc.numtype
275
             ,pc.mblockid,pc.checktype,pc.dispenseway,pc.numtype
268
             ,count(distinct psb.mpsqid)*pc.checktype as totalNum
276
             ,count(distinct psb.mpsqid)*pc.checktype as totalNum
269
-            ,count(distinct if(psb.firstcime is not null,psb.mpsqid,null))+count(distinct if(psb.secondctime is not null,psb.mpsqid,null)) as totalCheckedNum
277
+            ,count(distinct if(psb.firstcime>0,psb.mpsqid,null))+count(distinct if(psb.secondctime>0,psb.mpsqid,null)) as totalCheckedNum
270
             ,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 if(psb.firstcime is null,psb.mpsqid,null))+count(distinct if(pc.checktype=2 and psb.secondctime is null,psb.mpsqid,null)) as totalUncheckedNum
271
-            ,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
279
+            ,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
272
             ,count(distinct if(((psb.firstcime is null and psb.firstcid=#{param.handleid})
280
             ,count(distinct if(((psb.firstcime is null and psb.firstcid=#{param.handleid})
273
-            or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or pc.dispenseway=2) and psb.checked!=2
281
+            or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or pc.dispenseway=2) and psb.checked in(1,2)
274
             ,psb.mpsqid,null)) as myUncheckedNum
282
             ,psb.mpsqid,null)) as myUncheckedNum
275
             from ms_paper_check pc left join ms_paper_student_question psb on psb.mptqid = pc.mblockid and psb.mpid = pc.mpid
283
             from ms_paper_check pc left join ms_paper_student_question psb on psb.mptqid = pc.mblockid and psb.mpid = pc.mpid
276
             and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or pc.dispenseway=2) and psb.answered=1
284
             and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or pc.dispenseway=2) and psb.answered=1
288
             ,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
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
289
             ,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
297
             ,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
290
             ,count(distinct if(((psb.firstcime is null and psb.firstcid=#{param.handleid})
298
             ,count(distinct if(((psb.firstcime is null and psb.firstcid=#{param.handleid})
291
-            or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or pc.dispenseway=2) and psb.checked!=2
299
+            or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or pc.dispenseway=2) and psb.checked in(1,2)
292
             ,psb.mpsqid,null)) as myUncheckedNum
300
             ,psb.mpsqid,null)) as myUncheckedNum
293
             from ms_paper_check pc inner join ms_class c on pc.mblockid = c.classid
301
             from ms_paper_check pc inner join ms_class c on pc.mblockid = c.classid
294
             inner join ms_class_student cs on c.examid=cs.examid and c.subjectid=cs.subjectid and pc.mblockid=cs.classid
302
             inner join ms_class_student cs on c.examid=cs.examid and c.subjectid=cs.subjectid and pc.mblockid=cs.classid
354
         ,pc.checkstate,pc.correcttype,pc.mpid
362
         ,pc.checkstate,pc.correcttype,pc.mpid
355
         from ms_paper_check pc inner join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
363
         from ms_paper_check pc inner join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
356
         inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid = pc.mpid and pct.teacherid = #{param.handleid}
364
         inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid = pc.mpid and pct.teacherid = #{param.handleid}
357
-        where pc.checkstate=1 and psb.checked!=2 and pc.mpid=#{param.mpid}
365
+        where pc.checkstate=1 and psb.checked in(1,2) and pc.mpid=#{param.mpid}
358
         group by pc.mblockid
366
         group by pc.mblockid
359
         order by pc.mpcid
367
         order by pc.mpcid
360
     </select>
368
     </select>
376
             ,psb.firstccore,psb.secondcscore,psb.firstccores,psb.secondcscores
384
             ,psb.firstccore,psb.secondcscore,psb.firstccores,psb.secondcscores
377
             from ms_paper_student_block psb
385
             from ms_paper_student_block psb
378
             where psb.mpid=#{param.mpid} and psb.mblockid = #{param.mblockid}
386
             where psb.mpid=#{param.mpid} and psb.mblockid = #{param.mblockid}
379
-            and (psb.checked=1 or (psb.checked=2 and (psb.firstcid=#{param.teacherid}
387
+            and (psb.checked=1 or (psb.checked=2 and ((psb.firstcid=#{param.teacherid} and psb.firstcime is null)
380
             <if test="param.checktype==2">
388
             <if test="param.checktype==2">
381
-                or psb.secondcid=#{param.teacherid}
389
+                or (psb.secondcid=#{param.teacherid} and psb.secondctime is null)
390
+                or (psb.firstcid!=#{param.teacherid} and psb.secondcid is null)
391
+                or (psb.secondcid!=#{param.teacherid} and psb.firstcid is null)
382
             </if>
392
             </if>
383
             )))
393
             )))
384
             and psb.hasproblem=0
394
             and psb.hasproblem=0
385
-            order by field(psb.checked,1,0,2)
395
+            order by field(psb.checked,2,1,3)
386
             limit 1
396
             limit 1
387
         </if>
397
         </if>
388
     </select>
398
     </select>
394
         <result property="mblockid" column="mblockid"/>
404
         <result property="mblockid" column="mblockid"/>
395
         <result property="mpid" column="mpid"/>
405
         <result property="mpid" column="mpid"/>
396
         <result property="checktype" column="checktype"/>
406
         <result property="checktype" column="checktype"/>
407
+        <result property="checkstate" column="checkstate"/>
397
         <result property="totalNum" column="totalNum"/>
408
         <result property="totalNum" column="totalNum"/>
398
         <result property="checkedNum" column="checkedNum"/>
409
         <result property="checkedNum" column="checkedNum"/>
399
         <result property="uncheckedNum" column="uncheckedNum"/>
410
         <result property="uncheckedNum" column="uncheckedNum"/>
400
         <collection property="teachers" select="listCheckTeacher" column="mblockid"/>
411
         <collection property="teachers" select="listCheckTeacher" column="mblockid"/>
401
     </resultMap>
412
     </resultMap>
402
     <select id="listByQuestion" resultMap="questionResultMap">
413
     <select id="listByQuestion" resultMap="questionResultMap">
403
-        select q.qorder,q.qn,q.qscore,q.mptqid as mblockid,q.mpid,pc.checktype
414
+        select q.qorder,q.qn,q.qscore,q.mptqid as mblockid,q.mpid,pc.checktype,pc.checkstate
404
         ,count(distinct psq.mpsqid) as totalNum
415
         ,count(distinct psq.mpsqid) as totalNum
405
         ,count(if(psq.firstcime is not null or psq.secondctime is not null,psq.mpsqid,null)) as checkedNum
416
         ,count(if(psq.firstcime is not null or psq.secondctime is not null,psq.mpsqid,null)) as checkedNum
406
         ,count(if(psq.firstcime is null or (pc.checktype=2 and psq.secondctime is null),psq.mpsqid,null)) as uncheckedNum
417
         ,count(if(psq.firstcime is null or (pc.checktype=2 and psq.secondctime is null),psq.mpsqid,null)) as uncheckedNum
445
         <result property="mblockid" column="mblockid"/>
456
         <result property="mblockid" column="mblockid"/>
446
         <result property="mpid" column="mpid"/>
457
         <result property="mpid" column="mpid"/>
447
         <result property="checktype" column="checktype"/>
458
         <result property="checktype" column="checktype"/>
459
+        <result property="checkstate" column="checkstate"/>
448
         <result property="totalNum" column="totalNum"/>
460
         <result property="totalNum" column="totalNum"/>
449
         <result property="checkedNum" column="checkedNum"/>
461
         <result property="checkedNum" column="checkedNum"/>
450
         <result property="uncheckedNum" column="uncheckedNum"/>
462
         <result property="uncheckedNum" column="uncheckedNum"/>
451
         <collection property="teachers" select="listCheckTeacher" column="mblockid"/>
463
         <collection property="teachers" select="listCheckTeacher" column="mblockid"/>
452
     </resultMap>
464
     </resultMap>
453
     <select id="listByClass" resultMap="classResultMap">
465
     <select id="listByClass" resultMap="classResultMap">
454
-        select c.classname,c.classid as mblockid,pc.mpid,pc.checktype
466
+        select c.classname,c.classid as mblockid,pc.mpid,pc.checktype,pc.checkstate
455
         ,count(distinct psq.mpsqid) as totalNum
467
         ,count(distinct psq.mpsqid) as totalNum
456
         ,count(if(psq.firstcime is not null or psq.secondctime is not null,psq.mpsqid,null)) as checkedNum
468
         ,count(if(psq.firstcime is not null or psq.secondctime is not null,psq.mpsqid,null)) as checkedNum
457
         ,count(if(psq.firstcime is null or (pc.checktype=2 and psq.secondctime is null),psq.mpsqid,null)) as uncheckedNum
469
         ,count(if(psq.firstcime is null or (pc.checktype=2 and psq.secondctime is null),psq.mpsqid,null)) as uncheckedNum
481
         ,pc.checkstate,pc.correcttype,pc.mpid
493
         ,pc.checkstate,pc.correcttype,pc.mpid
482
         from ms_paper_check pc inner join ms_paper_student_question psb on psb.mptqid = pc.mblockid and psb.mpid = pc.mpid
494
         from ms_paper_check pc inner join ms_paper_student_question psb on psb.mptqid = pc.mblockid and psb.mpid = pc.mpid
483
         inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid = pc.mpid and pct.teacherid = #{param.handleid}
495
         inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid = pc.mpid and pct.teacherid = #{param.handleid}
484
-        where pc.checkstate=1 and psb.checked!=2 and pc.mpid=#{param.mpid}
496
+        where pc.checkstate=1 and psb.checked in(1,2) and pc.mpid=#{param.mpid}
485
         group by pc.mblockid
497
         group by pc.mblockid
486
         order by pc.mpcid
498
         order by pc.mpcid
487
     </select>
499
     </select>
503
             ,psb.firstccore,psb.secondcscore
515
             ,psb.firstccore,psb.secondcscore
504
             from ms_paper_student_question psb
516
             from ms_paper_student_question psb
505
             where psb.mpid=#{param.mpid} and psb.mptqid = #{param.mblockid}
517
             where psb.mpid=#{param.mpid} and psb.mptqid = #{param.mblockid}
506
-            and (psb.checked=1 or (psb.checked=2 and (psb.firstcid=#{param.teacherid}
518
+            and (psb.checked=1 or (psb.checked=2 and ((psb.firstcid=#{param.teacherid} and psb.firstcime is null)
507
             <if test="param.checktype==2">
519
             <if test="param.checktype==2">
508
-                or psb.secondcid=#{param.teacherid}
520
+                or (psb.secondcid=#{param.teacherid} and psb.secondctime is null)
521
+                or (psb.firstcid!=#{param.teacherid} and psb.secondcid is null)
522
+                or (psb.secondcid!=#{param.teacherid} and psb.firstcid is null)
509
             </if>
523
             </if>
510
             )))
524
             )))
511
             and psb.hasproblem=0
525
             and psb.hasproblem=0
512
-            order by field(psb.checked,1,0,2)
526
+            order by field(psb.checked,2,1,3)
513
             limit 1
527
             limit 1
514
         </if>
528
         </if>
515
     </select>
529
     </select>
519
         ,pc.checkstate,pc.correcttype,pc.mpid
533
         ,pc.checkstate,pc.correcttype,pc.mpid
520
         from ms_paper_check pc inner join ms_paper_student_question psb on psb.mpid = pc.mpid
534
         from ms_paper_check pc inner join ms_paper_student_question psb on psb.mpid = pc.mpid
521
         inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid = pc.mpid and pct.teacherid = #{param.handleid}
535
         inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid = pc.mpid and pct.teacherid = #{param.handleid}
522
-        where pc.checkstate=1 and psb.checked!=2 and pc.mpid=#{param.mpid}
536
+        where pc.checkstate=1 and psb.checked in(1,2) and pc.mpid=#{param.mpid}
523
         group by pc.mblockid
537
         group by pc.mblockid
524
         order by pc.mpcid
538
         order by pc.mpcid
525
     </select>
539
     </select>
541
             ,psb.firstccore,psb.secondcscore
555
             ,psb.firstccore,psb.secondcscore
542
             from ms_paper_student_question psb inner join ms_class c on psb.mpid=c.mpid
556
             from ms_paper_student_question psb inner join ms_class c on psb.mpid=c.mpid
543
             where psb.mpid=#{param.mpid} and c.classid = #{param.mblockid}
557
             where psb.mpid=#{param.mpid} and c.classid = #{param.mblockid}
544
-            and (psb.checked=1 or (psb.checked=2 and (psb.firstcid=#{param.teacherid}
558
+            and (psb.checked=1 or (psb.checked=2 and ((psb.firstcid=#{param.teacherid} and psb.firstcime is null)
545
             <if test="param.checktype==2">
559
             <if test="param.checktype==2">
546
-                or psb.secondcid=#{param.teacherid}
560
+                or (psb.secondcid=#{param.teacherid} and psb.secondctime is null)
561
+                or (psb.firstcid!=#{param.teacherid} and psb.secondcid is null)
562
+                or (psb.secondcid!=#{param.teacherid} and psb.firstcid is null)
547
             </if>
563
             </if>
548
             )))
564
             )))
549
             and psb.hasproblem=0
565
             and psb.hasproblem=0
550
-            order by field(psb.checked,1,0,2),psb.mptqid
566
+            order by field(psb.checked,2,1,3),psb.mptqid
551
             limit 1
567
             limit 1
552
         </if>
568
         </if>
553
     </select>
569
     </select>
619
         order by pctt.taskorder desc
635
         order by pctt.taskorder desc
620
     </select>
636
     </select>
621
     <!--教师阅卷-历史详情-->
637
     <!--教师阅卷-历史详情-->
622
-    <select id="detailCorrect" resultType="java.util.Map">
638
+    <select id="detailHistory" resultType="java.util.Map">
623
         select psq.stuanswer,pctt.checkscore,pctt.hasproblem,pctt.problemtype,pctt.problemcomm
639
         select psq.stuanswer,pctt.checkscore,pctt.hasproblem,pctt.problemtype,pctt.problemcomm
624
         ,pctt.mpid,pctt.mblockid,pctt.mpsbid,pctt.mptqid,pctt.taskorder
640
         ,pctt.mpid,pctt.mblockid,pctt.mpsbid,pctt.mptqid,pctt.taskorder
625
         from ms_paper_check_teacher_task pctt
641
         from ms_paper_check_teacher_task pctt
629
         <if test="param.correcttype!=3">
645
         <if test="param.correcttype!=3">
630
             inner join ms_paper_student_question psq on pctt.mpsbid=psq.mpsqid
646
             inner join ms_paper_student_question psq on pctt.mpsbid=psq.mpsqid
631
         </if>
647
         </if>
648
+        where pctt.mpcttid=#{param.mpcttid}
632
     </select>
649
     </select>
633
     <!--教师阅卷-平均分-->
650
     <!--教师阅卷-平均分-->
634
     <select id="avgScore" resultType="java.util.Map">
651
     <select id="avgScore" resultType="java.util.Map">
643
     </select>
660
     </select>
644
     <!--教师阅卷-待批阅数量-->
661
     <!--教师阅卷-待批阅数量-->
645
     <select id="getPendingCorrectNum" resultType="java.lang.Integer">
662
     <select id="getPendingCorrectNum" resultType="java.lang.Integer">
646
-        select count(if(pc.correcttype=3,if(pc.dispenseway=2
647
-        ,(select psb.mpsbid from ms_paper_student_block psb
648
-        where psb.mpid=pct.mpid and psb.mblockid=pct.mblockid and psb.checked!=2 and psb.hasproblem=0 and psb.firstcid!=pct.teacherid and psb.secondcid!=pct.teacherid)
649
-        ,(select pctt.mpcttid from ms_paper_check_teacher_task pctt where pctt.mpid = pc.mpid and pctt.teacherid = #{param.handleid} and pctt.checkstate!=3)
663
+        select sum(a.num) from(select if(pc.correcttype=3,if(pc.dispenseway=2
664
+        ,(select count(psb.mpsbid) from ms_paper_student_block psb
665
+        where psb.mpid=pct.mpid and psb.mblockid=pct.mblockid and psb.hasproblem=0
666
+        and (psb.checked=1 or (psb.checked=2 and ((psb.firstcid=pct.teacherid and psb.firstcime is null)
667
+            or (psb.secondcid=pct.teacherid and psb.secondctime is null)))))
668
+        ,(select count(pctt.mpcttid) from ms_paper_check_teacher_task pctt where pctt.mpid = pc.mpid and pctt.teacherid = #{param.handleid} and pctt.checkstate!=3)
650
         ),if(pc.dispenseway=2
669
         ),if(pc.dispenseway=2
651
-        ,(select psb.mpsqid from ms_paper_student_question psb
652
-        where psb.mpid=pct.mpid and psb.mblockid=pct.mblockid and psb.checked!=2 and psb.hasproblem=0 and psb.firstcid!=pct.teacherid and psb.secondcid!=pct.teacherid)
653
-        ,(select pctt.mpcttid from ms_paper_check_teacher_task pctt where  pctt.mpid = pc.mpid and pctt.teacherid = #{param.handleid} and pctt.checkstate!=3)
654
-        ))) as num
670
+        ,if(pc.correcttype=2,(select count(psb.mpsqid) from ms_paper_student_question psb
671
+        where psb.mpid=pct.mpid and psb.mptqid=pct.mblockid and psb.hasproblem=0
672
+        and (psb.checked=1 or (psb.checked=2 and ((psb.firstcid=pct.teacherid and psb.firstcime is null)
673
+        or (psb.secondcid=pct.teacherid and psb.secondctime is null)))))
674
+        ,(select count(psb.mpsqid) from ms_paper_student_question psb
675
+        inner join ms_class c on c.examid=psb.examid and c.subjectid=psb.subjectid and c.classid=pct.mblockid
676
+        inner join ms_class_student cs on c.examid=cs.examid and c.subjectid=cs.subjectid and pc.mblockid=cs.classid
677
+        where psb.mpid=pct.mpid and psb.mptqid=pct.mblockid and psb.hasproblem=0 and psb.studentid=cs.studentid
678
+        and (psb.checked=1 or (psb.checked=2 and ((psb.firstcid=pct.teacherid and psb.firstcime is null)
679
+        or (psb.secondcid=pct.teacherid and psb.secondctime is null))))))
680
+        ,(select count(pctt.mpcttid) from ms_paper_check_teacher_task pctt where  pctt.mpid = pc.mpid and pctt.teacherid = #{param.handleid} and pctt.checkstate!=3)
681
+        )) as num
655
         from ms_paper_check pc inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid = pc.mpid
682
         from ms_paper_check pc inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid = pc.mpid
656
-        where pc.checkstate=1 and pct.teacherid = #{param.handleid}
683
+        where pc.checkstate=1 and pct.teacherid = #{param.handleid}) as a
657
     </select>
684
     </select>
658
     <!--教师阅卷-待仲裁数量-->
685
     <!--教师阅卷-待仲裁数量-->
659
     <select id="getPendingArbitrateNum" resultType="java.lang.Integer">
686
     <select id="getPendingArbitrateNum" resultType="java.lang.Integer">
660
-        select count(case when pc.correcttype=3 then(select psb.mpsbid from ms_paper_student_block psb
687
+        select sum(a.num) from(select if(pc.correcttype=3,(select count(psb.mpsbid) from ms_paper_student_block psb
661
         where psb.mpid=pc.mpid and psb.mblockid=pc.mblockid and psb.arbitratestate=1)
688
         where psb.mpid=pc.mpid and psb.mblockid=pc.mblockid and psb.arbitratestate=1)
662
-        when pc.correcttype=2 then (select psb.mpsqid from ms_paper_student_question psb
663
-        where psb.mpid=pc.mpid and psb.mptqid=pc.mblockid and psb.arbitratestate=1)
664
-        else (select psb.mpsqid from ms_paper_student_question psb inner join ms_class_student c on psb.examid=c.examid and psb.subjectid=c.subjectid and psb.studentid=c.studentid
665
-        where psb.mpid=pc.mpid and c.classid=pc.mblockid and psb.arbitratestate=1) end) as num
689
+        ,(select count(psb.mpsqid) from ms_paper_student_question psb
690
+        where psb.mpid=pc.mpid and psb.mptqid=pc.mblockid and psb.arbitratestate=1)) as num
666
         from ms_paper_check pc
691
         from ms_paper_check pc
667
-        where pc.checkstate=1 and pc.arbitrateid = #{param.handleid}
692
+        where pc.checkstate=1 and pc.arbitrateid = #{param.handleid}) as a
668
     </select>
693
     </select>
669
 </mapper>
694
 </mapper>

Loading…
Cancel
Save