<?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="cn.iocoder.yudao.module.jx.mapper.StudentScoreInputMapper">

    <select id="selectBatch" parameterType="cn.iocoder.yudao.module.jx.domain.StudentScoreInput" resultType="cn.iocoder.yudao.module.exam.vo.ExamBatchItemNewVO">
        SELECT dseb.id AS batchId, dsebi.id AS batchItemId from drive_school_exam_batch dseb
        left join drive_school_exam_batch_item dsebi ON dseb.id = dsebi.batch_id
        WHERE dseb.course_id = #{entity.courseId}
          AND dseb.coach_id = #{entity.coachId}
          AND dseb.subject = #{entity.subject}
          AND dsebi.fraction = #{entity.fraction}
        AND dsebi.user_id = #{entity.userId}
        ORDER BY dseb.update_time DESC
            LIMIT 1;
    </select>

</mapper>
