<?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="org.jeecg.modules.bytedance.advertise.mapper.ByteDanceAdvertisePlanMapper">

    <select id="selectWarningGroup" resultType="java.lang.String">
   SELECT
   name
   FROM ctop_bytedance_advertise_plan
   WHERE account_id = #{accountId}
   and (cpa_bid &gt; #{maxBid} or bid &gt; #{maxBid})
   and toutiao_status = 'AD_STATUS_DELIVERY_OK'
    </select>


    <select id="selectWarningCpaBid" resultType="java.lang.String">
   SELECT
   name
   FROM ctop_bytedance_advertise_plan
   WHERE account_id = #{accountId}
   and deep_cpabid &gt; #{maxCpaBid}
   and toutiao_status = 'AD_STATUS_DELIVERY_OK'
    </select>
    <select id="queryTodayBuiltCount" resultType="java.lang.Integer">
        SELECT count(1) FROM ctop_bytedance_advertise_plan
        WHERE account_id = #{accountId}
          AND LOCATE(#{date}, ad_create_time)
    </select>


</mapper>
