|
@@ -626,74 +626,59 @@
|
|
|
</select>
|
|
|
|
|
|
<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>
|
|
|
- from
|
|
|
- application.kuaishou_material_video_report_daily_dw t1
|
|
|
-
|
|
|
- left JOIN sys_user t2 on
|
|
|
- <if test="type == 1">t1.shot_id =t2.id</if>
|
|
|
- <if test="type == 2">t1.clip_id =t2.id</if>
|
|
|
- <if test="type == 3">t1.plan_id =t2.id</if>
|
|
|
- <where>
|
|
|
- t1.stat_date >= #{startDate} and t1.stat_date <= #{endDate} and t1.company_id=#{companyId} and
|
|
|
- t2.status=1
|
|
|
- </where>
|
|
|
- <if test="type == 1">AND t1.shot_id is not null and t1.shot_id != '' AND t1.shot_name is not null and
|
|
|
- t1.shot_name != '' GROUP BY t1.shot_id
|
|
|
+ select t1.* from (
|
|
|
+ select sum(charge) as 'cost',
|
|
|
+ <if test="type == 1">shot_name as userName, "摄像" as roleName</if>
|
|
|
+ <if test="type == 2">clip_name as userName, "剪辑" as roleName</if>
|
|
|
+ <if test="type == 3">plan_name as userName, "编导" as roleName</if>
|
|
|
+ from application.kuaishou_material_video_report_daily_dw
|
|
|
+ where 1 = 1
|
|
|
+ and stat_date >= #{startDate}
|
|
|
+ and stat_date <= #{endDate}
|
|
|
+ and company_id = #{companyId}
|
|
|
+ <if test="type == 1">
|
|
|
+ and shot_id is not null
|
|
|
+ group by shot_id
|
|
|
</if>
|
|
|
- <if test="type == 2">AND t1.clip_id is not null and t1.clip_id != '' AND t1.clip_name is not null and
|
|
|
- t1.clip_name != '' GROUP BY t1.clip_id
|
|
|
+ <if test="type == 2">
|
|
|
+ and clip_id is not null
|
|
|
+ group by clip_id
|
|
|
</if>
|
|
|
- <if test="type == 3">AND t1.plan_id is not null and t1.plan_id != '' AND t1.plan_name is not null and
|
|
|
- t1.plan_name != '' GROUP BY t1.plan_id
|
|
|
+ <if test="type == 3">
|
|
|
+ and plan_id is not null
|
|
|
+ group by plan_id
|
|
|
</if>
|
|
|
- ORDER BY cost desc
|
|
|
-
|
|
|
+ ) t1 left join `jeecg-boot`.sys_user t2 on t1.shot_id = t2.id
|
|
|
+ where t2.status = 1
|
|
|
+ order by t1.cost desc
|
|
|
</select>
|
|
|
|
|
|
<select id="queryBytedanceTopDesign" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
- select SUM(t1.cost ) 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(COUNT(DISTINCT t.material_id,IF(faddish_date BETWEEN #{startDate} and #{endDate} ,true,null)),0) as
|
|
|
- 'videoHotCount',
|
|
|
-
|
|
|
- ifnull( COUNT(DISTINCT t.material_id,IF(faddish_date BETWEEN #{startDate} and #{endDate} ,true,null))/
|
|
|
- (SELECT COUNT(0) from application.app_bytedance_material_info where faddish_date >= #{startDate} and
|
|
|
- faddish_date <=
|
|
|
- #{endDate} and company_id=#{companyId})*0.4,0)+
|
|
|
- ifnull(SUM(t1.cost)/
|
|
|
- (SELECT SUM(cost) from application.bytedance_material_video_report_daily_dw where stat_datetime
|
|
|
- >= #{startDate} and stat_datetime <= #{endDate}
|
|
|
- )*0.6 ,0) as sort
|
|
|
- from
|
|
|
- application.app_bytedance_material_info t
|
|
|
- LEFT JOIN application.bytedance_material_video_report_daily_dw t1 on t.material_id=t1.signature
|
|
|
-
|
|
|
- left JOIN sys_user t2 on
|
|
|
- <if test="type == 1">t1.shot_id =t2.id</if>
|
|
|
- <if test="type == 2">t1.clip_id =t2.id</if>
|
|
|
- <if test="type == 3">t1.plan_id =t2.id</if>
|
|
|
-
|
|
|
- <where>
|
|
|
- t1.stat_datetime >= #{startDate} and t1.stat_datetime <= #{endDate} and t.company_id=#{companyId} and
|
|
|
- t1.company_id=#{companyId} and t2.status=1
|
|
|
- </where>
|
|
|
- <if test="type == 1">AND t1.shot_id is not null and t1.shot_id != '' AND t1.shot_name is not null and
|
|
|
- t1.shot_name != '' GROUP BY t1.shot_id
|
|
|
+ select t1.* from (
|
|
|
+ select sum(cost) as 'cost',
|
|
|
+ <if test="type == 1">shot_name as userName, "摄像" as roleName</if>
|
|
|
+ <if test="type == 2">clip_name as userName, "剪辑" as roleName</if>
|
|
|
+ <if test="type == 3">plan_name as userName, "编导" as roleName</if>
|
|
|
+ from application.bytedance_material_video_report_daily_dw
|
|
|
+ where 1 = 1
|
|
|
+ and stat_datetime >= #{startDate}
|
|
|
+ and stat_datetime <= #{endDate}
|
|
|
+ and company_id = #{companyId}
|
|
|
+ <if test="type == 1">
|
|
|
+ and shot_id is not null
|
|
|
+ group by shot_id
|
|
|
</if>
|
|
|
- <if test="type == 2">AND t1.clip_id is not null and t1.clip_id != '' AND t1.clip_name is not null and
|
|
|
- t1.clip_name != '' GROUP BY t1.clip_id
|
|
|
+ <if test="type == 2">
|
|
|
+ and clip_id is not null
|
|
|
+ group by clip_id
|
|
|
</if>
|
|
|
- <if test="type == 3">AND t1.plan_id is not null and t1.plan_id != '' AND t1.plan_name is not null and
|
|
|
- t1.plan_name != '' GROUP BY t1.plan_id
|
|
|
+ <if test="type == 3">
|
|
|
+ and plan_id is not null
|
|
|
+ group by plan_id
|
|
|
</if>
|
|
|
- ORDER BY sort desc
|
|
|
+ ) t1 left join `jeecg-boot`.sys_user t2 on t1.shot_id = t2.id
|
|
|
+ where t2.status = 1
|
|
|
+ order by t1.cost desc
|
|
|
</select>
|
|
|
|
|
|
<select id="queryBytedanceTopMaterialNew" resultType="com.alibaba.fastjson.JSONObject">
|