zhaotx пре 10 месеци
родитељ
комит
33b54d85a0

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

@@ -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_type not in (2,4,6))
+             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 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_type not in (2,4,6))
+             where stat_date = ${date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,4))
             ) 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_type not in (2,4,6))
+        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))
         ) 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_type not in (2,4,6))
+        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))
         ) 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_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))
+        (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))
         ) 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_type not in (2,4,6) 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,4) 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_type not in (2,4,6) 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,4) 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_type not in (2,4,6))
+        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))
         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_type not in (2,4,6))
+        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 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_type not in (2,4,6))
+        where stat_date = #{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,4))
         ) 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_type not in (2,4,6))
-        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_type not in (2,4,6))) 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,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
         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_type not in (2,4,6) 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,4) 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_type not in (2,4,6) 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,4) 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_type not in (2,4,6))
+        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))
         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_type not in (2,4,6))
+        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))
         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_type not in (2,4,6) 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,4) 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_type not in (2,4,6) 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,4) 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_type not in (2,4,6))
+        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))
         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
@@ -308,13 +308,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_type not in (2,4,6))
+        where stat_date = #{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,4))
         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_type not in (2,4,6))
+        where stat_date = #{date} and ma_appid in (select app_id from tidb.deepthink.mini_app_info where business_line in (1,4))
         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
@@ -341,13 +341,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_type not in (2,4,6))
+        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))
         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_type not in (2,4,6))
+        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))
         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
@@ -364,11 +364,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_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_line in (1,4))
         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_type not in (2,4,6))
+        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))
         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
@@ -467,11 +467,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_type not in (2,4,6) 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,4) 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_type not in (2,4,6) 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,4) and business_method='IAP')
         group by advertiser_id)subtb2
         group by advertiser_id
         ) tb2
@@ -480,7 +480,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_type not in (2,4,6))
+        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))
         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