Browse Source

考试管理

ywx
雍文秀 1 month ago
parent
commit
3208e8b070

+ 58
- 1
smarking/src/main/java/com/xhkjedu/smarking/controller/exam/MsExamController.java View File

6
 import com.xhkjedu.smarking.model.exam.MsExam;
6
 import com.xhkjedu.smarking.model.exam.MsExam;
7
 import com.xhkjedu.smarking.service.exam.MsExamService;
7
 import com.xhkjedu.smarking.service.exam.MsExamService;
8
 import com.xhkjedu.smarking.service.notice.NoticeService;
8
 import com.xhkjedu.smarking.service.notice.NoticeService;
9
+import com.xhkjedu.smarking.utils.MarkingUtil;
9
 import com.xhkjedu.smarking.vo.exam.EBaseVo;
10
 import com.xhkjedu.smarking.vo.exam.EBaseVo;
10
 import com.xhkjedu.smarking.vo.exam.ExamVo;
11
 import com.xhkjedu.smarking.vo.exam.ExamVo;
11
 import com.xhkjedu.utils.N_Utils;
12
 import com.xhkjedu.utils.N_Utils;
93
         EBaseVo exam = msExamService.getExamStateById(examid);//根据考试id获取考试状态
94
         EBaseVo exam = msExamService.getExamStateById(examid);//根据考试id获取考试状态
94
         String examname = exam.getExamname();
95
         String examname = exam.getExamname();
95
         Integer schoolid = exam.getSchoolid();
96
         Integer schoolid = exam.getSchoolid();
96
-        if (exam.getExammode() == 3 && " :00".equals(exam.getStrtime())) return new ResultVo(1, "还有考试试卷未设置时间");
97
+        if (exam.getExammode() == 3) {
98
+            if (" :00".equals(exam.getStrtime())) return new ResultVo(1, "还有考试试卷未设置时间");
99
+            Long timestamp = Long.valueOf(N_Utils.getSecondTimestamp() + 30 * 60);
100
+            Long begintime = MarkingUtil.strToTimestamp(exam.getStrtime());
101
+            if (begintime.compareTo(timestamp) != 1) return new ResultVo(1, "发布时间必须早于最早科目开始考试之前30分钟");
102
+        }
97
         if (exam.getWwcnum() != 0) return new ResultVo(1, "还有考试试卷未设置完成");
103
         if (exam.getWwcnum() != 0) return new ResultVo(1, "还有考试试卷未设置完成");
98
         if (exam.getPbstate() != 2) return new ResultVo(1, "还有考试试卷题块未设置完成");
104
         if (exam.getPbstate() != 2) return new ResultVo(1, "还有考试试卷题块未设置完成");
99
         if (exam.getExamstate() != 0) return new ResultVo(0, "发布成功");
105
         if (exam.getExamstate() != 0) return new ResultVo(0, "发布成功");
125
         N_Utils.validation(new Object[]{createid, "登录人id", 1});
131
         N_Utils.validation(new Object[]{createid, "登录人id", 1});
126
         return new ResultVo(0, "查询成功", msExamService.listClass(createid));
132
         return new ResultVo(0, "查询成功", msExamService.listClass(createid));
127
     }
133
     }
