<?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="com.qmth.jkserver.dao.ExamRepeatRecordDao">

    <select id="findByExamCodeAndBatchIdAndPlaceCodeAndRoomCodeByIpage" resultType="com.qmth.jkserver.model.ExamRepeatRecord">
        select t.* from jk_exam_repeat_record t
        <where>
            <if test="examCode != null and examCode != ''">
                and t.exam_code = #{examCode}
            </if>
            <if test="batchId != null and batchId != ''">
                and t.batch_id = #{batchId}
            </if>
            <if test="placeCodeSet != null and placeCodeSet != '' and placeCodeSet.size > 0">
                and t.place_code in
                <foreach collection="placeCodeSet" item="item" index="index"
                         open="(" close=")" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="roomCode != null and roomCode != ''">
                and t.room_code = #{roomCode}
            </if>
        </where>
        order by t.ticket_no,t.course_code
    </select>
</mapper>
