<?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.TaMiniFormidsMapper">
    <select id="getFormidCanUse" resultType="com.yunzhi.marketing.entity.TaMiniFormids">
        SELECT
            *
        FROM
            ta_mini_formids t
        WHERE
            t.openid = #{openid}
        AND ADDDATE(t.create_date, INTERVAL 6 DAY) >= now()
        ORDER BY t.create_date ASC
        LIMIT 1
    </select>
</mapper>