134
+
135
+    /**
136
+     * @Description 删除
137
+     * @Date 2024/11/25 16:46
138
+     * @Author YWX
139
+     * @Param [msExam]
140
+     * @Return com.xhkjedu.vo.ResultVo
141
+     **/
142
+    @PostMapping("/delete")
143
+    public ResultVo delete(@RequestBody MsExam msExam) {
144
+        Integer examid = msExam.getExamid();
145
+        N_Utils.validation(new Object[]{examid, "考试id", 1});
146
+        msExamService.deleteById(examid);
147
+        return new ResultVo(0, "删除成功");
148
+    }
149
+
150
+    /**
151
+     * @Description 取消发布
152
+     * @Date 2024/11/25 16:58
153
+     * @Author YWX
154
+     * @Param [msExam]
155
+     * @Return com.xhkjedu.vo.ResultVo
156
+     **/
157
+    @PostMapping("/qx_fb")
158
+    public ResultVo qxFb(@RequestBody MsExam msExam) {
159
+        Integer examid = msExam.getExamid();
160
+        N_Utils.validation(new Object[]{examid, "考试id", 1});
161
+        msExamService.qxFb(examid);
162
+        return new ResultVo(0, "取消发布成功");
163
+    }
164
+
165
+    /**
166
+     * @Description 修改
167
+     * @Date 2024/11/25 17:13
168
+     * @Author YWX
169
+     * @Param [msExam]
170
+     * @Return com.xhkjedu.vo.ResultVo
171
+     **/
172
+    @PostMapping("/update")
173
+    public ResultVo update(@RequestBody MsExam msExam) {
174
+        Integer examid = msExam.getExamid();
175
+        N_Utils.validation(new Object[]{examid, "考试id", 1});
176
+        return msExamService.update(msExam);
177
+    }
178
+
179
+    @PostMapping("/detail")
180
+    public ResultVo detail(@RequestBody MsExam msExam) {
181
+        Integer examid = msExam.getExamid();
182
+        N_Utils.validation(new Object[]{examid, "考试id", 1});
183
+        return new ResultVo(0, "查询成功", msExamService.findById(examid));
184
+    }
128
 }
185
 }

+ 9
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/MsExamMapper.java View File

27
     Map findById(@Param("examid") Integer examid);
27
     Map findById(@Param("examid") Integer examid);
28
     //考试状态
28
     //考试状态
29
     Integer getExamstate(@Param("examid") Integer examid);
29
     Integer getExamstate(@Param("examid") Integer examid);
30
+
31
+    //删除
32
+    void deleteById(@Param("examid") Integer examid);
33
+
34
+    //删除关联的班级
35
+    void deleteClassById(@Param("examid") Integer examid);
36
+
37
+    //更新考试状态
38
+    void updateExamState(@Param("examid") Integer examid,@Param("examstate") int examstate);
30
 }
39
 }

+ 6
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/exam/MsSubjectMapper.java View File

57
     List<Integer> listMsidsForEndSubject(@Param("strtime") String strtime);
57
     List<Integer> listMsidsForEndSubject(@Param("strtime") String strtime);
58
     //定时任务-科目结束考试
58
     //定时任务-科目结束考试
59
     int updateEndSubject(@Param("timestamp") Integer timestamp,@Param("msids")List<Integer> msids);
59
     int updateEndSubject(@Param("timestamp") Integer timestamp,@Param("msids")List<Integer> msids);
60
+
61
+    //获取考试科目ids
62
+    List<String> listSubjectIdsByExamId(@Param("examid") Integer examid);
63
+
64
+    //获取考试科目信息
65
+    List<Map<String,Object>> listByExamId(@Param("examid") Integer examid);
60
 }
66
 }

+ 2
- 0
smarking/src/main/java/com/xhkjedu/smarking/mapper/stupaper/MsPaperStudentMapper.java View File

81
     //补录成绩-清空学生补录分数
81
     //补录成绩-清空学生补录分数
82
     int updateStuScoreForRestoreFillScore(@Param("examid") Integer examid,@Param("studentid") Integer studentid);
82
     int updateStuScoreForRestoreFillScore(@Param("examid") Integer examid,@Param("studentid") Integer studentid);
83
 
83
 
84
+    //删除考试学生信息
85
+    void deleteByExamId(@Param("examid") Integer examid);
84
 }
86
 }

+ 106
- 35
smarking/src/main/java/com/xhkjedu/smarking/service/exam/MsExamService.java View File

10
 import com.xhkjedu.smarking.model.paper.MsPaper;
10
 import com.xhkjedu.smarking.model.paper.MsPaper;
