浏览代码

考试修改完善

tags/正式版本
雍文秀 2 年前
父节点
当前提交
6f8ac0e303

+ 2
- 2
sexam/src/main/java/com/xhkjedu/sexam/mapper/exam/EBaseMapper.java 查看文件

@@ -12,8 +12,8 @@ public interface EBaseMapper extends TkMapper<EBase> {
12 12
     //考试删除
13 13
     Integer deleteById(@Param("examid") Integer examid);
14 14
 
15
-    //删除关联的班级和科目
16
-    void deleteClassAndSubjectById(@Param("examid") Integer examid);
15
+    //删除关联的班级
16
+    void deleteClassById(@Param("examid") Integer examid);
17 17
 
18 18
     //考试列表
19 19
     List<Map> listAll(@Param("base") EBase base);

+ 1
- 0
sexam/src/main/java/com/xhkjedu/sexam/service/exam/EBaseService.java 查看文件

@@ -163,6 +163,7 @@ public class EBaseService {
163 163
             List<Integer> classids = model.getClassids();
164 164
             //班级集合为空不处理班级
165 165
             if (N_Utils.isListEmpty(classids)) return new ResultVo(0, "修改成功");
166
+            eBaseMapper.deleteClassById(examid);//删除关联的班级
166 167
             if(exam.getExammode() == 2) {//线下考试必须有考号
167 168
                 Integer num = eClassStudentMapper.getNoExamNoNumByClassIds(classids);//根据班级ids获取没有考号学生数量
168 169
                 if (num != 0) return new ResultVo(1, "有学生没有考号");

+ 4
- 8
sexam/src/main/resources/mapper/exam/EBaseMapper.xml 查看文件

@@ -5,14 +5,10 @@
5 5
     <update id="deleteById">
6 6
         update e_base set deleted=10 where examid=#{examid}
7 7
     </update>
8
-    <!--删除关联的班级和科目、试卷、试卷批阅人-->
9
-    <delete id="deleteClassAndSubjectById">
10
-        delete ecq,epc,ep,s,c,cs from e_subject s left join e_class c on s.examid=c.examid
11
-        left join e_class_student cs on cs.examid=c.examid
12
-        left join e_paper ep on s.esid = ep.esid
13
-        left join e_paper_correctclass epc on ep.epid = epc.epid
14
-        left join e_paper_correctquestion ecq on ep.epid = ecq.epid
15
-        where s.examid=#{examid}
8
+    <!--删除关联的班级-->
9
+    <delete id="deleteClassById">
10
+        delete c,cs from e_class c left join e_class_student cs on cs.examid=c.examid
11
+        where c.examid=#{examid}
16 12
     </delete>
17 13
     <!--考试列表-->
18 14
     <select id="listAll" resultType="java.util.Map">

正在加载...
取消
保存