From 00c66882f4f25f8b3e6aa86579ad286a477bceaa Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Thu, 30 Nov 2023 16:50:33 +0800
Subject: [PATCH] 模拟考试成绩查询

---
 src/main/java/org/springblade/modules/simulateexam/mapper/SimulateExamRecordMapper.xml |   38 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/src/main/java/org/springblade/modules/simulateexam/mapper/SimulateExamRecordMapper.xml b/src/main/java/org/springblade/modules/simulateexam/mapper/SimulateExamRecordMapper.xml
index 63df94e..519feb2 100644
--- a/src/main/java/org/springblade/modules/simulateexam/mapper/SimulateExamRecordMapper.xml
+++ b/src/main/java/org/springblade/modules/simulateexam/mapper/SimulateExamRecordMapper.xml
@@ -4,11 +4,47 @@
 
     <!--自定义查询模拟考试记录分页数据-->
     <select id="selectSimulateExamRecordPage" resultType="org.springblade.modules.simulateexam.vo.SimulateExamRecordVO">
-        select * from simulate_exam_record
+        SELECT ser.*,bu.real_name as userName,bd.dept_name as deptName FROM simulate_exam_record ser
+        LEFT JOIN blade_user bu ON bu.phone = ser.phone
+        LEFT JOIN blade_dept bd ON bd.id = bu.dept_id
         where 1=1
+        <if test="simulateExamRecord.phone != null and simulateExamRecord.phone != ''" >
+            and ser.phone LIKE CONCAT('%',#{simulateExamRecord.phone},'%')
+        </if>
         <if test="simulateExamRecord.idCardNo!=null and simulateExamRecord.idCardNo!=''">
             and id_card_no=#{simulateExamRecord.idCardNo}
         </if>
+        <if test="simulateExamRecord.deptId!=null and simulateExamRecord.deptId!=''">
+            AND bu.dept_id = #{simulateExamRecord.deptId}
+        </if>
+        <if test="simulateExamRecord.userName != null and simulateExamRecord.userName !='' ">
+            AND bu.real_name LIKE CONCAT('%',#{simulateExamRecord.userName},'%')
+        </if>
+        ORDER BY ser.start_time DESC
+    </select>
+
+
+    <!--查询当前人员当前模拟考试的考试题目信息-->
+    <select id="getSimulateExamRefreshList" resultType="org.springblade.modules.exam.vo.ExamSubjectChoicesVO">
+        select
+        id,
+        category_id categoryId,
+        subject_name subjectName,
+        choices_type choicesType,
+        answer,
+        score,
+        analysis,
+        tktype
+        from exam_subject_choices
+        where id in
+        <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
+            #{item}
+        </foreach>
+        order by field(id,
+        <foreach collection="list" index="index" item="item" separator=",">
+            #{item}
+        </foreach>
+        )
     </select>
 
 </mapper>

--
Gitblit v1.9.3