11
 import com.xhkjedu.smarking.model.paper.MsPaperQtypeQuestion;
11
 import com.xhkjedu.smarking.model.paper.MsPaperQtypeQuestion;
12
 import com.xhkjedu.smarking.model.stupaper.*;
12
 import com.xhkjedu.smarking.model.stupaper.*;
13
+import com.xhkjedu.smarking.utils.MarkingUtil;
13
 import com.xhkjedu.smarking.vo.exam.EBaseVo;
14
 import com.xhkjedu.smarking.vo.exam.EBaseVo;
14
 import com.xhkjedu.utils.N_Utils;
15
 import com.xhkjedu.utils.N_Utils;
16
+import com.xhkjedu.vo.ResultVo;
15
 import com.xhkjedu.vo.system.UserVo;
17
 import com.xhkjedu.vo.system.UserVo;
16
 import lombok.extern.slf4j.Slf4j;
18
 import lombok.extern.slf4j.Slf4j;
17
 import org.springframework.stereotype.Service;
19
 import org.springframework.stereotype.Service;
76
 
78
 
77
     //保存考试基本信息
79
     //保存考试基本信息
78
     private void saveExam(MsExam model, Integer examid) {
80
     private void saveExam(MsExam model, Integer examid) {
79
-        List<Integer> classids = model.getClassids();
80
         List<MsSubject> subjects = model.getSubjects();
81
         List<MsSubject> subjects = model.getSubjects();
82
+        List<String> subjectids = subjects.stream().map(MsSubject::getSubjectid).collect(Collectors.toList());
83
+        saveClassAndStudent(model, examid, subjectids);//保存考试班级和学生
84
+
85
+        //考试科目
86
+        Integer schoolid = model.getSchoolid();
87
+        List<MsPaper> papers = new ArrayList<>();//考试试卷
88
+        for (MsSubject s : subjects) {
89
+            s.setSchoolid(schoolid);
90
+            s.setExamid(examid);
91
+            s.setMsstate(0);
92
+
93
+            MsPaper p = new MsPaper();
94
+            p.setExamid(examid);
95
+            p.setSubjectid(s.getSubjectid());
96
+            p.setPtype(0);
97
+            p.setPnum(0);
98
+            p.setMergepnum(0);
99
+            p.setPscore(0.0);
100
+            p.setAnswered(0);
101
+            p.setHasfile(0);
102
+            p.setHearnum(0);
103
+            papers.add(p);
104
+        }
105
+        msSubjectMapper.insertList(subjects);//考试科目
106
+
107
+        Integer createid = model.getCreateid();
108
+        Integer createtime = model.getCreatetime();
109
+        for (int i = 0; i < papers.size(); i++) {
110
+            MsPaper ePaper = papers.get(i);
111
+            ePaper.setMsid(subjects.get(i).getId());
112
+            ePaper.setCreateid(createid);
113
+            ePaper.setCreatetime(createtime);
114
+        }
115
+        msPaperMapper.insertList(papers);//考试试卷
116
+    }
117
+
118
+    //保存考试班级和学生
119
+    private void saveClassAndStudent(MsExam model, Integer examid, List<String> subjectids) {
120
+        List<Integer> classids = model.getClassids();
81
         if (N_Utils.isListNotEmpty(classids)) {
121
         if (N_Utils.isListNotEmpty(classids)) {
82
             if (!model.getExammode().equals(3)) {//线下考试必须有考号
122
             if (!model.getExammode().equals(3)) {//线下考试必须有考号
83
                 Integer num = msClassStudentMapper.getNoExamNoNumByClassIds(classids);//根据班级ids获取没有考号学生数量
123
                 Integer num = msClassStudentMapper.getNoExamNoNumByClassIds(classids);//根据班级ids获取没有考号学生数量
94
             List<MsClassStudent> studentList = msClassStudentMapper.listByClassIds(classids);
134
             List<MsClassStudent> studentList = msClassStudentMapper.listByClassIds(classids);
95
             List<MsClass> classes = new ArrayList<>();
135
             List<MsClass> classes = new ArrayList<>();
96
             List<MsClassStudent> students = new ArrayList<>();
136
             List<MsClassStudent> students = new ArrayList<>();
97
-            Integer schoolid = model.getSchoolid();
98
-            for (MsSubject s : subjects) {
99
-                s.setSchoolid(schoolid);
100
-                String subjectid = s.getSubjectid();
137
+            for (String subjectid : subjectids) {
101
                 for (MsClass c : classList) {
138
                 for (MsClass c : classList) {
102
                     MsClass c1 = new MsClass();
139
                     MsClass c1 = new MsClass();
103
                     c1.setExamid(examid);
140
                     c1.setExamid(examid);
122
             //考试学生
159
             //考试学生
123
             if (N_Utils.isListNotEmpty(students)) msClassStudentMapper.insertList(students);
160
             if (N_Utils.isListNotEmpty(students)) msClassStudentMapper.insertList(students);
124
         }
161
         }
125
-
126
-        //考试科目
127
-        List<MsPaper> papers = new ArrayList<>();//考试试卷
128
-        for (MsSubject s : subjects) {
129
-            s.setExamid(examid);
130
-            s.setMsstate(0);
131
-
132
-            MsPaper p = new MsPaper();
133
-            p.setExamid(examid);
134
-            p.setSubjectid(s.getSubjectid());
135
-            p.setPtype(0);
136
-            p.setPnum(0);
137
-            p.setMergepnum(0);
138
-            p.setPscore(0.0);
139
-            p.setAnswered(0);
140
-            p.setHasfile(0);
141
-            p.setHearnum(0);
142
-            papers.add(p);
143
-        }
144
-        msSubjectMapper.insertList(subjects);//考试科目
145
-
146
-        Integer createid = model.getCreateid();
147
-        Integer createtime = model.getCreatetime();
148
-        for (int i = 0; i < papers.size(); i++) {
149
-            MsPaper ePaper = papers.get(i);
150
-            ePaper.setMsid(subjects.get(i).getId());
151
-            ePaper.setCreateid(createid);
152
-            ePaper.setCreatetime(createtime);
153
-        }
154
-        msPaperMapper.insertList(papers);//考试试卷
155
     }
162
     }
156
 
163
 
157
     /**
164
     /**
302
         }
309
         }
303
         return msClassMapper.listSchoolClass(schoolid, year, teacherid);
310
         return msClassMapper.listSchoolClass(schoolid, year, teacherid);
304
     }
311
     }
312
+
313
+    /**
314
+     * @Description 删除
315
+     * @Date 2024/11/25 16:46
316
+     * @Author YWX
317
+     * @Param [examid]
318
+     * @Return void
319
+     **/
320
+    public void deleteById(Integer examid) {
321
+        msExamMapper.deleteById(examid);
322
+    }
323
+
324
+    /**
325
+     * @Description 取消发布
326
+     * @Date 2024/11/25 17:33
327
+     * @Author YWX
328
+     * @Param [examid]
329
+     * @Return void
330
+     **/
331
+    @Transactional(rollbackFor = Exception.class)
332
+    public void qxFb(Integer examid) {
333
+        EBaseVo exam = msExamMapper.getExamStateById(examid);
334
+        Long timestamp = Long.valueOf(N_Utils.getSecondTimestamp() + 30 * 60);
335
+        Long begintime = MarkingUtil.strToTimestamp(exam.getStrtime());
336
+        if (begintime != 0 && begintime.compareTo(timestamp) != 1) throw new ServiceException("开考前30分钟禁止取消发布");
337
+        msPaperStudentMapper.deleteByExamId(examid);//删除考试学生信息
338
+        msExamMapper.updateExamState(examid, 0);//更新考试状态
339
+    }
340
+
341
+    /**
342
+     * @Description 修改
343
+     * @Date 2024/11/25 17:13
344
+     * @Author YWX
345
+     * @Param [model]
346
+     * @Return com.xhkjedu.vo.ResultVo
347
+     **/
348
+    @Transactional(rollbackFor = Exception.class)
349
+    public ResultVo update(MsExam model) {
350
+        EBaseVo exam = msExamMapper.getExamStateById(model.getExamid());
351
+        if (0 != exam.getExamstate()) return new ResultVo(1, "考试已发布禁止操作");
352
+        Long timestamp = Long.valueOf(N_Utils.getSecondTimestamp() + 30 * 60);
353
+        Long begintime = MarkingUtil.strToTimestamp(exam.getStrtime());
354
+        if (begintime != 0 && begintime.compareTo(timestamp) != 1) return new ResultVo(1, "开考前30分钟禁止编辑");
355
+        //禁止修改年级、科目、考试模式
356
+        model.setGradeid(null);
357
+        model.setExammode(null);
358
+        msExamMapper.updateByPrimaryKeySelective(model);
359
+        Integer examid = model.getExamid();
360
+        List<Integer> classids = model.getClassids();
361
+        //班级集合为空不处理班级
362
+        if (N_Utils.isListEmpty(classids)) return new ResultVo(0, "修改成功");
363
+        msExamMapper.deleteClassById(examid);//删除关联的班级
364
+        List<String> subjectids = msSubjectMapper.listSubjectIdsByExamId(examid);
365
+        saveClassAndStudent(model, examid, subjectids);//保存考试班级和学生
366
+
367
+        return new ResultVo(0, "修改成功");
368
+    }
369
+
370
+    public Map findById(Integer examid) {
371
+        Map map = msExamMapper.findById(examid);
372
+        map.put("subjects", msSubjectMapper.listByExamId(examid));
373
+        map.put("classes",  msClassMapper.listByExamId(examid,null));
374
+        return map;
375
+    }
305
 }
376
 }

+ 13
- 0
smarking/src/main/resources/mapper/exam/MsExamMapper.xml View File

9
     <update id="postExam">
9
     <update id="postExam">
10
         update ms_exam set examcomm=#{examcomm},examstate=1 where examid=#{examid}
10
         update ms_exam set examcomm=#{examcomm},examstate=1 where examid=#{examid}
11
     </update>
11
     </update>
12
+    <!--删除-->
13
+    <update id="deleteById">
14
+        update ms_exam set deleted=10 where examid=#{examid}
15
+    </update>
16
+    <!--更新考试状态-->
17
+    <update id="updateExamState">
18
+        update ms_exam set examstate=#{examstate} where examid=#{examid}
19
+    </update>
20
+    <!--删除关联的班级-->
21
+    <delete id="deleteClassById">
22
+        delete c.*,cs.* from ms_class c inner join ms_class_student cs on cs.examid=c.examid and cs.classid=c.classid
23
+        where c.examid=#{examid} and c.subjectid=cs.subjectid
24
+    </delete>
12
     <!--考试科目列表-->
25
     <!--考试科目列表-->
13
     <select id="listSubject" resultType="java.util.Map">
26
     <select id="listSubject" resultType="java.util.Map">
14
         select subjectname,if(pstate=1 and ptstate=2 and pbstate=2 and checkstate!=0 and checkset=1
27
         select subjectname,if(pstate=1 and ptstate=2 and pbstate=2 and checkstate!=0 and checkset=1

+ 8
- 0
smarking/src/main/resources/mapper/exam/MsSubjectMapper.xml View File

116
         where e.examstate>=1 and e.deleted=1 and e.exammode=3 and ms.msstate=1
116
         where e.examstate>=1 and e.deleted=1 and e.exammode=3 and ms.msstate=1
117
         and adddate(concat(ms.sdate,' ',ms.endtime),interval 5 minute) &lt;#{strtime}
117
         and adddate(concat(ms.sdate,' ',ms.endtime),interval 5 minute) &lt;#{strtime}
118
     </select>
118
     </select>
119
+    <!--获取考试科目ids-->
120
+    <select id="listSubjectIdsByExamId" resultType="java.lang.String">
121
+        select subjectid from ms_subject where examid=#{examid}
122
+    </select>
123
+    <!--获取考试科目信息-->
124
+    <select id="listByExamId" resultType="java.util.Map">
125
+        select * from ms_subject where examid=#{examid}
126
+    </select>
119
     <!--定时任务-科目结束考试-->
127
     <!--定时任务-科目结束考试-->
120
     <update id="updateEndSubject">
128
     <update id="updateEndSubject">
121
         update ms_subject ms
129
         update ms_subject ms

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

265
             ,psb.mpsbid,null)) as myUncheckedNum
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
266
             ,(select group_concat(pbbq.bqn separator '、') from ms_paper_block_question pbbq where pbbq.mblockid = pb.mblockid) as bqn
267
             from ms_paper_check pc left join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
267
             from ms_paper_check pc left join ms_paper_student_block psb on psb.mblockid = pc.mblockid and psb.mpid = pc.mpid
268
-            and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or pc.dispenseway=2)
268
+            and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or psb.checked=1) and psb.checked!=0
269
             inner join ms_paper_block pb on pc.mblockid = pb.mblockid and pb.mpid = pc.mpid
269
             inner join ms_paper_block pb on pc.mblockid = pb.mblockid and pb.mpid = pc.mpid
270
             inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid and pct.teacherid = #{param.handleid}
270
             inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid and pct.teacherid = #{param.handleid}
271
             where pc.mpid=#{param.mpid}
271
             where pc.mpid=#{param.mpid}
283
             or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or psb.checked=1)
283
             or (psb.secondctime is null and psb.secondcid=#{param.handleid}) or psb.checked=1)
284
             ,psb.mpsqid,null)) as myUncheckedNum
