|
@@ -108,7 +108,7 @@
|
|
|
) tb2
|
|
) tb2
|
|
|
</select>
|
|
</select>
|
|
|
<select id="tmpTopMovie" resultType="java.util.Map">
|
|
<select id="tmpTopMovie" resultType="java.util.Map">
|
|
|
- select tb4.standard_movie_name as movie_name, tb4.movie_project_source, tb5.dict_name as movie_project_source_name,
|
|
|
|
|
|
|
+ select tb4.ly_movie_name as movie_name, tb4.movie_project_source, tb5.dict_name as movie_project_source_name,
|
|
|
group_concat(distinct case tb4.movie_source when 2 then '2' else '1' end) as movie_source,
|
|
group_concat(distinct case tb4.movie_source when 2 then '2' else '1' end) as movie_source,
|
|
|
rank() over (order by sum(iaa_amount)+sum(pay_amount) desc) as rk,
|
|
rank() over (order by sum(iaa_amount)+sum(pay_amount) desc) as rk,
|
|
|
<include refid="endAmount"/>,
|
|
<include refid="endAmount"/>,
|
|
@@ -148,13 +148,13 @@
|
|
|
group by movie_id
|
|
group by movie_id
|
|
|
) tb3 on tb1.movie_id=tb3.movie_id
|
|
) tb3 on tb1.movie_id=tb3.movie_id
|
|
|
left join
|
|
left join
|
|
|
- (select moive_id, standard_movie_id, standard_movie_name, movie_source, movie_project_source from tidb.deepthink.all_moive
|
|
|
|
|
|
|
+ (select moive_id, standard_movie_id, standard_movie_name, movie_source, movie_project_source,ly_movie_name from tidb.deepthink.all_moive
|
|
|
) tb4 on tb1.movie_id=tb4.moive_id
|
|
) tb4 on tb1.movie_id=tb4.moive_id
|
|
|
left join
|
|
left join
|
|
|
(select dict_key, dict_name from tidb.deepthink.dt_dictionary where select_key='movie_project_source'
|
|
(select dict_key, dict_name from tidb.deepthink.dt_dictionary where select_key='movie_project_source'
|
|
|
) tb5 on tb4.movie_project_source=tb5.dict_key
|
|
) tb5 on tb4.movie_project_source=tb5.dict_key
|
|
|
where 1=1 and tb1.movie_id!='-9999'
|
|
where 1=1 and tb1.movie_id!='-9999'
|
|
|
- group by tb4.standard_movie_name, tb4.movie_project_source, tb5.dict_name
|
|
|
|
|
|
|
+ group by tb4.ly_movie_name, tb4.movie_project_source, tb5.dict_name
|
|
|
order by sum(iaa_amount)+sum(pay_amount) desc
|
|
order by sum(iaa_amount)+sum(pay_amount) desc
|
|
|
limit 20
|
|
limit 20
|
|
|
</select>
|
|
</select>
|
|
@@ -184,7 +184,7 @@
|
|
|
|
|
|
|
|
<select id="todayTopMovie" resultType="com.alibaba.fastjson.JSONObject" >
|
|
<select id="todayTopMovie" resultType="com.alibaba.fastjson.JSONObject" >
|
|
|
select
|
|
select
|
|
|
- tb4.standard_movie_name as movie_name, tb4.movie_project_source, tb6.dict_name as movie_project_source_name,
|
|
|
|
|
|
|
+ tb4.ly_movie_name as movie_name, tb4.movie_project_source, tb6.dict_name as movie_project_source_name,
|
|
|
case
|
|
case
|
|
|
when (DATEDIFF(STR_TO_DATE(tb1.stat_date, '%Y%m%d'), STR_TO_DATE(tb4.project_ad_date, '%Y%m%d')) + 1) between 1
|
|
when (DATEDIFF(STR_TO_DATE(tb1.stat_date, '%Y%m%d'), STR_TO_DATE(tb4.project_ad_date, '%Y%m%d')) + 1) between 1
|
|
|
and 3 then '新剧1阶'
|
|
and 3 then '新剧1阶'
|
|
@@ -203,6 +203,8 @@
|
|
|
<include refid="iapRoi"/>,
|
|
<include refid="iapRoi"/>,
|
|
|
<include refid="sharePayAmount"/>,
|
|
<include refid="sharePayAmount"/>,
|
|
|
<include refid="shareIaaAmount3"/>,
|
|
<include refid="shareIaaAmount3"/>,
|
|
|
|
|
+ <include refid="iaaCostAmount"/>,
|
|
|
|
|
+ <include refid="iapCostAmount"/>,
|
|
|
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 ${date} as stat_date, movie_id from application.media_ad_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type not in (2,4,6))
|
|
(select ${date} as stat_date, movie_id from application.media_ad_report_daily where stat_date=${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type not in (2,4,6))
|
|
@@ -232,7 +234,7 @@
|
|
|
group by movie_id
|
|
group by movie_id
|
|
|
) tb3 on tb1.movie_id=tb3.movie_id
|
|
) tb3 on tb1.movie_id=tb3.movie_id
|
|
|
left join
|
|
left join
|
|
|
- (select moive_id, standard_movie_id, standard_movie_name, movie_source, movie_project_source,project_ad_date from tidb.deepthink.all_moive
|
|
|
|
|
|
|
+ (select moive_id, standard_movie_id, standard_movie_name, movie_source, movie_project_source,project_ad_date, ly_movie_name from tidb.deepthink.all_moive
|
|
|
) tb4 on tb1.movie_id=tb4.moive_id
|
|
) tb4 on tb1.movie_id=tb4.moive_id
|
|
|
left join
|
|
left join
|
|
|
(select movie_id, ifnull(sum(cost_amount), 0) as hour_cost_amount from application.media_ad_report_hourly
|
|
(select movie_id, ifnull(sum(cost_amount), 0) as hour_cost_amount from application.media_ad_report_hourly
|
|
@@ -243,7 +245,7 @@
|
|
|
) tb6 on tb4.movie_project_source=tb6.dict_key
|
|
) tb6 on tb4.movie_project_source=tb6.dict_key
|
|
|
where 1=1 and tb1.movie_id != '-9999'
|
|
where 1=1 and tb1.movie_id != '-9999'
|
|
|
group by 1,2,3,4
|
|
group by 1,2,3,4
|
|
|
- order by end_amount desc
|
|
|
|
|
|
|
+ order by ${sort}
|
|
|
limit 20
|
|
limit 20
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
@@ -255,7 +257,7 @@
|
|
|
<include refid="iaaRoi"/>,
|
|
<include refid="iaaRoi"/>,
|
|
|
<include refid="iapRoi"/>
|
|
<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 where user_id is not null) tb1
|
|
|
left join
|
|
left join
|
|
|
(select advertiser_id, sum(iaa_cost_amount) as iaa_cost_amount, sum(iaa_real_cost_amount) as iaa_real_cost_amount,
|
|
(select advertiser_id, sum(iaa_cost_amount) as iaa_cost_amount, sum(iaa_real_cost_amount) as iaa_real_cost_amount,
|
|
|
sum(iap_cost_amount) as iap_cost_amount, sum(iap_real_cost_amount) as iap_real_cost_amount,
|
|
sum(iap_cost_amount) as iap_cost_amount, sum(iap_real_cost_amount) as iap_real_cost_amount,
|
|
@@ -302,7 +304,7 @@
|
|
|
<include refid="endAmount"/>,
|
|
<include refid="endAmount"/>,
|
|
|
rank() over (order by sum(cost_amount) desc) as rk
|
|
rank() over (order by sum(cost_amount) desc) as rk
|
|
|
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 where user_id is not null) tb1
|
|
|
left join
|
|
left join
|
|
|
(select advertiser_id, sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount, max(update_time) as update_time
|
|
(select advertiser_id, sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount, max(update_time) as update_time
|
|
|
from application.media_ad_report_daily
|
|
from application.media_ad_report_daily
|
|
@@ -335,7 +337,7 @@
|
|
|
<include refid="endAmount"/>,
|
|
<include refid="endAmount"/>,
|
|
|
max(tb2.update_time) as update_time
|
|
max(tb2.update_time) as update_time
|
|
|
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 where user_id is not null) tb1
|
|
|
left join
|
|
left join
|
|
|
(select advertiser_id, sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount, max(update_time) as update_time
|
|
(select advertiser_id, sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount, max(update_time) as update_time
|
|
|
from application.media_ad_report_hourly
|
|
from application.media_ad_report_hourly
|
|
@@ -360,7 +362,7 @@
|
|
|
<include refid="costAmount"/>,
|
|
<include refid="costAmount"/>,
|
|
|
ifnull(sum(cost_amount_hour), 0) as cost_amount_hour
|
|
ifnull(sum(cost_amount_hour), 0) as cost_amount_hour
|
|
|
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 where user_id is not null) tb1
|
|
|
left join (select advertiser_id, sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount
|
|
left join (select advertiser_id, sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount
|
|
|
from application.media_ad_report_daily where stat_date=#{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type not in (2,4,6))
|
|
from application.media_ad_report_daily where stat_date=#{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_type not in (2,4,6))
|
|
|
group by advertiser_id) tb2
|
|
group by advertiser_id) tb2
|
|
@@ -379,7 +381,6 @@
|
|
|
select dept_id, dept_name, dept_id as sub_dept_id, dept_name as sub_dept_name from tidb.deepthink.sys_dept where parent_id in (select dept_id from tidb.deepthink.sys_dept where parent_id=300)
|
|
select dept_id, dept_name, dept_id as sub_dept_id, dept_name as sub_dept_name from tidb.deepthink.sys_dept where parent_id in (select dept_id from tidb.deepthink.sys_dept where parent_id=300)
|
|
|
) tb5
|
|
) tb5
|
|
|
on tb4.dept_id = tb5.sub_dept_id
|
|
on tb4.dept_id = tb5.sub_dept_id
|
|
|
- where tb1.user_id is not null
|
|
|
|
|
group by tb5.dept_id, tb5.dept_name
|
|
group by tb5.dept_id, tb5.dept_name
|
|
|
having sum(cost_amount)>1
|
|
having sum(cost_amount)>1
|
|
|
order by rk asc
|
|
order by rk asc
|
|
@@ -458,7 +459,7 @@
|
|
|
<include refid="iaaRoi"/>,
|
|
<include refid="iaaRoi"/>,
|
|
|
<include refid="iapRoi"/>
|
|
<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 where user_id is not null) tb1
|
|
|
left join
|
|
left join
|
|
|
(select advertiser_id, sum(iaa_cost_amount) as iaa_cost_amount, sum(iaa_real_cost_amount) as iaa_real_cost_amount,
|
|
(select advertiser_id, sum(iaa_cost_amount) as iaa_cost_amount, sum(iaa_real_cost_amount) as iaa_real_cost_amount,
|
|
|
sum(iap_cost_amount) as iap_cost_amount, sum(iap_real_cost_amount) as iap_real_cost_amount,
|
|
sum(iap_cost_amount) as iap_cost_amount, sum(iap_real_cost_amount) as iap_real_cost_amount,
|
|
@@ -550,10 +551,11 @@
|
|
|
) tb2
|
|
) tb2
|
|
|
</select>
|
|
</select>
|
|
|
<select id="allBusinessTopMovie" resultType="java.util.Map">
|
|
<select id="allBusinessTopMovie" resultType="java.util.Map">
|
|
|
- select tb4.standard_movie_name as movie_name, tb4.movie_project_source, tb5.dict_name as movie_project_source_name,
|
|
|
|
|
|
|
+ select tb4.ly_movie_name as movie_name, tb4.movie_project_source, tb5.dict_name as movie_project_source_name,
|
|
|
group_concat(distinct case tb4.movie_source when 2 then '2' else '1' end) as movie_source,
|
|
group_concat(distinct case tb4.movie_source when 2 then '2' else '1' end) as movie_source,
|
|
|
rank() over (order by sum(share_iaa_amount)+sum(share_pay_amount) desc) as rk,
|
|
rank() over (order by sum(share_iaa_amount)+sum(share_pay_amount) desc) as rk,
|
|
|
<include refid="endAmount"/>,
|
|
<include refid="endAmount"/>,
|
|
|
|
|
+ <include refid="waterEndAmount"/>,
|
|
|
<include refid="costAmount"/>
|
|
<include refid="costAmount"/>
|
|
|
from
|
|
from
|
|
|
(select movie_id from application.media_ad_report_daily where stat_date=${date}
|
|
(select movie_id from application.media_ad_report_daily where stat_date=${date}
|
|
@@ -574,13 +576,13 @@
|
|
|
group by movie_id
|
|
group by movie_id
|
|
|
) tb3 on tb1.movie_id=tb3.movie_id
|
|
) tb3 on tb1.movie_id=tb3.movie_id
|
|
|
left join
|
|
left join
|
|
|
- (select moive_id, standard_movie_id, standard_movie_name, movie_source, movie_project_source from tidb.deepthink.all_moive
|
|
|
|
|
|
|
+ (select moive_id, standard_movie_id, standard_movie_name, movie_source, movie_project_source, ly_movie_name from tidb.deepthink.all_moive
|
|
|
) tb4 on tb1.movie_id=tb4.moive_id
|
|
) tb4 on tb1.movie_id=tb4.moive_id
|
|
|
left join
|
|
left join
|
|
|
(select dict_key, dict_name from tidb.deepthink.dt_dictionary where select_key='movie_project_source'
|
|
(select dict_key, dict_name from tidb.deepthink.dt_dictionary where select_key='movie_project_source'
|
|
|
) tb5 on tb4.movie_project_source=tb5.dict_key
|
|
) tb5 on tb4.movie_project_source=tb5.dict_key
|
|
|
where 1=1 and tb1.movie_id!='-9999'
|
|
where 1=1 and tb1.movie_id!='-9999'
|
|
|
- group by tb4.standard_movie_name, tb4.movie_project_source, tb5.dict_name
|
|
|
|
|
|
|
+ group by tb4.ly_movie_name, tb4.movie_project_source, tb5.dict_name
|
|
|
order by sum(share_iaa_amount)+sum(share_pay_amount) desc
|
|
order by sum(share_iaa_amount)+sum(share_pay_amount) desc
|
|
|
limit 20
|
|
limit 20
|
|
|
</select>
|
|
</select>
|
|
@@ -624,7 +626,8 @@
|
|
|
when sum(tb5.cost_amount) >= 5000000 and sum(tb5.cost_amount) < 10000000 then '500W-1000W'
|
|
when sum(tb5.cost_amount) >= 5000000 and sum(tb5.cost_amount) < 10000000 then '500W-1000W'
|
|
|
when sum(tb5.cost_amount) <= 10000000 then '1000W以上'
|
|
when sum(tb5.cost_amount) <= 10000000 then '1000W以上'
|
|
|
else '未知' end as cost_history,
|
|
else '未知' end as cost_history,
|
|
|
- ifnull(sum(tb4.cost_amount), 0) as cost_hour_number
|
|
|
|
|
|
|
+ ifnull(sum(tb4.cost_amount), 0) as cost_hour_number,
|
|
|
|
|
+ ifnull(sum(tb1.cost_amount), 0) as cost_today_number
|
|
|
from (select ${date} as stat_date, movie_id, sum(cost_amount) as cost_amount from
|
|
from (select ${date} as stat_date, movie_id, sum(cost_amount) as cost_amount from
|
|
|
application.media_ad_report_daily
|
|
application.media_ad_report_daily
|
|
|
where stat_date=${date}
|
|
where stat_date=${date}
|
|
@@ -651,4 +654,11 @@
|
|
|
and (u.dept_id in (203,204,205,206)
|
|
and (u.dept_id in (203,204,205,206)
|
|
|
or d.parent_id in (203,204,205,206))
|
|
or d.parent_id in (203,204,205,206))
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+ <select id="hourUpdateTime" resultType="java.lang.String">
|
|
|
|
|
+ select max(update_time)
|
|
|
|
|
+ from
|
|
|
|
|
+ (select cast(advertiser_id as char) advertiser_id, user_id from tidb.deepthink.advertiser_bind_info where user_id is not null) tb1
|
|
|
|
|
+ left join (select advertiser_id, update_time from application.media_ad_report_hourly where stat_date=#{date} and `hour`=#{hour}) tb2
|
|
|
|
|
+ on tb1.advertiser_id=tb2.advertiser_id
|
|
|
|
|
+ </select>
|
|
|
</mapper>
|
|
</mapper>
|