<?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="jnpf.attendance.mapper.AttendanceRepairMapper" >

    <!-- 根据时间判定使用的配置 -->
    <select id="getAttendanceRepairByDate" resultType="jnpf.entity.attendance.AttendanceRepair">
        select F_Id id, F_GroupId groupId, F_UserId userId, F_GenerateYear generateYear, F_GenerateMonth generateMonth, F_GenerateDay generateDay,
               F_TotalNum totalNum, F_RepairNum repairNum, F_RepairRecord repairRecord, F_ExpireDate expireDate
        from ftb_attendance_repair
        where F_DeleteMark = 0
        and date(#{applyDate}) between
        date(concat(F_GenerateYear, '-', F_GenerateMonth, '-', F_GenerateDay))
        and F_ExpireDate and F_UserId = #{userId} and F_GroupId = #{groupId}
        order by F_CreatorTime desc limit 1
    </select>
</mapper>