<?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.xueyi.system.staff.mapper.DmVisitRecordsMapper">
    <select id="findByName" parameterType="Object" resultType="DmVisitRecordsPo">
        select * from dm_visit_records u where u.visit_date = CURRENT_DATE AND u.visitor_code = #{visitorName} AND del_flag=0 limit 1
    </select>

    <select id="findByEmp" parameterType="Object" resultType="DmVisitRecordsPo">
        select * from dm_visit_records u where u.user_id = #{userId} and (visit_date >= CURRENT_DATE or create_time >= CURRENT_DATE) AND del_flag=0
    </select>

    <select id="findList" parameterType="Object" resultType="DmVisitRecordsPo">
        select * from dm_visit_records u where (visit_date >= CURRENT_DATE or create_time >= CURRENT_DATE) AND del_flag=0
    </select>

</mapper>