<?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.AttendanceFestivalRulesMapper" >
    <update id="updateState">
        UPDATE ftb_attendance_festival_rules
        SET F_State = #{state},
            F_LastModifyTime = now(),
            F_LastModifyUserId = #{userId}
        WHERE F_Id = #{id}
    </update>

    <select id="getPageList" resultType="jnpf.model.attendance.vo.attendance.AttendanceFestivalRulesVo">
        SELECT
        F_Id AS id,
        F_Name AS `name`,
        F_FestivalDate AS festivalDate,
        F_CompensateInDate AS compensateInDate,
        F_ScopeOfAdaptation AS scopeOfAdaptation,
        F_StartDate as startDate,
        F_EndDate as endDate,
        F_State AS state
        FROM ftb_attendance_festival_rules
        WHERE F_DeleteMark = 0
        <if test="queryDto.iText != null and queryDto.iText != ''">
            AND F_Name LIKE concat('%',#{queryDto.iText},'%')
        </if>
        <if test="queryDto.year != null and queryDto.year != ''">
            AND F_Year = #{queryDto.year}
        </if>
        order by F_LastModifyTime desc,F_StartDate asc
    </select>
</mapper>