284
             ,psb.mpsqid,null)) as myUncheckedNum
285
             from ms_paper_check pc left join ms_paper_student_question psb on psb.mptqid = pc.mblockid and psb.mpid = pc.mpid
285
             from ms_paper_check pc left join ms_paper_student_question psb on psb.mptqid = pc.mblockid and psb.mpid = pc.mpid
286
-            and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or pc.dispenseway=2) and psb.answered=1
286
+            and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or psb.checked=1) and psb.checked!=0
287
             inner join ms_paper_qtype_question pb on pc.mblockid = pb.mptqid and pb.mpid = pc.mpid
287
             inner join ms_paper_qtype_question pb on pc.mblockid = pb.mptqid and pb.mpid = pc.mpid
288
             inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid and pct.teacherid = #{param.handleid}
288
             inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid and pct.teacherid = #{param.handleid}
289
             where pc.mpid=#{param.mpid}
289
             where pc.mpid=#{param.mpid}
303
             from ms_paper_check pc inner join ms_class c on pc.mblockid = c.classid
303
             from ms_paper_check pc inner join ms_class c on pc.mblockid = c.classid
304
             inner join ms_class_student cs on c.examid=cs.examid and c.subjectid=cs.subjectid and pc.mblockid=cs.classid
304
             inner join ms_class_student cs on c.examid=cs.examid and c.subjectid=cs.subjectid and pc.mblockid=cs.classid
