|
@@ -3,6 +3,8 @@
|
|
|
<mapper namespace="cn.com.ctop.bytedance.mapper.BytedanceCreativeDailyReportMapper">
|
|
|
<select id="bytedanceCreativeDailyReport" parameterType="Map" resultType="cn.com.ctop.bytedance.entity.BytedanceCreativeDailyReport">
|
|
|
select
|
|
|
+ t2.creative_id as creativeId, <!-- 素材id -->
|
|
|
+ t4.video_url as videoUrl, <!-- 视频url -->
|
|
|
sum(t2.show_num) as showNum, <!-- 展示量 -->
|
|
|
sum(t2.click) as click, <!-- 点击量 -->
|
|
|
sum(t2.convert_num) as convertNum, <!-- 转化量 -->
|
|
@@ -25,19 +27,20 @@
|
|
|
left join ctop_bytedance_report_creative_daily t2 on t1.account_id = t2.advertiser_id
|
|
|
left join ctop_bytedance_creative t3 on t2.creative_id = t3.id
|
|
|
left join ctop_bytedance_video_info t4 on t3.video_id = t4.id
|
|
|
- <where>
|
|
|
+ where
|
|
|
+ t3.id is not NULL
|
|
|
+ and t1.media_id = '1'
|
|
|
+ and t1.account_id != ''
|
|
|
<if test="userId != null">
|
|
|
and t1.user_id = #{userId,jdbcType=VARCHAR}
|
|
|
</if>
|
|
|
- and t1.media_id = '1'
|
|
|
- and t1.account_id != ''
|
|
|
+
|
|
|
<if test="startDate != null">
|
|
|
and t2.stat_datetime <= #{startDate}
|
|
|
</if>
|
|
|
<if test="endDate != null">
|
|
|
and t2.stat_datetime >= #{endDate}
|
|
|
</if>
|
|
|
- </where>
|
|
|
group by t4.signature
|
|
|
order by sum(t2.cost) desc
|
|
|
limit 100
|
|
@@ -69,7 +72,7 @@
|
|
|
left join ctop_bytedance_report_creative_daily t2 on t1.account_id = t2.advertiser_id
|
|
|
left join ctop_bytedance_creative t3 on t2.creative_id = t3.id
|
|
|
left join ctop_bytedance_video_info t4 on t3.video_id = t4.id
|
|
|
- where t1.id in
|
|
|
+ where t1.account_id in
|
|
|
<foreach item="item" index="index" collection="accountIds"
|
|
|
open="(" separator="," close=")">
|
|
|
#{item}
|
|
@@ -80,9 +83,9 @@
|
|
|
and t2.stat_datetime <= #{startDate}
|
|
|
</if>
|
|
|
<if test="endDate != null">
|
|
|
- and t2.stat_datetime >= #{endDate} and
|
|
|
+ and t2.stat_datetime >= #{endDate}
|
|
|
</if>
|
|
|
- t3.id is not NULL
|
|
|
+ and t3.id is not NULL
|
|
|
group by t4.signature
|
|
|
order by sum(t2.cost) desc
|
|
|
limit 100
|