|
@@ -42,6 +42,12 @@
|
|
|
<sql id="realCostAmount">
|
|
<sql id="realCostAmount">
|
|
|
round(ifnull(sum(real_cost_amount), 0), 2) as real_cost_amount
|
|
round(ifnull(sum(real_cost_amount), 0), 2) as real_cost_amount
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
+ <sql id="iaaRoi">
|
|
|
|
|
+ concat(round(if(ifnull(sum(iaa_real_cost_amount),0)=0, 0, ifnull(sum(share_iaa_amount_3), 0)/sum(iaa_real_cost_amount)*100), 2), '%') AS iaa_roi
|
|
|
|
|
+ </sql>
|
|
|
|
|
+ <sql id="iapRoi">
|
|
|
|
|
+ concat(round(if(ifnull(sum(iap_real_cost_amount),0)=0, 0, ifnull(sum(share_pay_amount), 0)/sum(iap_real_cost_amount)*100), 2), '%') AS iap_roi
|
|
|
|
|
+ </sql>
|
|
|
|
|
|
|
|
<select id="tmpPushData" resultType="java.util.Map">
|
|
<select id="tmpPushData" resultType="java.util.Map">
|
|
|
select
|
|
select
|
|
@@ -93,8 +99,8 @@
|
|
|
<include refid="endAmount"/>,
|
|
<include refid="endAmount"/>,
|
|
|
<include refid="costAmount"/>,
|
|
<include refid="costAmount"/>,
|
|
|
<include refid="realCostAmount"/>,
|
|
<include refid="realCostAmount"/>,
|
|
|
- concat(round(if(ifnull(sum(iaa_real_cost_amount),0)=0, 0, sum(share_iaa_amount_3)/sum(iaa_real_cost_amount)*100), 2), '%') AS iaa_roi,
|
|
|
|
|
- concat(round(if(ifnull(sum(iap_real_cost_amount),0)=0, 0, sum(share_pay_amount)/sum(iap_real_cost_amount)*100), 2), '%') AS iap_roi
|
|
|
|
|
|
|
+ <include refid="iaaRoi"/>,
|
|
|
|
|
+ <include refid="iapRoi"/>
|
|
|
from
|
|
from
|
|
|
(select product_id from application.media_product_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
|
|
(select product_id from application.media_product_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
|
|
|
union select movie_id from application.user_data_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
|
|
union select movie_id from application.user_data_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
|
|
@@ -164,8 +170,8 @@
|
|
|
<include refid="waterEndAmount"/>,
|
|
<include refid="waterEndAmount"/>,
|
|
|
<include refid="costAmount"/>,
|
|
<include refid="costAmount"/>,
|
|
|
<include refid="realCostAmount"/>,
|
|
<include refid="realCostAmount"/>,
|
|
|
- concat(round(if(ifnull(sum(iaa_real_cost_amount),0)=0, 0, sum(share_iaa_amount_3)/sum(iaa_real_cost_amount)*100), 2), '%') AS iaa_roi,
|
|
|
|
|
- concat(round(if(ifnull(sum(iap_real_cost_amount),0)=0, 0, sum(share_pay_amount)/sum(iap_real_cost_amount)*100), 2), '%') AS iap_roi,
|
|
|
|
|
|
|
+ <include refid="iaaRoi"/>,
|
|
|
|
|
+ <include refid="iapRoi"/>,
|
|
|
round(ifnull(sum(hour_cost_amount), 0), 2) as hour_cost_amount
|
|
round(ifnull(sum(hour_cost_amount), 0), 2) as hour_cost_amount
|
|
|
from
|
|
from
|
|
|
(select product_id from application.media_product_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
|
|
(select product_id from application.media_product_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type in (1,3,8,9,10,11))
|
|
@@ -212,8 +218,8 @@
|
|
|
select tb1.user_id, tb4.phonenumber, tb4.nick_name, tb4.dept_id, tb5.dept_name,
|
|
select tb1.user_id, tb4.phonenumber, tb4.nick_name, tb4.dept_id, tb5.dept_name,
|
|
|
rank() over (order by sum(cost_amount) desc) as rk,
|
|
rank() over (order by sum(cost_amount) desc) as rk,
|
|
|
<include refid="costAmount"/>,
|
|
<include refid="costAmount"/>,
|
|
|
- concat(round(if(ifnull(sum(iaa_real_cost_amount),0)=0, 0, sum(share_iaa_amount_3)/sum(iaa_real_cost_amount)*100), 2), '%') AS iaa_roi,
|
|
|
|
|
- concat(round(if(ifnull(sum(iap_real_cost_amount),0)=0, 0, sum(share_pay_amount)/sum(iap_real_cost_amount)*100), 2), '%') AS iap_roi
|
|
|
|
|
|
|
+ <include refid="iaaRoi"/>,
|
|
|
|
|
+ <include refid="iapRoi"/>
|
|
|
from
|
|
from
|
|
|
(select cast(advertiser_id as char) advertiser_id, user_id from tidb.deepthink.advertiser_bind_info) tb1
|
|
(select cast(advertiser_id as char) advertiser_id, user_id from tidb.deepthink.advertiser_bind_info) tb1
|
|
|
left join
|
|
left join
|
|
@@ -390,8 +396,8 @@
|
|
|
select tb4.dept_id, tb5.dept_name,
|
|
select tb4.dept_id, tb5.dept_name,
|
|
|
rank() over (order by sum(cost_amount) desc) as rk,
|
|
rank() over (order by sum(cost_amount) desc) as rk,
|
|
|
<include refid="costAmount"/>,
|
|
<include refid="costAmount"/>,
|
|
|
- concat(round(if(ifnull(sum(iaa_real_cost_amount),0)=0, 0, sum(share_iaa_amount_3)/sum(iaa_real_cost_amount)*100), 2), '%') AS iaa_roi,
|
|
|
|
|
- concat(round(if(ifnull(sum(iap_real_cost_amount),0)=0, 0, sum(share_pay_amount)/sum(iap_real_cost_amount)*100), 2), '%') AS iap_roi
|
|
|
|
|
|
|
+ <include refid="iaaRoi"/>,
|
|
|
|
|
+ <include refid="iapRoi"/>
|
|
|
from
|
|
from
|
|
|
(select cast(advertiser_id as char) advertiser_id, user_id from tidb.deepthink.advertiser_bind_info) tb1
|
|
(select cast(advertiser_id as char) advertiser_id, user_id from tidb.deepthink.advertiser_bind_info) tb1
|
|
|
left join
|
|
left join
|