<?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="cn.com.ctop.common.module.mapper.MaterialParameterMapper">

    <select id="getMaterialTotalCharge" resultType="com.alibaba.fastjson.JSONObject">
        SELECT
        signature,
        sum(charge) as charges
        FROM application.kuaishou_material_video_report_daily_dw
        WHERE signature = #{signature}
    </select>

    <select id="getByteDanceMaterialTotalCharge" resultType="com.alibaba.fastjson.JSONObject">
        SELECT
            signature,
            sum(cost) as charges
        FROM application.bytedance_material_video_report_daily_dw
        WHERE signature = #{signature}
    </select>
    <select id="getKuaiShouVideoCostList" resultType="com.alibaba.fastjson.JSONObject">
        SELECT
        signature,
        sum(charge) as charges
        FROM application.kuaishou_material_video_report_daily_dw
        WHERE signature
        in
        <foreach item="md5" index="index" collection="md5List"
                 open="(" separator="," close=")">
            #{md5}
        </foreach>
        group by signature;


    </select>
    <select id="getBytedanceVideoCostList" resultType="com.alibaba.fastjson.JSONObject">
        SELECT
        signature,
        sum(cost) as charges
        FROM application.bytedance_material_video_report_daily_dw
        WHERE signature
        in
        <foreach item="md5" index="index" collection="md5List"
                 open="(" separator="," close=")">
            #{md5}
        </foreach>
        group by signature;

    </select>
</mapper>