<?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.ctop.mapper.KuaishouMatcostAccountMayMapper">
    <update id="updateByCode">
        update kuaishou_matcost_account_jun_12_18 set min_date = #{minDate}
        where video_code = #{code}
    </update>
    <update id="updateCostByCode">
        update kuaishou_matcost_account_jun_12_18 set twcost = #{cost}
        where video_code = #{code}
    </update>
    <select id="getMinDateByCode" resultType="java.lang.String">
    select substr(min(tmp.stat_date),1,10) from kuaishou_video_new_v2 video
        left join tmp_kuaishou_creative_statdate2 tmp on tmp.photo_id = video.photo_id
        where video.video_code = #{code}
    </select>
    <select id="getCostByParams" resultType="java.math.BigDecimal">
        SELECT
            sum(report.charge)
        FROM
        tmp_kuaishou_creative_report report
        WHERE
        report.video_code =#{code} and report.state_date &gt;= #{startDate} and report.state_date &lt; #{endDate};
    </select>
</mapper>
