|
@@ -655,38 +655,20 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="queryKuaishouTopDesign" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="queryKuaishouTopDesign" resultType="com.alibaba.fastjson.JSONObject">
|
|
- select SUM(t1.charge ) as 'cost',
|
|
|
|
- <if test="type == 1">t1.shot_name as userName, "摄像" as roleName,</if>
|
|
|
|
- <if test="type == 2">t1.clip_name as userName, "剪辑" as roleName,</if>
|
|
|
|
- <if test="type == 3">t1.plan_name as userName, "编导" as roleName,</if>
|
|
|
|
- IFNULL(t2.size,0) as 'videoHotCount',
|
|
|
|
-
|
|
|
|
- IFNULL(t2.size/(SELECT COUNT(1) from application.app_kuaishou_video_list WHERE hot_video_date BETWEEN
|
|
|
|
- #{startDate} and #{endDate} )*0.04,0)+
|
|
|
|
- IFNULL(t1.charge/(SELECT SUM(charge) from application.kuaishou_material_video_report_daily_dw where stat_date
|
|
|
|
- BETWEEN
|
|
|
|
- #{startDate} and #{endDate} )*0.06,0) as 'sort'
|
|
|
|
|
|
|
|
|
|
+ select SUM(t1.charge ) as 'cost',
|
|
|
|
+ <if test="type == 1">t1.shot_name as userName, "摄像" as roleName</if>
|
|
|
|
+ <if test="type == 2">t1.clip_name as userName, "剪辑" as roleName</if>
|
|
|
|
+ <if test="type == 3">t1.plan_name as userName, "编导" as roleName</if>
|
|
from
|
|
from
|
|
- (SELECT * from application.app_kuaishou_video_list GROUP BY signature,account_id) t
|
|
|
|
- LEFT JOIN application.kuaishou_material_video_report_daily_dw t1 on t.signature=t1.signature and
|
|
|
|
- t.account_id=t1.account_id
|
|
|
|
- LEFT JOIN
|
|
|
|
- (SELECT COUNT(1) as 'size',clip_id,shot_id,plan_id from application.app_kuaishou_video_list where
|
|
|
|
- hot_video_date
|
|
|
|
- BETWEEN #{startDate}
|
|
|
|
- and #{endDate}
|
|
|
|
- <if test="type == 1">and shot_id is not null GROUP BY shot_id)t2 on t.shot_id =t2.shot_id</if>
|
|
|
|
- <if test="type == 2">and clip_id is not null GROUP BY clip_id)t2 on t.clip_id =t2.clip_id</if>
|
|
|
|
- <if test="type == 3">and plan_id is not null GROUP BY plan_id)t2 on t.plan_id =t2.plan_id</if>
|
|
|
|
|
|
+ application.kuaishou_material_video_report_daily_dw t1
|
|
<where>
|
|
<where>
|
|
- t1.stat_date >=#{startDate}
|
|
|
|
- AND t1.stat_date >=#{endDate}
|
|
|
|
|
|
+ t1.stat_date between #{startDate} and #{endDate}
|
|
</where>
|
|
</where>
|
|
- <if test="type == 1">AND t.shot_id is not null and t.shot_id != '' GROUP BY t.shot_id</if>
|
|
|
|
- <if test="type == 2">AND t.clip_id is not null and t.clip_id != '' GROUP BY t.clip_id</if>
|
|
|
|
- <if test="type == 3">AND t.plan_id is not null and t.plan_id != '' GROUP BY t.plan_id</if>
|
|
|
|
- ORDER BY sort desc
|
|
|
|
|
|
+ <if test="type == 1">AND t1.shot_id is not null and t1.shot_id != '' GROUP BY t1.shot_id</if>
|
|
|
|
+ <if test="type == 2">AND t1.clip_id is not null and t1.clip_id != '' GROUP BY t1.clip_id</if>
|
|
|
|
+ <if test="type == 3">AND t1.plan_id is not null and t1.plan_id != '' GROUP BY t1.plan_id</if>
|
|
|
|
+ ORDER BY cost desc
|
|
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -699,7 +681,7 @@
|
|
|
|
|
|
IFNULL(t2.size/(SELECT COUNT(1) from application.app_bytedance_file_video_get WHERE hot_video_date BETWEEN
|
|
IFNULL(t2.size/(SELECT COUNT(1) from application.app_bytedance_file_video_get WHERE hot_video_date BETWEEN
|
|
#{startDate} and #{endDate} )*0.04,0)+
|
|
#{startDate} and #{endDate} )*0.04,0)+
|
|
- IFNULL(t1.cost/(SELECT SUM(cost) from application.bytedance_material_video_report_daily_dw where stat_datetime
|
|
|
|
|
|
+ IFNULL(SUM(t1.cost)/(SELECT SUM(cost) from application.bytedance_material_video_report_daily_dw where stat_datetime
|
|
BETWEEN
|
|
BETWEEN
|
|
#{startDate} and #{endDate} )*0.06,0) as 'sort'
|
|
#{startDate} and #{endDate} )*0.06,0) as 'sort'
|
|
|
|
|
|
@@ -717,7 +699,7 @@
|
|
<if test="type == 3">and plan_id is not null GROUP BY plan_id)t2 on t.plan_id =t2.plan_id</if>
|
|
<if test="type == 3">and plan_id is not null GROUP BY plan_id)t2 on t.plan_id =t2.plan_id</if>
|
|
<where>
|
|
<where>
|
|
t1.stat_datetime >=#{startDate}
|
|
t1.stat_datetime >=#{startDate}
|
|
- AND t1.stat_datetime >=#{endDate}
|
|
|
|
|
|
+ AND t1.stat_datetime <=#{endDate}
|
|
</where>
|
|
</where>
|
|
<if test="type == 1">AND t.shot_id is not null and t.shot_id != '' GROUP BY t.shot_id</if>
|
|
<if test="type == 1">AND t.shot_id is not null and t.shot_id != '' GROUP BY t.shot_id</if>
|
|
<if test="type == 2">AND t.clip_id is not null and t.clip_id != '' GROUP BY t.clip_id</if>
|
|
<if test="type == 2">AND t.clip_id is not null and t.clip_id != '' GROUP BY t.clip_id</if>
|