From f63fff71fcd7a62ad73b0b9eda614f3b1fa3badf Mon Sep 17 00:00:00 2001
From: 钟日健 <5689795+arsn@user.noreply.gitee.com>
Date: Fri, 22 Oct 2021 22:51:09 +0800
Subject: [PATCH] 考试成绩修改状态重置

---
 src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.xml |   45 +++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.xml b/src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.xml
index 84f8b7d..b3ce2b6 100644
--- a/src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.xml
+++ b/src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.xml
@@ -101,9 +101,19 @@
 
     <select id="selectExamPaperPage" resultType="org.springblade.modules.exam.vo.ExamPaperVO">
         SELECT
-            *
+            ke.*,
+            bu.real_name realName,
+            bd.dept_name deptName
         FROM
-            ksxt_exam
+            ksxt_exam ke
+        left join
+            blade_user bu
+        on
+            ke.creator = bu.id
+        left join
+            blade_dept bd
+        on
+            bd.id = bu.dept_id
         where
         1=1
         <if test="paper.examType!=null and paper.examType!=''">
@@ -111,6 +121,9 @@
         </if>
         <if test="paper.examName!=null and paper.examName!=''">
             and exam_name like concat('%',#{paper.examName},'%')
+        </if>
+        <if test="paper.deptId!=null and paper.deptId!=''">
+            and bd.id = #{paper.deptId}
         </if>
         <if test="paper.auditStatus!=null and paper.auditStatus!=''">
             and audit_status = #{paper.auditStatus}
@@ -283,4 +296,32 @@
         )
     </select>
 
+    <!--查询当前人员当前考试的考试题目信息-->
+    <select id="getExaminationSubjectList" resultType="org.springblade.modules.exam.vo.ExamSubjectChoicesVO">
+        SELECT
+            esc.id,esc.category_id,esc.subject_name,esc.choices_type,esc.score,esc.level
+        FROM
+            exam_subject_choices esc
+        left join
+        exam_examination_subject ees
+        on
+        esc.id = ees.subject_id
+        where 1=1
+        and ees.examination_id = #{examPaper.scoreId}
+    </select>
+
+    <!--批量新增考生考题信息-->
+    <insert id="insertBatch" parameterType="java.util.List">
+        insert into exam_examination_subject
+        (examination_id,category_id,subject_id)
+        values
+        <foreach collection="list" index="index" item="item" separator=",">
+            (
+                #{item.examinationId},
+                #{item.categoryId},
+                #{item.subjectId}
+            )
+        </foreach>
+    </insert>
+
 </mapper>

--
Gitblit v1.9.3