|
@@ -52,7 +52,7 @@
|
|
|
<select id="queryRelatePersonByMd5Old" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
SELECT
|
|
|
clip_id clipId,
|
|
|
- (select realname from sys_user where id=clip_id) as clipaname,
|
|
|
+ (select realname from sys_user where id=clip_id) as clipName,
|
|
|
shot_id shotId,
|
|
|
(select realname from sys_user where id=shot_id) as shotName,
|
|
|
plan_id planId,
|
|
@@ -76,4 +76,34 @@
|
|
|
account_id = #{accountId}
|
|
|
LIMIT 1
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="queryETLData" resultType="cn.com.ctop.toutiao.modules.link.entity.ETLReportBytedanceVideo">
|
|
|
+ SELECT
|
|
|
+ t1.*,
|
|
|
+ t3.clip_id clipId,
|
|
|
+ (select realname from sys_user where id=t3.clip_id) as clipName,
|
|
|
+ t3.shot_id shotId,
|
|
|
+ (select realname from sys_user where id=t3.shot_id) as shotName,
|
|
|
+ t3.plan_id planId,
|
|
|
+ (select realname from sys_user where id=t3.plan_id) as planName,
|
|
|
+ t5.advertiser_id as advertiserId,
|
|
|
+ (SELECT `name` from ctop_advertiser where id= t5.advertiser_id limit 1) as advertiserName,
|
|
|
+ t5.project_id as projectId,
|
|
|
+ (SELECT `project_name` from ctop_project where id= t5.project_id limit 1) as projectName,
|
|
|
+ t5.auth_name as accountName,
|
|
|
+ t4.material_name as materialName,
|
|
|
+ t4.url,
|
|
|
+ t4.cover_url coverUrl,
|
|
|
+ t4.create_time as materialCreateTime,
|
|
|
+ t2.signature AS md5,
|
|
|
+ t2.video_url AS toutiaoUrl
|
|
|
+ FROM
|
|
|
+ (SELECT * from base_report_bytedance_video_daily where stat_datetime=#{statDate}) t1
|
|
|
+ LEFT JOIN (select material_id,signature,video_url from ctop_bytedance_video_info where material_id in (SELECT DISTINCT material_id from base_report_bytedance_video_daily where stat_datetime=#{statDate})
|
|
|
+ ) t2 ON t1.material_id = t2.material_id
|
|
|
+ LEFT JOIN ctop_material_ascription t3 on t2.signature=t3.code
|
|
|
+ LEFT JOIN ctop_material_info t4 on t4.code=t2.signature
|
|
|
+ LEFT JOIN (SELECT account_id, advertiser_id,project_id,auth_name from ctop_user_allocation where account_id in (SELECT DISTINCT account_id from base_report_bytedance_video_daily where stat_datetime=#{statDate})) t5 on t1.account_id=t5.account_id
|
|
|
+ GROUP BY t1.id
|
|
|
+ </select>
|
|
|
</mapper>
|