zhaotx 1 год назад
Родитель
Сommit
9991455716

+ 36 - 36
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/mapper/xml/ReportsAdPushMapper.xml

@@ -119,25 +119,25 @@
         <include refid="iaaRealCostAmount"/>,
         <include refid="iapRealCostAmount"/>
         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 not in (2,4,6))
+        (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_type not in (2,4,6))
         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 not in (2,4,6))
         ) tb1
         left join
-        (select product_id, sum(iaa_cost_amount) as iaa_cost_amount, sum(iaa_real_cost_amount) as iaa_real_cost_amount,
+        (select movie_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(iaa_cost_amount)+sum(iap_cost_amount) as cost_amount,
         sum(iaa_real_cost_amount)+sum(iap_real_cost_amount) as real_cost_amount
         from
-        (select product_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_product_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) and business_method='IAA')
-        group by product_id
+        (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_type not in (2,4,6) and business_method='IAA')
+        group by movie_id
         union all
-        select product_id, 0 as iaa_cost_amount, 0 as iaa_real_cost_amount,
+        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_product_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) and business_method='IAP')
-        group by product_id) subt2
-        group by product_id
-        ) tb2 on tb1.product_id=tb2.product_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) and business_method='IAP')
+        group by movie_id) subt2
+        group by movie_id
+        ) tb2 on tb1.movie_id=tb2.movie_id
         left join
         (select movie_id, ifnull(sum(iaa_amount), 0) as iaa_amount,
         ifnull(sum(pay_amount), 0) as pay_amount,
@@ -146,14 +146,14 @@
         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_type not in (2,4,6))
         group by movie_id
-        ) tb3 on tb1.product_id=tb3.movie_id
+        ) tb3 on tb1.movie_id=tb3.movie_id
         left join
         (select moive_id, standard_movie_id, standard_movie_name, movie_source, movie_project_source from tidb.deepthink.all_moive
-        ) tb4 on tb1.product_id=tb4.moive_id
+        ) tb4 on tb1.movie_id=tb4.moive_id
         left join
         (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
-        where 1=1 and tb1.product_id!='-9999'
+        where 1=1 and tb1.movie_id!='-9999'
         group by tb4.standard_movie_name, tb4.movie_project_source, tb5.dict_name
         order by sum(iaa_amount)+sum(pay_amount) desc
         limit 20
@@ -196,24 +196,24 @@
         <include refid="shareIaaAmount3"/>,
         round(ifnull(sum(hour_cost_amount), 0), 2) as hour_cost_amount
         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 not in (2,4,6))
+        (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_type not in (2,4,6))
         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 not in (2,4,6))) tb1
         left join
         (
-        select product_id, sum(iaa_cost_amount) as iaa_cost_amount, sum(iaa_real_cost_amount) as iaa_real_cost_amount,
+        select movie_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(iaa_cost_amount)+sum(iap_cost_amount) as cost_amount,
         sum(iaa_real_cost_amount)+sum(iap_real_cost_amount) as real_cost_amount
         from
-        (select product_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_product_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) and business_method='IAA')
-        group by product_id
+        (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_type not in (2,4,6) and business_method='IAA')
+        group by movie_id
         union all
-        select product_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_product_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) and business_method='IAP')
-        group by product_id) subt2
-        group by product_id
-        ) tb2 on tb1.product_id=tb2.product_id
+        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_type not in (2,4,6) and business_method='IAP')
+        group by movie_id) subt2
+        group by movie_id
+        ) tb2 on tb1.movie_id=tb2.movie_id
         left join
         (select movie_id, sum(iaa_amount) as iaa_amount, sum(pay_amount) as pay_amount,
         sum(share_iaa_amount_3) as share_iaa_amount_3,
@@ -221,18 +221,18 @@
         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_type not in (2,4,6))
         group by movie_id
-        ) tb3 on tb1.product_id=tb3.movie_id
+        ) tb3 on tb1.movie_id=tb3.movie_id
         left join
         (select moive_id, standard_movie_id, standard_movie_name, movie_source, movie_project_source from tidb.deepthink.all_moive
-        ) tb4 on tb1.product_id=tb4.moive_id
+        ) tb4 on tb1.movie_id=tb4.moive_id
         left join
-        (select product_id, ifnull(sum(cost_amount), 0) as hour_cost_amount from application.media_product_report_hourly
+        (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_type not in (2,4,6))
-        group by product_id) tb5 on tb1.product_id=tb5.product_id
+        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'
         ) tb6 on tb4.movie_project_source=tb6.dict_key
-        where 1=1 and tb1.product_id != '-9999'
+        where 1=1 and tb1.movie_id != '-9999'
         group by tb4.standard_movie_name, tb4.movie_project_source, tb6.dict_name
         order by end_amount desc
         limit 20
@@ -543,14 +543,14 @@
         <include refid="endAmount"/>,
         <include refid="costAmount"/>
         from
-        (select product_id from application.media_product_report_daily where stat_date=${date}
+        (select movie_id from application.media_ad_report_daily where stat_date=${date}
         union select movie_id from application.user_data_report_daily where stat_date=${date}
         ) tb1
         left join
-        (select product_id, round(ifnull(sum(cost_amount),0),2) as cost_amount, sum(real_cost_amount) as real_cost_amount
-        from application.media_product_report_daily where stat_date=${date}
-        group by product_id
-        ) tb2 on tb1.product_id=tb2.product_id
+        (select movie_id, 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}
+        group by movie_id
+        ) tb2 on tb1.movie_id=tb2.movie_id
         left join
         (select movie_id,
         ifnull(sum(iaa_amount), 0) as iaa_amount,
@@ -559,14 +559,14 @@
         ifnull(sum(share_iaa_amount), 0) as share_iaa_amount
         from application.user_data_report_daily where stat_date=${date}
         group by movie_id
-        ) tb3 on tb1.product_id=tb3.movie_id
+        ) tb3 on tb1.movie_id=tb3.movie_id
         left join
         (select moive_id, standard_movie_id, standard_movie_name, movie_source, movie_project_source from tidb.deepthink.all_moive
-        ) tb4 on tb1.product_id=tb4.moive_id
+        ) tb4 on tb1.movie_id=tb4.moive_id
         left join
         (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
-        where 1=1 and tb1.product_id!='-9999'
+        where 1=1 and tb1.movie_id!='-9999'
         group by tb4.standard_movie_name, tb4.movie_project_source, tb5.dict_name
         order by sum(share_iaa_amount)+sum(share_pay_amount) desc
         limit 20

+ 1 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/impl/ReportsByBusinessPushServiceImpl.java

@@ -36,7 +36,7 @@ public class ReportsByBusinessPushServiceImpl implements IReportsByBusinessPushS
     @Autowired
     ReportsAdPushMapper reportsPushMapper;
 
-    private static final String TEMPLATE_VERSION = "1.0.6";
+    private static final String TEMPLATE_VERSION = "1.0.7";
     private static final String TEMPLATE_ID = "AAq4oeDXECopo";