智慧保安后台管理-外网项目备份
钟日健
2026-06-01 62eb499b0c969f246d3245d1429a97da4de1ce28
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.springblade.modules.simulateexam.mapper.SimulateExamRecordMapper">
 
    <!--自定义查询模拟考试记录分页数据-->
    <select id="selectSimulateExamRecordPage" resultType="org.springblade.modules.simulateexam.vo.SimulateExamRecordVO">
        SELECT
            DISTINCT ser.*,
            bu.real_name AS userName,
            bd.dept_name AS deptName
        FROM
            simulate_exam_record ser
        LEFT JOIN blade_user bu ON bu.cardid = ser.id_card_no
        LEFT JOIN blade_dept bd ON bd.id = bu.dept_id
        WHERE
            bu.is_deleted = 0
            AND ser.id_card_no IS NOT NULL
            AND ser.id_card_no != ""
        <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>