<?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.yunzhi.marketing.mapper.TaCheckinMapper">
    <select id="getCheckinCustomerList" resultType="com.yunzhi.marketing.entity.TaCheckin">
        SELECT
        *
        FROM
        ta_checkin
        WHERE
        STATUS = #{status}
        AND activity = #{activity}
        <if test="checkinTime != null">
            AND checkin_time &gt;= #{checkinTime}
        </if>
    </select>

    <select id="isCustomerChecked" resultType="int">
        SELECT
        count(1)
        FROM
        ta_checkin
        WHERE
        activity = #{activity}
        AND person_id = #{personId}
    </select>

</mapper>
