<?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.sundot.airport.exam.mapper.DailyAnswerRecordMapper">

    <!-- 查询用户最近N次答题记录数量 -->
    <select id="countRecentRecords" resultType="int">
        SELECT COUNT(*)
        FROM edu_cs_daily_answer_record
        WHERE dar_user_id = #{userId}
          AND del_status = 0
        ORDER BY dar_submit_time DESC
        LIMIT #{limit}
    </select>

</mapper>
