|
|
@@ -75,7 +75,7 @@
|
|
|
FROM
|
|
|
(select 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
|
|
|
- where stat_date = ${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,4))
|
|
|
+ where stat_date = ${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,6,7,4,8,9,10))
|
|
|
) tb1,
|
|
|
(select sum(pay_amount) as pay_amount,
|
|
|
sum(iaa_amount) as iaa_amount,
|
|
|
@@ -83,7 +83,7 @@
|
|
|
sum(share_pay_amount) as share_pay_amount,
|
|
|
sum(share_iaa_amount) as share_iaa_amount
|
|
|
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_line in (1,4))
|
|
|
+ where stat_date = ${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,6,7,4,8,9,10))
|
|
|
) tb2
|
|
|
</select>
|
|
|
<select id="adHourData" resultType="java.util.Map">
|
|
|
@@ -98,13 +98,13 @@
|
|
|
from
|
|
|
(select sum(cost_amount) as cost_amount, sum(real_cost_amount) as real_cost_amount
|
|
|
from application.media_ad_report_hourly
|
|
|
- where stat_date = #{date} and `hour`= #{hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,4))
|
|
|
+ where stat_date = #{date} and `hour`= #{hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,6,7,4,8,9,10))
|
|
|
) tb1,
|
|
|
(select sum(pay_amount) as pay_amount, sum(iaa_amount) as iaa_amount,
|
|
|
sum(share_iaa_amount_3) as share_iaa_amount_3,
|
|
|
sum(share_iaa_amount) as share_iaa_amount, sum(share_pay_amount) as share_pay_amount
|
|
|
from application.user_data_report_hourly
|
|
|
- where stat_date = #{date} and `hour`= #{hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,4))
|
|
|
+ where stat_date = #{date} and `hour`= #{hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,6,7,4,8,9,10))
|
|
|
) tb2
|
|
|
</select>
|
|
|
<select id="tmpTopMovie" resultType="java.util.Map">
|
|
|
@@ -119,8 +119,8 @@
|
|
|
<include refid="iaaRealCostAmount"/>,
|
|
|
<include refid="iapRealCostAmount"/>
|
|
|
from
|
|
|
- (select 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_line in (1,4))
|
|
|
- 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_line in (1,4))
|
|
|
+ (select 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_line in (1,6,7,4,8,9,10))
|
|
|
+ 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_line in (1,6,7,4,8,9,10))
|
|
|
) tb1
|
|
|
left join
|
|
|
(select movie_id, sum(iaa_cost_amount) as iaa_cost_amount, sum(iaa_real_cost_amount) as iaa_real_cost_amount,
|
|
|
@@ -129,12 +129,12 @@
|
|
|
sum(iaa_real_cost_amount)+sum(iap_real_cost_amount) as real_cost_amount
|
|
|
from
|
|
|
(select movie_id, round(ifnull(sum(cost_amount),0),2) as iaa_cost_amount, sum(real_cost_amount) as iaa_real_cost_amount, 0 as iap_cost_amount, 0 as iap_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_line in (1,4) and business_method='IAA')
|
|
|
+ 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_line in (1,6,7,4,8,9,10) and business_method='IAA')
|
|
|
group by movie_id
|
|
|
union all
|
|
|
select movie_id, 0 as iaa_cost_amount, 0 as iaa_real_cost_amount,
|
|
|
round(ifnull(sum(cost_amount),0),2) 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_line in (1,4) and business_method='IAP')
|
|
|
+ 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_line in (1,6,7,4,8,9,10) and business_method='IAP')
|
|
|
group by movie_id) subt2
|
|
|
group by movie_id
|
|
|
) tb2 on tb1.movie_id=tb2.movie_id
|
|
|
@@ -144,7 +144,7 @@
|
|
|
ifnull(sum(share_pay_amount), 0) as share_pay_amount,
|
|
|
ifnull(sum(share_iaa_amount), 0) as share_iaa_amount,
|
|
|
round(ifnull(sum(share_iaa_amount_3), 0),2) as share_iaa_amount_3
|
|
|
- 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_line in (1,4))
|
|
|
+ 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_line in (1,6,7,4,8,9,10))
|
|
|
group by movie_id
|
|
|
) tb3 on tb1.movie_id=tb3.movie_id
|
|
|
left join
|
|
|
@@ -172,13 +172,13 @@
|
|
|
from
|
|
|
(select 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
|
|
|
- where stat_date = #{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,4))
|
|
|
+ where stat_date = #{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,6,7,4,8,9,10))
|
|
|
) tb1,
|
|
|
(select sum(pay_amount) as pay_amount, sum(iaa_amount) as iaa_amount,
|
|
|
sum(share_iaa_amount) as share_iaa_amount, sum(share_pay_amount) as share_pay_amount,
|
|
|
sum(share_iaa_amount_3) as share_iaa_amount_3
|
|
|
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_line in (1,4))
|
|
|
+ where stat_date = #{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,6,7,4,8,9,10))
|
|
|
) tb2
|
|
|
</select>
|
|
|
|
|
|
@@ -207,8 +207,8 @@
|
|
|
<include refid="iapCostAmount"/>,
|
|
|
round(ifnull(sum(hour_cost_amount), 0), 2) as hour_cost_amount
|
|
|
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_line in (1,4))
|
|
|
- union select ${date} as stat_date, 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_line in (1,4))) tb1
|
|
|
+ (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_line in (1,6,7,4,8,9,10))
|
|
|
+ union select ${date} as stat_date, 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_line in (1,6,7,4,8,9,10))) tb1
|
|
|
left join
|
|
|
(
|
|
|
select movie_id, sum(iaa_cost_amount) as iaa_cost_amount, sum(iaa_real_cost_amount) as iaa_real_cost_amount,
|
|
|
@@ -217,11 +217,11 @@
|
|
|
sum(iaa_real_cost_amount)+sum(iap_real_cost_amount) as real_cost_amount
|
|
|
from
|
|
|
(select movie_id, round(ifnull(sum(cost_amount),0),2) as iaa_cost_amount, sum(real_cost_amount) as iaa_real_cost_amount, 0 as iap_cost_amount, 0 as iap_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_line in (1,4) and business_method='IAA')
|
|
|
+ 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_line in (1,6,7,4,8,9,10) and business_method='IAA')
|
|
|
group by movie_id
|
|
|
union all
|
|
|
select movie_id, 0 as iaa_cost_amount, 0 as iaa_real_cost_amount,round(ifnull(sum(cost_amount),0),2) 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_line in (1,4) and business_method='IAP')
|
|
|
+ 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_line in (1,6,7,4,8,9,10) and business_method='IAP')
|
|
|
group by movie_id) subt2
|
|
|
group by movie_id
|
|
|
) tb2 on tb1.movie_id=tb2.movie_id
|
|
|
@@ -230,7 +230,7 @@
|
|
|
sum(share_iaa_amount_3) as share_iaa_amount_3,
|
|
|
ifnull(sum(share_iaa_amount), 0) as share_iaa_amount,
|
|
|
ifnull(sum(share_pay_amount), 0) as share_pay_amount
|
|
|
- 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_line in (1,4))
|
|
|
+ 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_line in (1,6,7,4,8,9,10))
|
|
|
group by movie_id
|
|
|
) tb3 on tb1.movie_id=tb3.movie_id
|
|
|
left join
|
|
|
@@ -238,7 +238,7 @@
|
|
|
) tb4 on tb1.movie_id=tb4.moive_id
|
|
|
left join
|
|
|
(select movie_id, ifnull(sum(cost_amount), 0) as hour_cost_amount from application.media_ad_report_hourly
|
|
|
- where stat_date=${date} and `hour`=${hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,4))
|
|
|
+ where stat_date=${date} and `hour`=${hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,6,7,4,8,9,10))
|
|
|
group by movie_id) tb5 on tb1.movie_id=tb5.movie_id
|
|
|
left join
|
|
|
(select dict_key, dict_name from tidb.deepthink.dt_dictionary where select_key='movie_project_source'
|
|
|
@@ -265,11 +265,11 @@
|
|
|
sum(iaa_real_cost_amount)+sum(iap_real_cost_amount) as real_cost_amount
|
|
|
FROM
|
|
|
(select advertiser_id, round(ifnull(sum(cost_amount),0),2) as iaa_cost_amount, sum(real_cost_amount) as iaa_real_cost_amount, 0 as iap_cost_amount, 0 as iap_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_line in (1,4) and business_method='IAA')
|
|
|
+ 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_line in (1,6,7,4,8,9,10) and business_method='IAA')
|
|
|
group by advertiser_id
|
|
|
UNION ALL
|
|
|
select advertiser_id, 0 as iaa_cost_amount, 0 as iaa_real_cost_amount,round(ifnull(sum(cost_amount),0),2) as iap_cost_amount, sum(real_cost_amount) as iap_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_line in (1,4) and business_method='IAP')
|
|
|
+ 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_line in (1,6,7,4,8,9,10) and business_method='IAP')
|
|
|
group by advertiser_id)subtb2
|
|
|
group by advertiser_id
|
|
|
) tb2
|
|
|
@@ -278,7 +278,7 @@
|
|
|
round(ifnull(sum(share_iaa_amount_3), 0),2) as share_iaa_amount_3,
|
|
|
sum(share_iaa_amount) as share_iaa_amount,
|
|
|
sum(share_pay_amount) as share_pay_amount
|
|
|
- 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_line in (1,4))
|
|
|
+ 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_line in (1,6,7,4,8,9,10))
|
|
|
group by advertiser_id) tb3
|
|
|
on tb1.advertiser_id = tb3.advertiser_id
|
|
|
left join (select user_id, nick_name, phonenumber, dept_id, status, del_flag from tidb.deepthink.sys_user) tb4
|
|
|
@@ -309,13 +309,13 @@
|
|
|
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
|
|
|
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_line in (1,4))
|
|
|
+ where stat_date = #{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,6,7,4,8,9,10))
|
|
|
group by advertiser_id) tb2 on tb1.advertiser_id = tb2.advertiser_id
|
|
|
left join
|
|
|
(select advertiser_id, sum(pay_amount) as pay_amount, sum(iaa_amount) as iaa_amount,
|
|
|
sum(share_iaa_amount) as share_iaa_amount, sum(share_pay_amount) as share_pay_amount
|
|
|
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_line in (1,4))
|
|
|
+ where stat_date = #{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,6,7,4,8,9,10))
|
|
|
group by advertiser_id) tb3 on tb1.advertiser_id = tb3.advertiser_id
|
|
|
left join (select user_id, nick_name, phonenumber, dept_id from tidb.deepthink.sys_user) tb4
|
|
|
on tb1.user_id=tb4.user_id
|
|
|
@@ -342,13 +342,13 @@
|
|
|
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
|
|
|
from application.media_ad_report_hourly
|
|
|
- where stat_date = #{date} and `hour`= #{hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,4))
|
|
|
+ where stat_date = #{date} and `hour`= #{hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,6,7,4,8,9,10))
|
|
|
group by advertiser_id) tb2 on tb1.advertiser_id = tb2.advertiser_id
|
|
|
left join
|
|
|
(select advertiser_id, sum(pay_amount) as pay_amount, sum(iaa_amount) as iaa_amount,
|
|
|
sum(share_iaa_amount) as share_iaa_amount, sum(share_pay_amount) as share_pay_amount
|
|
|
from application.user_data_report_hourly
|
|
|
- where stat_date = #{date} and `hour`= #{hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,4))
|
|
|
+ where stat_date = #{date} and `hour`= #{hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,6,7,4,8,9,10))
|
|
|
group by advertiser_id) tb3 on tb1.advertiser_id = tb3.advertiser_id
|
|
|
left join (select user_id, nick_name, phonenumber from tidb.deepthink.sys_user) tb4
|
|
|
on tb1.user_id=tb4.user_id
|
|
|
@@ -365,11 +365,11 @@
|
|
|
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, 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_line in (1,4))
|
|
|
+ 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_line in (1,6,7,4,8,9,10))
|
|
|
group by advertiser_id) tb2
|
|
|
on tb1.advertiser_id = tb2.advertiser_id
|
|
|
left join (select advertiser_id, sum(cost_amount) as cost_amount_hour
|
|
|
- from application.media_ad_report_hourly where stat_date=#{date} and `hour`= ${hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,4))
|
|
|
+ from application.media_ad_report_hourly where stat_date=#{date} and `hour`= ${hour} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,6,7,4,8,9,10))
|
|
|
group by advertiser_id) tb3
|
|
|
on tb1.advertiser_id = tb3.advertiser_id
|
|
|
left join (select user_id, nick_name, phonenumber, dept_id from tidb.deepthink.sys_user) tb4
|
|
|
@@ -470,11 +470,11 @@
|
|
|
sum(iaa_real_cost_amount)+sum(iap_real_cost_amount) as real_cost_amount
|
|
|
FROM
|
|
|
(select advertiser_id, round(ifnull(sum(cost_amount),0),2) as iaa_cost_amount, sum(real_cost_amount) as iaa_real_cost_amount, 0 as iap_cost_amount, 0 as iap_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_line in (1,4) and business_method='IAA')
|
|
|
+ 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_line in (1,6,7,4,8,9,10) and business_method='IAA')
|
|
|
group by advertiser_id
|
|
|
UNION ALL
|
|
|
select advertiser_id, 0 as iaa_cost_amount, 0 as iaa_real_cost_amount,round(ifnull(sum(cost_amount),0),2) 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_line in (1,4) and business_method='IAP')
|
|
|
+ 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_line in (1,6,7,4,8,9,10) and business_method='IAP')
|
|
|
group by advertiser_id)subtb2
|
|
|
group by advertiser_id
|
|
|
) tb2
|
|
|
@@ -483,7 +483,7 @@
|
|
|
round(ifnull(sum(share_iaa_amount_3), 0),2) as share_iaa_amount_3,
|
|
|
ifnull(sum(share_iaa_amount), 0) as share_iaa_amount,
|
|
|
sum(share_pay_amount) as share_pay_amount
|
|
|
- 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_line in (1,4))
|
|
|
+ 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_line in (1,6,7,4,8,9,10))
|
|
|
group by advertiser_id) tb3
|
|
|
on tb1.advertiser_id = tb3.advertiser_id
|
|
|
left join (select user_id, nick_name, phonenumber, dept_id from tidb.deepthink.sys_user) tb4
|
|
|
@@ -606,8 +606,8 @@
|
|
|
</select>
|
|
|
|
|
|
<sql id="businessLine">
|
|
|
- <if test="type != null and type == 1">and business_line = 1</if>
|
|
|
- <if test="type != null and type == 4">and business_line = 4</if>
|
|
|
+ <if test="type != null and type == 1">and business_line in (1,6,7,10)</if>
|
|
|
+ <if test="type != null and type == 4">and business_line in (4,8,9)</if>
|
|
|
</sql>
|
|
|
<select id="movieTop" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
select tb2.standard_movie_name,
|
|
|
@@ -665,4 +665,10 @@
|
|
|
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>
|
|
|
+ <select id="publishDownMovieList" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
+ select movie_name, tb2.dict_name as movie_source, tb1.publish_change_time
|
|
|
+ from deepthink.all_moive tb1
|
|
|
+ left join deepthink.dt_dictionary tb2 on cast(tb1.movie_source as char)=tb2.dict_key and tb2.select_key='movie_source'
|
|
|
+ where tb1.publish_status=3 and publish_change_time >=DATE_SUB(NOW(), INTERVAL 3 DAY)
|
|
|
+ </select>
|
|
|
</mapper>
|