|
@@ -13,8 +13,11 @@
|
|
IFNULL(t1.photo_url,'-') as url ,
|
|
IFNULL(t1.photo_url,'-') as url ,
|
|
IFNULL(t1.channel_name,'-') AS channel,
|
|
IFNULL(t1.channel_name,'-') AS channel,
|
|
DATE_FORMAT(stat_date,'%Y-%m-%d') as createTime,
|
|
DATE_FORMAT(stat_date,'%Y-%m-%d') as createTime,
|
|
- key_action as 'keyAction',
|
|
|
|
- key_action_cost as 'keyActionCost',
|
|
|
|
|
|
+ sum(key_action) as 'keyAction',
|
|
|
|
+ IFNULL(round(SUM(charge)/sum(key_action),3),0) as 'keyActionCost',
|
|
|
|
+ sum(event_app_invoked) as 'eventAppInvoked',
|
|
|
|
+ IFNULL(round(SUM(charge)/sum(event_app_invoked),3),0) as 'eventAppInvokedCost',
|
|
|
|
+ concat(CAST(IFNULL(round(sum(t1.event_app_invoked) / sum(t1.bclick)*100,2),0.0) AS CHAR) ,'%') as 'eventAppInvokedRatio',
|
|
${filed}
|
|
${filed}
|
|
FROM
|
|
FROM
|
|
application.kuaishou_material_video_report_daily_dw t1
|
|
application.kuaishou_material_video_report_daily_dw t1
|
|
@@ -58,43 +61,43 @@
|
|
<select id="getTotalByMap" resultType="java.lang.Long">
|
|
<select id="getTotalByMap" resultType="java.lang.Long">
|
|
SELECT IFNULL(sum(1),0)
|
|
SELECT IFNULL(sum(1),0)
|
|
FROM (
|
|
FROM (
|
|
- SELECT
|
|
|
|
|
|
+ SELECT
|
|
signature
|
|
signature
|
|
FROM
|
|
FROM
|
|
application.kuaishou_material_video_report_daily_dw t1
|
|
application.kuaishou_material_video_report_daily_dw t1
|
|
- where 1=1
|
|
|
|
- <if test="accountIds !=null and accountIds != ''">
|
|
|
|
- and t1.account_id in
|
|
|
|
- <foreach item="item" index="index" collection="accountIds"
|
|
|
|
- open="(" separator="," close=")">
|
|
|
|
- #{item}
|
|
|
|
- </foreach>
|
|
|
|
- </if>
|
|
|
|
- <if test="startDate !=null and startDate != ''">
|
|
|
|
- AND t1.stat_date >= DATE_FORMAT(#{startDate},'%Y%m%d')
|
|
|
|
- </if>
|
|
|
|
- <if test="endDate !=null and endDate != ''">
|
|
|
|
- AND t1.stat_date <= DATE_FORMAT(#{endDate},'%Y%m%d')
|
|
|
|
- </if>
|
|
|
|
- <if test="leaderId !=null and leaderId != ''">
|
|
|
|
- AND t1.leader_id = #{leaderId}
|
|
|
|
- </if>
|
|
|
|
- <if test="channelType != null">
|
|
|
|
- AND t1.channel_type = #{channelType}
|
|
|
|
- </if>
|
|
|
|
- <if test="clipId !=null and clipId != ''">
|
|
|
|
- AND t1.clip_id = #{clipId}
|
|
|
|
- </if>
|
|
|
|
- <if test="planId !=null and planId != ''">
|
|
|
|
- AND t1.plan_id = #{planId}
|
|
|
|
- </if>
|
|
|
|
- <if test="shotId !=null and shotId != ''">
|
|
|
|
- AND t1.shot_id = #{shotId}
|
|
|
|
- </if>
|
|
|
|
- <if test="companyId !=null and companyId != ''">
|
|
|
|
- AND t1.company_id = #{companyId}
|
|
|
|
- </if>
|
|
|
|
- group by signature
|
|
|
|
|
|
+ where 1=1
|
|
|
|
+ <if test="accountIds !=null and accountIds != ''">
|
|
|
|
+ and t1.account_id in
|
|
|
|
+ <foreach item="item" index="index" collection="accountIds"
|
|
|
|
+ open="(" separator="," close=")">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ <if test="startDate !=null and startDate != ''">
|
|
|
|
+ AND t1.stat_date >= DATE_FORMAT(#{startDate},'%Y%m%d')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endDate !=null and endDate != ''">
|
|
|
|
+ AND t1.stat_date <= DATE_FORMAT(#{endDate},'%Y%m%d')
|
|
|
|
+ </if>
|
|
|
|
+ <if test="leaderId !=null and leaderId != ''">
|
|
|
|
+ AND t1.leader_id = #{leaderId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="channelType != null">
|
|
|
|
+ AND t1.channel_type = #{channelType}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="clipId !=null and clipId != ''">
|
|
|
|
+ AND t1.clip_id = #{clipId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="planId !=null and planId != ''">
|
|
|
|
+ AND t1.plan_id = #{planId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="shotId !=null and shotId != ''">
|
|
|
|
+ AND t1.shot_id = #{shotId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="companyId !=null and companyId != ''">
|
|
|
|
+ AND t1.company_id = #{companyId}
|
|
|
|
+ </if>
|
|
|
|
+ group by signature
|
|
) t
|
|
) t
|
|
</select>
|
|
</select>
|
|
|
|
|