|
@@ -695,7 +695,7 @@
|
|
application.bytedance_material_video_report_daily_dw t1
|
|
application.bytedance_material_video_report_daily_dw t1
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
application.app_bytedance_material_info t on t.material_id=t1.signature
|
|
application.app_bytedance_material_info t on t.material_id=t1.signature
|
|
- <if test='materialType!=null'>
|
|
|
|
|
|
+ <if test="materialType!=null and materialType!=''">
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
(select material_id from application.app_material_tag_busi_info
|
|
(select material_id from application.app_material_tag_busi_info
|
|
<if test='materialType==1'>
|
|
<if test='materialType==1'>
|
|
@@ -734,9 +734,12 @@
|
|
<if test='innovative==1'>
|
|
<if test='innovative==1'>
|
|
and t.material_innovate=1
|
|
and t.material_innovate=1
|
|
</if>
|
|
</if>
|
|
- <if test='materialType!=null'>
|
|
|
|
|
|
+ <if test="materialType!=null and materialType!=''">
|
|
and t2.material_id is not null
|
|
and t2.material_id is not null
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="md5!=null and md5!=''">
|
|
|
|
+ and t1.material_id =#{md5}
|
|
|
|
+ </if>
|
|
|
|
|
|
AND t1.company_id=#{companyId}
|
|
AND t1.company_id=#{companyId}
|
|
</where>
|
|
</where>
|
|
@@ -814,7 +817,7 @@
|
|
application.kuaishou_material_video_report_daily_dw t1
|
|
application.kuaishou_material_video_report_daily_dw t1
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
application.app_kuaishou_material_info t on t1.signature=t.material_id
|
|
application.app_kuaishou_material_info t on t1.signature=t.material_id
|
|
- <if test='materialType!=null'>
|
|
|
|
|
|
+ <if test="materialType!=null and materialType!=''">
|
|
LEFT JOIN
|
|
LEFT JOIN
|
|
(select material_id from application.app_material_tag_busi_info
|
|
(select material_id from application.app_material_tag_busi_info
|
|
<if test='materialType==1'>
|
|
<if test='materialType==1'>
|
|
@@ -856,9 +859,12 @@
|
|
<if test='innovative==1'>
|
|
<if test='innovative==1'>
|
|
and t.material_innovate=1
|
|
and t.material_innovate=1
|
|
</if>
|
|
</if>
|
|
- <if test='materialType!=null'>
|
|
|
|
|
|
+ <if test="materialType!=null and materialType!=''">
|
|
and t2.material_id is not null
|
|
and t2.material_id is not null
|
|
</if>
|
|
</if>
|
|
|
|
+ <if test="md5!=null and md5!=''">
|
|
|
|
+ and t1.signature =#{md5}
|
|
|
|
+ </if>
|
|
AND t1.company_id=#{companyId}
|
|
AND t1.company_id=#{companyId}
|
|
</where>
|
|
</where>
|
|
GROUP BY t1.signature
|
|
GROUP BY t1.signature
|
|
@@ -1474,72 +1480,73 @@
|
|
<!-- 头条组内人均消耗-->
|
|
<!-- 头条组内人均消耗-->
|
|
<select id="getBytedanceDesignTeamAvgCost" resultType="java.math.BigDecimal">
|
|
<select id="getBytedanceDesignTeamAvgCost" resultType="java.math.BigDecimal">
|
|
SELECT IFNULL(ROUND( SUM(cost)/
|
|
SELECT IFNULL(ROUND( SUM(cost)/
|
|
- (SELECT COUNT(*) from sys_user where leader_id=#{leaderId} and status=1),2),0)
|
|
|
|
|
|
+ ((SELECT COUNT(*) from sys_user where leader_id=#{leaderId} and status=1)+1),2),0)
|
|
from application.bytedance_material_video_report_daily_dw t
|
|
from application.bytedance_material_video_report_daily_dw t
|
|
where t.stat_datetime >= #{startDate} and t.stat_datetime <=#{endDate} and t.leader_id=#{leaderId} and t.company_id=#{companyId}
|
|
where t.stat_datetime >= #{startDate} and t.stat_datetime <=#{endDate} and t.leader_id=#{leaderId} and t.company_id=#{companyId}
|
|
</select>
|
|
</select>
|
|
<!-- 快手组内人均消耗-->
|
|
<!-- 快手组内人均消耗-->
|
|
<select id="getKuaishouDesignTeamAvgCost" resultType="java.math.BigDecimal">
|
|
<select id="getKuaishouDesignTeamAvgCost" resultType="java.math.BigDecimal">
|
|
SELECT IFNULL(ROUND( SUM(charge)/
|
|
SELECT IFNULL(ROUND( SUM(charge)/
|
|
- (SELECT COUNT(*) from sys_user where leader_id=#{leaderId} and status=1),2),0)
|
|
|
|
|
|
+ ((SELECT COUNT(*) from sys_user where leader_id=#{leaderId} and status=1)+1),2),0)
|
|
from application.kuaishou_material_video_report_daily_dw t
|
|
from application.kuaishou_material_video_report_daily_dw t
|
|
where t.stat_date >= #{startDate} and t.stat_date <=#{endDate} and t.leader_id=#{leaderId} and t.company_id=#{companyId}
|
|
where t.stat_date >= #{startDate} and t.stat_date <=#{endDate} and t.leader_id=#{leaderId} and t.company_id=#{companyId}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<!-- 头条组人效-->
|
|
<!-- 头条组人效-->
|
|
<select id="getBytedanceDesignTeamGroupWork" resultType="java.math.BigDecimal">
|
|
<select id="getBytedanceDesignTeamGroupWork" resultType="java.math.BigDecimal">
|
|
- SELECT IFNULL(ROUND(COUNT(t.signature)/
|
|
|
|
|
|
+ SELECT IFNULL(ROUND(COUNT(t.material_id)/
|
|
(SELECT COUNT(*) from sys_user where leader_id=#{leaderId} and status=1),2),0)
|
|
(SELECT COUNT(*) from sys_user where leader_id=#{leaderId} and status=1),2),0)
|
|
- from application.app_bytedance_file_video_get t
|
|
|
|
- where t.create_time >=#{startDate} and t.create_time <=#{endDate} and leader_id=#{leaderId}
|
|
|
|
|
|
+ from application.app_bytedance_material_info t
|
|
|
|
+ where t.media_time between #{startDate} and #{endDate} and leader_id=#{leaderId}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<!-- 快手组人效-->
|
|
<!-- 快手组人效-->
|
|
<select id="getKuaishouDesignTeamGroupWork" resultType="java.math.BigDecimal">
|
|
<select id="getKuaishouDesignTeamGroupWork" resultType="java.math.BigDecimal">
|
|
- SELECT IFNULL(ROUND(COUNT(t.signature)/
|
|
|
|
|
|
+ SELECT IFNULL(ROUND(COUNT(t.material_id)/
|
|
(SELECT COUNT(*) from sys_user where leader_id=#{leaderId} and status=1),2),0)
|
|
(SELECT COUNT(*) from sys_user where leader_id=#{leaderId} and status=1),2),0)
|
|
- from application.app_kuaishou_video_list t
|
|
|
|
- where t.stat_date >=#{startDate} and t.stat_date <=#{endDate} and leader_id=#{leaderId}
|
|
|
|
|
|
+ from application.app_kuaishou_material_info t
|
|
|
|
+ where t.media_time between #{startDate} and #{endDate} and leader_id=#{leaderId}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<!-- 头条创新视频数-->
|
|
<!-- 头条创新视频数-->
|
|
<select id="getBytedanceDesignTeaminnovativeVideoCount" resultType="int">
|
|
<select id="getBytedanceDesignTeaminnovativeVideoCount" resultType="int">
|
|
SELECT ifnull(count(*),0)
|
|
SELECT ifnull(count(*),0)
|
|
- from application.app_bytedance_file_video_get t
|
|
|
|
- where t.material_innovate >=#{startDate} and t.material_innovate <=#{endDate} and leader_id=#{leaderId}
|
|
|
|
|
|
+ from application.app_bytedance_material_info t
|
|
|
|
+ where t.media_time between #{startDate} and #{endDate} and t.material_innovate=2 and leader_id=#{leaderId}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<!-- 快手创新视频数-->
|
|
<!-- 快手创新视频数-->
|
|
<select id="getKuaishouDesignTeaminnovativeVideoCount" resultType="int">
|
|
<select id="getKuaishouDesignTeaminnovativeVideoCount" resultType="int">
|
|
SELECT ifnull(count(*),0)
|
|
SELECT ifnull(count(*),0)
|
|
- from application.app_kuaishou_video_list t
|
|
|
|
- where t.material_innovate >=#{startDate} and t.material_innovate <=#{endDate} and leader_id=#{leaderId}
|
|
|
|
|
|
+ from application.app_kuaishou_material_info t
|
|
|
|
+ where t.media_time between #{startDate} and #{endDate} and t.material_innovate=2 and leader_id=#{leaderId}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<!-- 头条素材平均消耗-->
|
|
<!-- 头条素材平均消耗-->
|
|
<select id="getBytedanceMaterialCost" resultType="java.math.BigDecimal">
|
|
<select id="getBytedanceMaterialCost" resultType="java.math.BigDecimal">
|
|
- SELECT
|
|
|
|
- IFNULL(ROUND(
|
|
|
|
|
|
+ select
|
|
|
|
+ IFNULL(ROUND(
|
|
|
|
+ (SELECT SUM(t1.cost)
|
|
|
|
+ from application.app_bytedance_material_info t
|
|
|
|
+ LEFT JOIN application.bytedance_material_video_report_daily_dw t1 on t.material_id=t1.signature
|
|
|
|
+ where t.media_time between #{startDate} and #{endDate} and t.leader_id=#{leaderId} and t.company_id=#{companyId}
|
|
|
|
+ and t1.stat_datetime between #{startDate} and #{endDate})
|
|
|
|
+ /
|
|
|
|
+ (SELECT ifnull(count(DISTINCT t.material_id),0)
|
|
|
|
+ from application.app_bytedance_material_info t
|
|
|
|
+ where t.media_time between #{startDate} and #{endDate} and t.leader_id=#{leaderId} and t.company_id=#{companyId})
|
|
|
|
+ ,2),0)
|
|
|
|
|
|
- (SELECT SUM(cost) from application.bytedance_material_video_report_daily_dw t2
|
|
|
|
- where
|
|
|
|
- t2.stat_datetime >=#{startDate} and t2.stat_datetime<= #{endDate} and t2.leader_id=#{leaderId} and company_id=#{companyId})/
|
|
|
|
-
|
|
|
|
- (SELECT DISTINCT COUNT(t.signature) from application.app_bytedance_file_video_get t
|
|
|
|
- where
|
|
|
|
- t.create_time >=str_to_date(#{startDate}, '%Y-%m-%d') and t.create_time <=str_to_date(#{endDate}, '%Y-%m-%d') and t.leader_id=#{leaderId})
|
|
|
|
- ,2),0)
|
|
|
|
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<!-- 快手创新视频消耗-->
|
|
<!-- 快手创新视频消耗-->
|
|
<select id="getKuaishouDesignTeaminnovativeVideoCost" resultType="java.math.BigDecimal">
|
|
<select id="getKuaishouDesignTeaminnovativeVideoCost" resultType="java.math.BigDecimal">
|
|
- SELECT ifnull(ROUND(sum(charge),2),0)
|
|
|
|
- from application.app_kuaishou_video_list t
|
|
|
|
- left join application.kuaishou_material_video_report_daily_dw t1 on t.signature=t1.signature
|
|
|
|
- where t.material_innovate >=#{startDate} and t.material_innovate <=#{endDate} and t.leader_id=#{leaderId}
|
|
|
|
- and t1.stat_date >=#{startDate} and t1.stat_date <=#{endDate} and t1.leader_id=#{leaderId}
|
|
|
|
-
|
|
|
|
|
|
+ SELECT SUM(t1.charge)
|
|
|
|
+ from application.app_kuaishou_material_info t
|
|
|
|
+ LEFT JOIN application.kuaishou_material_video_report_daily_dw t1 on t.material_id=t1.signature
|
|
|
|
+ where t.media_time between #{startDate} and #{endDate} and t.material_innovate=2 and t.leader_id=#{leaderId} and t.company_id=#{companyId}
|
|
|
|
+ and t1.stat_date between #{startDate} and #{endDate}
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|