305
             inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid and pct.teacherid = #{param.handleid}
305
             inner join ms_paper_check_teacher pct on pc.mblockid = pct.mblockid and pct.mpid=pc.mpid and pct.teacherid = #{param.handleid}
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)
307
-            and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or psb.checked=1)
306
+            left join ms_paper_student_question psb on psb.mpid = pc.mpid and psb.studentid=cs.studentid
307
+            and (psb.firstcid = #{param.handleid} or psb.secondcid = #{param.handleid} or psb.checked=1) and psb.checked!=0
308
             where pc.mpid=#{param.mpid} and c.subjectid=#{param.subjectid}
308
             where pc.mpid=#{param.mpid} and c.subjectid=#{param.subjectid}
309
             group by c.classid
309
             group by c.classid
310
             order by c.mcid
310
             order by c.mcid
373
         <if test="param.dispenseway!=null and param.dispenseway!=2">
373
         <if test="param.dispenseway!=null and param.dispenseway!=2">
374
             select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
374
             select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
375
             ,2 as answertype
375
             ,2 as answertype
376
-            ,pctt.mpid,pctt.mblockid,pctt.mpsbid,pctt.mptqid
376
+            ,pctt.mpid,pctt.mblockid,pctt.mpsbid,pctt.mptqid,pctt.checktype
377
             from ms_paper_student_block psq inner join ms_paper_check_teacher_task pctt on psq.mpsbid = pctt.mpsbid and psq.mpid=pctt.mpid
377
             from ms_paper_student_block psq inner join ms_paper_check_teacher_task pctt on psq.mpsbid = pctt.mpsbid and psq.mpid=pctt.mpid
378
             where pctt.mpid=#{param.mpid} and pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.teacherid}
378
             where pctt.mpid=#{param.mpid} and pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.teacherid}
379
             and pctt.checkstate!=3 and psq.hasproblem=0
379
             and pctt.checkstate!=3 and psq.hasproblem=0
383
         <if test="param.dispenseway!=null and param.dispenseway==2">
383
         <if test="param.dispenseway!=null and param.dispenseway==2">
384
             select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
384
             select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
385
             ,2 as answertype
385
             ,2 as answertype
386
-            ,psq.mblockid,psq.mpsbid
386
+            ,psq.mblockid,psq.mpsbid,psq.firstcid
387
             from ms_paper_student_block psq
387
             from ms_paper_student_block psq
388
             where psq.mpid=#{param.mpid} and psq.mblockid = #{param.mblockid}
388
             where psq.mpid=#{param.mpid} and psq.mblockid = #{param.mblockid}
389
             and (psq.checked=1 or (psq.checked=2 and ((psq.firstcid=#{param.teacherid} and psq.firstcime is null)
389
             and (psq.checked=1 or (psq.checked=2 and ((psq.firstcid=#{param.teacherid} and psq.firstcime is null)
504
         <if test="param.dispenseway!=null and param.dispenseway!=2">
504
         <if test="param.dispenseway!=null and param.dispenseway!=2">
505
             select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
505
             select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
506
             ,psq.answertype
506
             ,psq.answertype
507
-            ,pctt.mpid,pctt.mblockid,pctt.mpsbid,pctt.mptqid
507
+            ,pctt.mpid,pctt.mblockid,pctt.mpsbid,pctt.mptqid,pctt.checktype
508
             from ms_paper_student_question psq inner join ms_paper_check_teacher_task pctt on psq.mpsqid = pctt.mpsbid and psq.mpid=pctt.mpid
508
             from ms_paper_student_question psq inner join ms_paper_check_teacher_task pctt on psq.mpsqid = pctt.mpsbid and psq.mpid=pctt.mpid
509
             where pctt.mpid=#{param.mpid} and pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.teacherid}
509
             where pctt.mpid=#{param.mpid} and pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.teacherid}
510
             and pctt.checkstate!=3 and psq.hasproblem=0
510
             and pctt.checkstate!=3 and psq.hasproblem=0
514
         <if test="param.dispenseway!=null and param.dispenseway==2">
514
         <if test="param.dispenseway!=null and param.dispenseway==2">
515
             select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
515
             select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
516
             ,psq.answertype
516
             ,psq.answertype
517
-            ,psq.mptqid as mblockid,psq.mpsqid as mpsbid,psq.mptqid
517
+            ,psq.mptqid as mblockid,psq.mpsqid as mpsbid,psq.mptqid,psq.firstcid
518
             from ms_paper_student_question psq
518
             from ms_paper_student_question psq
519
             where psq.mpid=#{param.mpid} and psq.mptqid = #{param.mblockid}
519
             where psq.mpid=#{param.mpid} and psq.mptqid = #{param.mblockid}
520
             and (psq.checked=1 or (psq.checked=2 and ((psq.firstcid=#{param.teacherid} and psq.firstcime is null)
520
             and (psq.checked=1 or (psq.checked=2 and ((psq.firstcid=#{param.teacherid} and psq.firstcime is null)
544
         <if test="param.dispenseway!=null and param.dispenseway!=2">
544
         <if test="param.dispenseway!=null and param.dispenseway!=2">
545
             select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
545
             select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
546
             ,psq.answertype
546
             ,psq.answertype
547
-            ,pctt.mpid,pctt.mblockid,pctt.mpsbid,pctt.mptqid
547
+            ,pctt.mpid,pctt.mblockid,pctt.mpsbid,pctt.mptqid,pctt.checktype
548
             from ms_paper_student_question psq inner join ms_paper_check_teacher_task pctt on psq.mpsqid = pctt.mpsbid and psq.mpid=pctt.mpid
548
             from ms_paper_student_question psq inner join ms_paper_check_teacher_task pctt on psq.mpsqid = pctt.mpsbid and psq.mpid=pctt.mpid
549
             where pctt.mpid=#{param.mpid} and pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.teacherid}
549
             where pctt.mpid=#{param.mpid} and pctt.mblockid = #{param.mblockid} and pctt.teacherid = #{param.teacherid}
550
             and pctt.checkstate!=3 and psq.hasproblem=0
550
             and pctt.checkstate!=3 and psq.hasproblem=0
554
         <if test="param.dispenseway!=null and param.dispenseway==2">
554
         <if test="param.dispenseway!=null and param.dispenseway==2">
555
             select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
555
             select psq.stuanswer,psq.hasgood,psq.hasbad,psq.hasproblem,psq.problemtype,psq.problemcomm
556
             ,psq.answertype
556
             ,psq.answertype
557
-            ,c.classid as mblockid,psq.mpsqid as mpsbid,psq.mptqid
557
+            ,c.classid as mblockid,psq.mpsqid as mpsbid,psq.mptqid,psq.firstcid
558
             from ms_paper_student_question psq inner join ms_class c on c.examid=psq.examid and c.subjectid=psq.subjectid
558
             from ms_paper_student_question psq inner join ms_class c on c.examid=psq.examid and c.subjectid=psq.subjectid
559
             inner join ms_class_student cs on cs.examid=psq.examid and cs.subjectid=psq.subjectid and cs.studentid=psq.studentid
559
             inner join ms_class_student cs on cs.examid=psq.examid and cs.subjectid=psq.subjectid and cs.studentid=psq.studentid
560
             where psq.mpid=#{param.mpid} and c.classid = #{param.mblockid}
560
             where psq.mpid=#{param.mpid} and c.classid = #{param.mblockid}

+ 4
- 0
smarking/src/main/resources/mapper/stupaper/MsPaperStudentMapper.xml View File

233
     <delete id="deletePaperStuByMpid">
233
     <delete id="deletePaperStuByMpid">
234
         delete from ms_paper_student where mpid=#{mpid};
234
         delete from ms_paper_student where mpid=#{mpid};
235
     </delete>
235
     </delete>
236
+    <!--删除考试学生信息-->
237
+    <delete id="deleteByExamId">
238
+        delete from ms_paper_student where examid=#{examid}
239
+    </delete>
236
 
240
 
237
     <!--扫描异常-清空学生扫描试卷信息-->
241
     <!--扫描异常-清空学生扫描试卷信息-->
238
     <update id="updateStuPaperForScanErrorClear">
242
     <update id="updateStuPaperForScanErrorClear">

Loading…
Cancel
Save