<?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.bonus.canteen.core.android.mapper.FaceMapper">
    <select id="getFaceFeatureList" resultType="com.bonus.canteen.core.user.domain.UserFace">
        select
            user_id,
            photo_url,
            features,
            face_state
        from user_face
        <where>
            and face_state = '1'
            <if test="userId != null and userId != '' and userId != 0 and userId != '0'">
                and user_id = #{userId}
            </if>
            <if test="time != null and time != ''">
                and update_time >= #{time} - INTERVAL 10 SECOND
            </if>
        </where>
    </select>
</mapper>