|
@@ -230,7 +230,7 @@
|
|
IFNULL((SELECT GROUP_CONCAT(tag_name) from ctop_material_tag_info where code=signature and status=1),"塑造") as tag
|
|
IFNULL((SELECT GROUP_CONCAT(tag_name) from ctop_material_tag_info where code=signature and status=1),"塑造") as tag
|
|
FROM
|
|
FROM
|
|
(SELECT md5 signature,
|
|
(SELECT md5 signature,
|
|
- IFNULL(toutiao_url, '') AS url,
|
|
|
|
|
|
+ case when toutiao_url = '' or toutiao_url is null then url end url,
|
|
cover_url AS coverUrl,
|
|
cover_url AS coverUrl,
|
|
material_name AS materialName,
|
|
material_name AS materialName,
|
|
sum(cost) AS cost from etl_report_bytedance_video
|
|
sum(cost) AS cost from etl_report_bytedance_video
|
|
@@ -251,6 +251,93 @@
|
|
ORDER BY cost DESC
|
|
ORDER BY cost DESC
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+ <select id="queryKuaishouTopDesign" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
+ SELECT
|
|
|
|
+ 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
|
|
|
|
+ (select sum(charge) as charge,t2.*
|
|
|
|
+ from ctop_etl_kuaishou_account_material_report_daily t1 LEFT JOIN ctop_etl_kuaishou_video_info t2 ON t1.signature = t2.video_code
|
|
|
|
+ where
|
|
|
|
+ 1=1
|
|
|
|
+ AND t1.stat_date >= #{startDate}
|
|
|
|
+ AND t1.stat_date <= #{endDate}
|
|
|
|
+ <if test="projects !=null">
|
|
|
|
+ AND project_id IN
|
|
|
|
+ <foreach collection="projects" item="item" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="type == 1"> AND t2.shot_id is not null and t2.shot_id != '' GROUP BY t2.shot_id</if>
|
|
|
|
+ <if test="type == 2"> AND t2.clip_id is not null and t2.clip_id != '' GROUP BY t2.clip_id</if>
|
|
|
|
+ <if test="type == 3"> AND t2.plan_id is not null and t2.plan_id != '' GROUP BY t2.plan_id</if>
|
|
|
|
+ ORDER BY charge desc LIMIT 10
|
|
|
|
+ ) t1
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="queryBytedanceTopDesign" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
+
|
|
|
|
+ SELECT
|
|
|
|
+ t1.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
|
|
|
|
+ (select sum(cost) as cost,clip_name,plan_name,shot_name
|
|
|
|
+ from etl_report_bytedance_video t1
|
|
|
|
+ where
|
|
|
|
+ 1=1
|
|
|
|
+ AND t1.stat_datetime >= #{startDate}
|
|
|
|
+ AND t1.stat_datetime <= #{endDate}
|
|
|
|
+ <if test="projects !=null">
|
|
|
|
+ AND project_id IN
|
|
|
|
+ <foreach collection="projects" item="item" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <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 LIMIT 10
|
|
|
|
+ ) t1
|
|
|
|
+
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+ <select id="queryBytedanceTopMaterialNew" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
+ SELECT
|
|
|
|
+ t1.*,
|
|
|
|
+ IFNULL((SELECT GROUP_CONCAT(tag_name) from ctop_material_tag_info where code=signature and status=1),"塑造") as tag
|
|
|
|
+ FROM
|
|
|
|
+ (SELECT md5 signature,
|
|
|
|
+ case when toutiao_url = '' or toutiao_url is null then url end url,
|
|
|
|
+ cover_url AS coverUrl,
|
|
|
|
+ material_name AS materialName,
|
|
|
|
+ sum(cost) AS cost from etl_report_bytedance_video
|
|
|
|
+ where 1=1
|
|
|
|
+ <if test="projects !=null">
|
|
|
|
+ AND project_id IN
|
|
|
|
+ <foreach collection="projects" item="item" separator=","
|
|
|
|
+ open="(" close=")">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ AND stat_datetime >= #{startDate}
|
|
|
|
+ AND stat_datetime <= #{endDate}
|
|
|
|
+ AND md5!=''
|
|
|
|
+ GROUP BY md5
|
|
|
|
+ ORDER BY cost DESC
|
|
|
|
+ LIMIT 5) t1
|
|
|
|
+ ORDER BY cost DESC
|
|
|
|
+ </select>
|
|
|
|
+
|
|
|
|
+
|
|
<select id="queryBytedanceMaterialReport" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="queryBytedanceMaterialReport" resultType="com.alibaba.fastjson.JSONObject">
|
|
SELECT
|
|
SELECT
|
|
t1.md5 signature,
|
|
t1.md5 signature,
|
|
@@ -303,14 +390,16 @@
|
|
GROUP BY t1.md5) t
|
|
GROUP BY t1.md5) t
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
<select id="queryKuaishouTopMaterial" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="queryKuaishouTopMaterial" resultType="com.alibaba.fastjson.JSONObject">
|
|
SELECT
|
|
SELECT
|
|
t1.*,
|
|
t1.*,
|
|
t2.video_name as materialName,
|
|
t2.video_name as materialName,
|
|
t2.cover_url as coverUrl,
|
|
t2.cover_url as coverUrl,
|
|
t2.url as url ,
|
|
t2.url as url ,
|
|
- IFNULL((SELECT GROUP_CONCAT(tag_name) from ctop_material_tag_info where code=t1.signature and status=1),"塑造") as
|
|
|
|
- tag
|
|
|
|
|
|
+ t2.channel_type,
|
|
|
|
+ (SELECT GROUP_CONCAT(tag_name) from ctop_material_tag_info where code=t1.signature and status=1)as tag
|
|
FROM
|
|
FROM
|
|
(select sum(charge) as charge,signature
|
|
(select sum(charge) as charge,signature
|
|
from ctop_etl_kuaishou_account_material_report_daily t1
|
|
from ctop_etl_kuaishou_account_material_report_daily t1
|
|
@@ -323,15 +412,48 @@
|
|
#{item}
|
|
#{item}
|
|
</foreach>
|
|
</foreach>
|
|
</if>
|
|
</if>
|
|
|
|
+
|
|
AND t1.stat_date >= #{startDate}
|
|
AND t1.stat_date >= #{startDate}
|
|
AND t1.stat_date <= #{endDate}
|
|
AND t1.stat_date <= #{endDate}
|
|
GROUP BY t1.signature
|
|
GROUP BY t1.signature
|
|
ORDER BY charge desc
|
|
ORDER BY charge desc
|
|
- limit 5
|
|
|
|
) t1
|
|
) t1
|
|
LEFT JOIN ctop_etl_kuaishou_video_info t2
|
|
LEFT JOIN ctop_etl_kuaishou_video_info t2
|
|
ON t1.signature = t2.video_code
|
|
ON t1.signature = t2.video_code
|
|
- ORDER BY charge desc
|
|
|
|
|
|
+ where 1=1
|
|
|
|
+ <if test="channelType !=null">
|
|
|
|
+ AND t2.channel_type = #{channelType}
|
|
|
|
+ </if>
|
|
|
|
+ ORDER BY charge desc LIMIT 5
|
|
|
|
+
|
|
|
|
+<!-- SELECT-->
|
|
|
|
+<!-- t1.*,-->
|
|
|
|
+<!-- t2.video_name as materialName,-->
|
|
|
|
+<!-- t2.cover_url as coverUrl,-->
|
|
|
|
+<!-- t2.url as url ,-->
|
|
|
|
+<!-- IFNULL((SELECT GROUP_CONCAT(tag_name) from ctop_material_tag_info where code=t1.signature and status=1),"塑造") as-->
|
|
|
|
+<!-- tag-->
|
|
|
|
+<!-- FROM-->
|
|
|
|
+<!-- (select sum(charge) as charge,signature-->
|
|
|
|
+<!-- from ctop_etl_kuaishou_account_material_report_daily t1-->
|
|
|
|
+<!-- where-->
|
|
|
|
+<!-- 1=1-->
|
|
|
|
+<!-- <if test="projects !=null">-->
|
|
|
|
+<!-- AND project_id IN-->
|
|
|
|
+<!-- <foreach collection="projects" item="item" separator=","-->
|
|
|
|
+<!-- open="(" close=")">-->
|
|
|
|
+<!-- #{item}-->
|
|
|
|
+<!-- </foreach>-->
|
|
|
|
+<!-- </if>-->
|
|
|
|
+<!-- AND t1.stat_date >= #{startDate}-->
|
|
|
|
+<!-- AND t1.stat_date <= #{endDate}-->
|
|
|
|
+<!-- GROUP BY t1.signature-->
|
|
|
|
+<!-- ORDER BY charge desc-->
|
|
|
|
+<!-- limit 5-->
|
|
|
|
+<!-- ) t1-->
|
|
|
|
+<!-- LEFT JOIN ctop_etl_kuaishou_video_info t2-->
|
|
|
|
+<!-- ON t1.signature = t2.video_code-->
|
|
|
|
+<!-- ORDER BY charge desc-->
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="queryKuaishouMaterialReport" resultType="com.alibaba.fastjson.JSONObject">
|
|
<select id="queryKuaishouMaterialReport" resultType="com.alibaba.fastjson.JSONObject">
|
|
@@ -429,6 +551,10 @@
|
|
user_id
|
|
user_id
|
|
ORDER BY
|
|
ORDER BY
|
|
${target} ${order}) t) t1
|
|
${target} ${order}) t) t1
|
|
|
|
+ where 1=1
|
|
|
|
+ <if test="roleName != null">
|
|
|
|
+ and t1.roleName = #{roleName}
|
|
|
|
+ </if>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="queryTopDesignCount" resultType="java.lang.Long">
|
|
<select id="queryTopDesignCount" resultType="java.lang.Long">
|