|
@@ -561,51 +561,80 @@
|
|
|
SELECT
|
|
|
a.project_id as projectId,
|
|
|
a.project_name as projectName,
|
|
|
- SUM(a.cost) as totalCost,
|
|
|
- IFNULL(SUM(b.new_ad_num),0) as baseNum
|
|
|
+ SUM(a.cost) as totalCost
|
|
|
FROM
|
|
|
application.bytedance_advertiser_report_daily_dw a
|
|
|
- LEFT JOIN application.app_bytedance_account_base_info_d b
|
|
|
- on a.project_id = b.project_id
|
|
|
<where>
|
|
|
<if test="startTime !=null and startTime != ''">
|
|
|
AND a.stat_datetime >= #{startTime}
|
|
|
- AND b.stat_date >= #{startTime}
|
|
|
</if>
|
|
|
<if test="endTime !=null and endTime != ''">
|
|
|
AND a.stat_datetime <= #{endTime}
|
|
|
- AND b.stat_date <= #{endTime}
|
|
|
</if>
|
|
|
</where>
|
|
|
GROUP BY a.project_id
|
|
|
ORDER BY totalCost DESC
|
|
|
limit 10
|
|
|
</select>
|
|
|
+ <!-- 项目消耗排行 top10 头条-基建数-->
|
|
|
+ <select id="getMediaTypeProjectCostBytedanceBase" resultType="java.util.LinkedHashMap">
|
|
|
+ SELECT
|
|
|
+ b.project_id as projectId,
|
|
|
+ IFNULL(SUM(b.new_ad_num),0) as baseNum
|
|
|
+ FROM
|
|
|
+ application.app_bytedance_account_base_info_d b
|
|
|
+ <where>
|
|
|
+ <if test="projectId !=null and projectId != ''">
|
|
|
+ AND b.project_id >= #{projectId}
|
|
|
+ </if>
|
|
|
+ <if test="startTime !=null and startTime != ''">
|
|
|
+ AND b.stat_date >= #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime !=null and endTime != ''">
|
|
|
+ AND b.stat_date <= #{endTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+
|
|
|
+ </select>
|
|
|
|
|
|
<!-- 项目消耗排行 top10 快手-->
|
|
|
<select id="getMediaTypeProjectCostKuaishou" resultType="java.util.LinkedHashMap">
|
|
|
SELECT
|
|
|
a.project_id as projectId,
|
|
|
a.project_name as projectName,
|
|
|
- SUM(a.charge) as totalCost,
|
|
|
- IFNULL(SUM(b.new_unit_num),0) as baseNum
|
|
|
+ SUM(a.charge) as totalCost
|
|
|
FROM
|
|
|
application.kuaishou_account_report_daily_dw a
|
|
|
- LEFT JOIN application.app_kuaishou_account_base_info_d b
|
|
|
- on a.project_id = b.project_id
|
|
|
<where>
|
|
|
<if test="startTime !=null and startTime != ''">
|
|
|
AND a.stat_date >= #{startTime}
|
|
|
- AND b.stat_date >= #{startTime}
|
|
|
</if>
|
|
|
<if test="endTime !=null and endTime != ''">
|
|
|
AND a.stat_date <= #{endTime}
|
|
|
- AND b.stat_date <= #{endTime}
|
|
|
</if>
|
|
|
</where>
|
|
|
GROUP BY a.project_id
|
|
|
ORDER BY totalCost DESC
|
|
|
limit 10
|
|
|
+ </select>
|
|
|
+ <!-- 项目消耗排行 top10 快手 基建数-->
|
|
|
+ <select id="getMediaTypeProjectCostKuaishouBase" resultType="java.util.LinkedHashMap">
|
|
|
+ SELECT
|
|
|
+ b.project_id projectId,
|
|
|
+ IFNULL(SUM(b.new_unit_num),0) as baseNum
|
|
|
+ FROM
|
|
|
+ application.app_kuaishou_account_base_info_d b
|
|
|
+ <where>
|
|
|
+ <if test="projectId !=null and projectId != ''">
|
|
|
+ AND b.project_id = #{projectId}
|
|
|
+ </if>
|
|
|
+ <if test="startTime !=null and startTime != ''">
|
|
|
+ AND b.stat_date >= #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime !=null and endTime != ''">
|
|
|
+ AND b.stat_date <= #{endTime}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
|
|
|
</select>
|
|
|
|