智慧保安后台管理-外网项目备份
钟日健
2026-06-01 62eb499b0c969f246d3245d1429a97da4de1ce28
src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.xml
@@ -103,7 +103,8 @@
            ke.*,
            bu.real_name realName,
            bd.dept_name deptName,
            bu1.real_name confirmUserName
            bu1.real_name confirmUserName,
            bu2.real_name auditUserName
        FROM
            ksxt_exam ke
        left join
@@ -118,6 +119,10 @@
            blade_user bu1
        on
            ke.confirm_user = bu1.id
        left join
            blade_user bu2
        on
            ke.audit_user = bu2.id
        where
        1=1
        <if test="paper.examType!=null and paper.examType!=''">
@@ -592,10 +597,27 @@
            (
                SELECT * FROM ( SELECT * FROM exam_subject_choices WHERE choices_type = 0 ORDER BY RAND( ) LIMIT 70 ) a UNION ALL
                SELECT * FROM ( SELECT * FROM exam_subject_choices WHERE choices_type = 1 ORDER BY RAND( ) LIMIT 10 ) b UNION ALL
                SELECT * FROM ( SELECT * FROM exam_subject_choices WHERE choices_type = 2 ORDER BY RAND( ) LIMIT 20 ) c UNION ALL
                SELECT * FROM ( SELECT * FROM exam_subject_choices WHERE choices_type = 2 ORDER BY RAND( ) LIMIT 20 ) c
            ) esc
            LEFT JOIN exam_subject_option eso ON esc.id = eso.subject_choices_id
    </select>
    <select id="getList" resultType="org.springblade.modules.exam.vo.ExamPaperVO">
        SELECT * FROM ksxt_exam
        where 1=1
        <if test="vo.examTime != null and vo.examTime != ''">
            AND DATE_FORMAT(start_time,'%Y-%m-%d') = DATE_FORMAT(#{vo.examTime},'%Y-%m-%d')
        </if>
        ORDER BY start_time DESC
    </select>
    <select id="getLatest" resultType="org.springblade.modules.exam.vo.ExamPaperVO">
        SELECT * FROM ksxt_exam
        where 1=1
        <if test="vo.examTime != null and vo.examTime != ''">
            AND DATE_FORMAT(start_time,'%Y-%m-%d') = DATE_FORMAT(#{vo.examTime},'%Y-%m-%d')
        </if>
        ORDER BY start_time DESC
        LIMIT 1
    </select>
</mapper>