<?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.FtbAttendanceFaceChangeLogMapper" >

    <!-- 变动记录列表 -->
    <select id="getChangeLogList" resultType="jnpf.model.attendance.vo.ChangeLogVo">
        select F_Id id, F_CreatorUserId creatorUserId, F_FaceId faceId, F_UserId userId, F_Content content, F_CreatorTime creatorTime
        from ftb_attendance_face_change_log where 1 = 1
        <if test="null != startDate and '' != startDate">
            <![CDATA[
              and DATE_FORMAT(F_CreatorTime, '%Y-%m-%d') >= DATE_FORMAT(#{startDate}, '%Y-%m-%d')
            ]]>
        </if>
        <if test="null != endDate and '' != endDate">
            <![CDATA[
              and DATE_FORMAT(F_CreatorTime, '%Y-%m-%d') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d')
            ]]>
        </if>
        <if test="null != list and list.size > 0">
            and F_UserId in
            <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
              #{item}
            </foreach>
        </if>
        order by F_CreatorTime desc
    </select>
</mapper>