|
@@ -1948,11 +1948,76 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
buy_amount_d27,
|
|
|
buy_amount_d28,
|
|
|
buy_amount_d29,
|
|
|
- buy_amount_m1,
|
|
|
- buy_amount_m2,
|
|
|
- buy_amount_m3,
|
|
|
+ buy_amount_d30,
|
|
|
+ buy_amount_d31,
|
|
|
+ buy_amount_d32,
|
|
|
+ buy_amount_d33,
|
|
|
+ buy_amount_d34,
|
|
|
+ buy_amount_d35,
|
|
|
+ buy_amount_d36,
|
|
|
+ buy_amount_d37,
|
|
|
+ buy_amount_d38,
|
|
|
+ buy_amount_d39,
|
|
|
+ buy_amount_d40,
|
|
|
+ buy_amount_d41,
|
|
|
+ buy_amount_d42,
|
|
|
+ buy_amount_d43,
|
|
|
+ buy_amount_d44,
|
|
|
+ buy_amount_d45,
|
|
|
+ buy_amount_d46,
|
|
|
+ buy_amount_d47,
|
|
|
+ buy_amount_d48,
|
|
|
+ buy_amount_d49,
|
|
|
+ buy_amount_d50,
|
|
|
+ buy_amount_d51,
|
|
|
+ buy_amount_d52,
|
|
|
+ buy_amount_d53,
|
|
|
+ buy_amount_d54,
|
|
|
+ buy_amount_d55,
|
|
|
+ buy_amount_d56,
|
|
|
+ buy_amount_d57,
|
|
|
+ buy_amount_d58,
|
|
|
+ buy_amount_d59,
|
|
|
+ buy_amount_d60,
|
|
|
+ buy_amount_d61,
|
|
|
+ buy_amount_d62,
|
|
|
+ buy_amount_d63,
|
|
|
+ buy_amount_d64,
|
|
|
+ buy_amount_d65,
|
|
|
+ buy_amount_d66,
|
|
|
+ buy_amount_d67,
|
|
|
+ buy_amount_d68,
|
|
|
+ buy_amount_d69,
|
|
|
+ buy_amount_d70,
|
|
|
+ buy_amount_d71,
|
|
|
+ buy_amount_d72,
|
|
|
+ buy_amount_d73,
|
|
|
+ buy_amount_d74,
|
|
|
+ buy_amount_d75,
|
|
|
+ buy_amount_d76,
|
|
|
+ buy_amount_d77,
|
|
|
+ buy_amount_d78,
|
|
|
+ buy_amount_d79,
|
|
|
+ buy_amount_d80,
|
|
|
+ buy_amount_d81,
|
|
|
+ buy_amount_d82,
|
|
|
+ buy_amount_d83,
|
|
|
+ buy_amount_d84,
|
|
|
+ buy_amount_d85,
|
|
|
+ buy_amount_d86,
|
|
|
+ buy_amount_d87,
|
|
|
+ buy_amount_d88,
|
|
|
+ buy_amount_d89,
|
|
|
+ buy_amount_d90,
|
|
|
+ buy_amount_m4,
|
|
|
+ buy_amount_m5,
|
|
|
buy_amount_m6,
|
|
|
- buy_amount_y1,
|
|
|
+ buy_amount_m7,
|
|
|
+ buy_amount_m8,
|
|
|
+ buy_amount_m9,
|
|
|
+ buy_amount_m10,
|
|
|
+ buy_amount_m11,
|
|
|
+ buy_amount_m12,
|
|
|
buy_amount_sum,
|
|
|
buy_reg_cost,
|
|
|
buy_first_amount_cost as buy_first_new_user_recharge_cost,
|
|
@@ -2023,11 +2088,76 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
nature_amount_d27,
|
|
|
nature_amount_d28,
|
|
|
nature_amount_d29,
|
|
|
- nature_amount_m1,
|
|
|
- nature_amount_m2,
|
|
|
- nature_amount_m3,
|
|
|
+ nature_amount_d30,
|
|
|
+ nature_amount_d31,
|
|
|
+ nature_amount_d32,
|
|
|
+ nature_amount_d33,
|
|
|
+ nature_amount_d34,
|
|
|
+ nature_amount_d35,
|
|
|
+ nature_amount_d36,
|
|
|
+ nature_amount_d37,
|
|
|
+ nature_amount_d38,
|
|
|
+ nature_amount_d39,
|
|
|
+ nature_amount_d40,
|
|
|
+ nature_amount_d41,
|
|
|
+ nature_amount_d42,
|
|
|
+ nature_amount_d43,
|
|
|
+ nature_amount_d44,
|
|
|
+ nature_amount_d45,
|
|
|
+ nature_amount_d46,
|
|
|
+ nature_amount_d47,
|
|
|
+ nature_amount_d48,
|
|
|
+ nature_amount_d49,
|
|
|
+ nature_amount_d50,
|
|
|
+ nature_amount_d51,
|
|
|
+ nature_amount_d52,
|
|
|
+ nature_amount_d53,
|
|
|
+ nature_amount_d54,
|
|
|
+ nature_amount_d55,
|
|
|
+ nature_amount_d56,
|
|
|
+ nature_amount_d57,
|
|
|
+ nature_amount_d58,
|
|
|
+ nature_amount_d59,
|
|
|
+ nature_amount_d60,
|
|
|
+ nature_amount_d61,
|
|
|
+ nature_amount_d62,
|
|
|
+ nature_amount_d63,
|
|
|
+ nature_amount_d64,
|
|
|
+ nature_amount_d65,
|
|
|
+ nature_amount_d66,
|
|
|
+ nature_amount_d67,
|
|
|
+ nature_amount_d68,
|
|
|
+ nature_amount_d69,
|
|
|
+ nature_amount_d70,
|
|
|
+ nature_amount_d71,
|
|
|
+ nature_amount_d72,
|
|
|
+ nature_amount_d73,
|
|
|
+ nature_amount_d74,
|
|
|
+ nature_amount_d75,
|
|
|
+ nature_amount_d76,
|
|
|
+ nature_amount_d77,
|
|
|
+ nature_amount_d78,
|
|
|
+ nature_amount_d79,
|
|
|
+ nature_amount_d80,
|
|
|
+ nature_amount_d81,
|
|
|
+ nature_amount_d82,
|
|
|
+ nature_amount_d83,
|
|
|
+ nature_amount_d84,
|
|
|
+ nature_amount_d85,
|
|
|
+ nature_amount_d86,
|
|
|
+ nature_amount_d87,
|
|
|
+ nature_amount_d88,
|
|
|
+ nature_amount_d89,
|
|
|
+ nature_amount_d90,
|
|
|
+ nature_amount_m4,
|
|
|
+ nature_amount_m5,
|
|
|
nature_amount_m6,
|
|
|
- nature_amount_y1,
|
|
|
+ nature_amount_m7,
|
|
|
+ nature_amount_m8,
|
|
|
+ nature_amount_m9,
|
|
|
+ nature_amount_m10,
|
|
|
+ nature_amount_m11,
|
|
|
+ nature_amount_m12,
|
|
|
nature_amount_sum,
|
|
|
nature_reg_cost,
|
|
|
nature_first_amount_cost as nature_first_new_user_recharge_cost,
|
|
@@ -2098,11 +2228,76 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
amount_d27,
|
|
|
amount_d28,
|
|
|
amount_d29,
|
|
|
- amount_m1,
|
|
|
- amount_m2,
|
|
|
- amount_m3,
|
|
|
+ amount_d30,
|
|
|
+ amount_d31,
|
|
|
+ amount_d32,
|
|
|
+ amount_d33,
|
|
|
+ amount_d34,
|
|
|
+ amount_d35,
|
|
|
+ amount_d36,
|
|
|
+ amount_d37,
|
|
|
+ amount_d38,
|
|
|
+ amount_d39,
|
|
|
+ amount_d40,
|
|
|
+ amount_d41,
|
|
|
+ amount_d42,
|
|
|
+ amount_d43,
|
|
|
+ amount_d44,
|
|
|
+ amount_d45,
|
|
|
+ amount_d46,
|
|
|
+ amount_d47,
|
|
|
+ amount_d48,
|
|
|
+ amount_d49,
|
|
|
+ amount_d50,
|
|
|
+ amount_d51,
|
|
|
+ amount_d52,
|
|
|
+ amount_d53,
|
|
|
+ amount_d54,
|
|
|
+ amount_d55,
|
|
|
+ amount_d56,
|
|
|
+ amount_d57,
|
|
|
+ amount_d58,
|
|
|
+ amount_d59,
|
|
|
+ amount_d60,
|
|
|
+ amount_d61,
|
|
|
+ amount_d62,
|
|
|
+ amount_d63,
|
|
|
+ amount_d64,
|
|
|
+ amount_d65,
|
|
|
+ amount_d66,
|
|
|
+ amount_d67,
|
|
|
+ amount_d68,
|
|
|
+ amount_d69,
|
|
|
+ amount_d70,
|
|
|
+ amount_d71,
|
|
|
+ amount_d72,
|
|
|
+ amount_d73,
|
|
|
+ amount_d74,
|
|
|
+ amount_d75,
|
|
|
+ amount_d76,
|
|
|
+ amount_d77,
|
|
|
+ amount_d78,
|
|
|
+ amount_d79,
|
|
|
+ amount_d80,
|
|
|
+ amount_d81,
|
|
|
+ amount_d82,
|
|
|
+ amount_d83,
|
|
|
+ amount_d84,
|
|
|
+ amount_d85,
|
|
|
+ amount_d86,
|
|
|
+ amount_d87,
|
|
|
+ amount_d88,
|
|
|
+ amount_d89,
|
|
|
+ amount_d90,
|
|
|
+ amount_m4,
|
|
|
+ amount_m5,
|
|
|
amount_m6,
|
|
|
- amount_y1,
|
|
|
+ amount_m7,
|
|
|
+ amount_m8,
|
|
|
+ amount_m9,
|
|
|
+ amount_m10,
|
|
|
+ amount_m11,
|
|
|
+ amount_m12,
|
|
|
amount_sum,
|
|
|
reg_cost,
|
|
|
first_amount_cost as first_new_user_recharge_cost,
|
|
@@ -2132,272 +2327,139 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
private String gameDataDayTotalSql() {
|
|
|
return """
|
|
|
SELECT
|
|
|
- IFNULL(SUM(cost), 0) cost,
|
|
|
-
|
|
|
- IFNULL(SUM(buy_reg_num), 0) buy_reg_num,
|
|
|
- IFNULL(SUM(nature_reg_num), 0) nature_reg_num,
|
|
|
- IFNULL(SUM(reg_num), 0) reg_num,
|
|
|
-
|
|
|
- """
|
|
|
- + amountDay("buy_") +
|
|
|
- """
|
|
|
- CONCAT(
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 29 day) <= LocalDate.now() , CAST(SPLIT_PART(buy_amount_m1 , '/', 1) AS DECIMAL(10, 2)), 0 )), '/',
|
|
|
- SUM(CAST(SPLIT_PART(buy_amount_m1, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(buy_amount_m1, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 29 day) <= LocalDate.now(), cost, 0)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 29 day) <= LocalDate.now(), CAST(SPLIT_PART(buy_amount_d1 , '/', 1) AS DECIMAL(10, 2)) , 0))
|
|
|
- ) AS buy_amount_m1,
|
|
|
- CONCAT(
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 59 day) <= LocalDate.now() , CAST(SPLIT_PART(buy_amount_m2 , '/', 1) AS DECIMAL(10, 2)), 0 )), '/',
|
|
|
- SUM(CAST(SPLIT_PART(buy_amount_m2, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(buy_amount_m2, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 59 day) <= LocalDate.now(), cost, 0)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 59 day) <= LocalDate.now(), CAST(SPLIT_PART(buy_amount_d1 , '/', 1) AS DECIMAL(10, 2)) , 0))
|
|
|
- ) AS buy_amount_m2,
|
|
|
- CONCAT(
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 89 day) <= LocalDate.now() , CAST(SPLIT_PART(buy_amount_m3 , '/', 1) AS DECIMAL(10, 2)), 0 )), '/',
|
|
|
- SUM(CAST(SPLIT_PART(buy_amount_m3, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(buy_amount_m3, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 89 day) <= LocalDate.now(), cost, 0)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 89 day) <= LocalDate.now(), CAST(SPLIT_PART(buy_amount_d1 , '/', 1) AS DECIMAL(10, 2)) , 0))
|
|
|
- ) AS buy_amount_m3,
|
|
|
- CONCAT(
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 179 day) <= LocalDate.now() , CAST(SPLIT_PART(buy_amount_m6 , '/', 1) AS DECIMAL(10, 2)), 0 )), '/',
|
|
|
- SUM(CAST(SPLIT_PART(buy_amount_m6, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(buy_amount_m6, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 179 day) <= LocalDate.now(), cost, 0)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 179 day) <= LocalDate.now(), CAST(SPLIT_PART(buy_amount_d1 , '/', 1) AS DECIMAL(10, 2)) , 0))
|
|
|
- ) AS buy_amount_m6,
|
|
|
- CONCAT(
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 1 year) <= LocalDate.now() , CAST(SPLIT_PART(buy_amount_y1 , '/', 1) AS DECIMAL(10, 2)), 0 )), '/',
|
|
|
- SUM(CAST(SPLIT_PART(buy_amount_y1, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(buy_amount_y1, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 1 year) <= LocalDate.now(), cost, 0)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 1 year) <= LocalDate.now(), CAST(SPLIT_PART(buy_amount_d1 , '/', 1) AS DECIMAL(10, 2)) , 0))
|
|
|
- ) AS buy_amount_y1,
|
|
|
- CONCAT(
|
|
|
- SUM(CAST(SPLIT_PART(buy_amount_sum , '/', 1) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(buy_amount_sum, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(buy_amount_sum, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(cost), '/',
|
|
|
- SUM(CAST(SPLIT_PART(buy_amount_d1 , '/', 1) AS DECIMAL(10, 2)))
|
|
|
- ) AS buy_amount_sum,
|
|
|
- IFNULL(SUM(buy_first_new_user_amount_count), 0) buy_first_new_user_amount_count,
|
|
|
- IFNULL(SUM(buy_first_new_user_amount_num), 0) buy_first_new_user_amount_num,
|
|
|
- IFNULL(SUM(buy_first_new_user_amount), 0) buy_first_new_user_amount,
|
|
|
- IFNULL(SUM(buy_old_user_count), 0) buy_old_user_count,
|
|
|
- IFNULL(SUM(buy_old_user_num), 0) buy_old_user_num,
|
|
|
- IFNULL(SUM(buy_old_user_amount), 0) buy_old_user_amount,
|
|
|
- IFNULL(SUM(buy_amount_count), 0) buy_amount_count,
|
|
|
- IFNULL(SUM(buy_amount_num), 0) buy_amount_num,
|
|
|
- IFNULL(SUM(buy_amount), 0) buy_amount,
|
|
|
- IFNULL(SUM(buy_new_user_total_amount_count), 0) buy_new_user_total_amount_count,
|
|
|
- IFNULL(SUM(buy_new_user_total_amount_num), 0) buy_new_user_total_amount_num,
|
|
|
- IFNULL(SUM(buy_new_user_total_amount), 0) buy_new_user_total_amount,
|
|
|
- round(if(SUM(cost) > 0 , SUM(buy_first_new_user_amount) / SUM(cost) ,0), 4) buy_first_roi,
|
|
|
- round(if(SUM(buy_reg_num) > 0 , SUM(buy_first_new_user_amount_num) / SUM(buy_reg_num) ,0), 4) buy_first_amount_rate,
|
|
|
- round(if(SUM(buy_reg_num) > 0, SUM(buy_new_user_total_amount_num) / SUM(buy_reg_num), 0) ,4) buy_today_amount_rate,
|
|
|
- round(if(SUM(buy_amount_num) > 0 , SUM(buy_first_new_user_amount_num) / SUM(buy_amount_num) ,0), 4) buy_new_user_rate,
|
|
|
- round(if(SUM(buy_first_new_user_amount_count) > 0, SUM(buy_first_new_user_amount) / SUM(buy_first_new_user_amount_count), 0), 2) buy_first_avg_amount,
|
|
|
- round(if(SUM(buy_new_user_total_amount_count) > 0, SUM(buy_new_user_total_amount) / SUM(buy_new_user_total_amount_count), 0), 2) buy_today_avg_amount,
|
|
|
- round(if(SUM(buy_amount_count) > 0, SUM(buy_amount) / SUM(buy_amount_count), 0), 2) buy_avg_amount,
|
|
|
- round(if(SUM(buy_new_user_total_amount_num) > 0, SUM(buy_reg_order_user_again) / SUM(buy_new_user_total_amount_num), 0), 4) buy_user_again_rate,
|
|
|
- round(if(SUM(buy_reg_num) > 0, SUM(buy_new_user_total_amount) / SUM(buy_reg_num), 0), 2) buy_reg_user_arpu,
|
|
|
- round(if(SUM(buy_first_new_user_amount_num) > 0 , SUM(buy_first_new_user_amount) / SUM(buy_first_new_user_amount_num), 0), 2) buy_first_amount_arpu,
|
|
|
- round(if(SUM(buy_new_user_total_amount_num) > 0 , SUM(buy_new_user_total_amount) / SUM(buy_new_user_total_amount_num), 0), 2) buy_today_amount_arpu,
|
|
|
- round(if(SUM(buy_amount_num) > 0, SUM(buy_amount) / SUM(buy_amount_num), 0), 2) buy_amount_arpu,
|
|
|
- round(if(SUM(buy_reg_num) > 0, SUM(cost) / SUM(buy_reg_num), 0), 2) buy_reg_cost,
|
|
|
- round(if(SUM(buy_first_new_user_amount_num) > 0, SUM(cost) / SUM(buy_first_new_user_amount_num), 0), 2) buy_first_new_user_recharge_cost,
|
|
|
- round(if(SUM(buy_new_user_total_amount_num) > 0, SUM(cost) / SUM(buy_new_user_total_amount_num), 0), 2) buy_total_recharge_cost,
|
|
|
- round(if(SUM(cost) > 0, SUM(buy_new_user_total_amount) / SUM(cost), 0), 4) buy_total_roi,
|
|
|
- SUM(buy_hundred_user_num) buy_hundred_user_num,
|
|
|
- round(IF(SUM(buy_hundred_user_num) > 0, SUM(cost) / SUM(buy_hundred_user_num), 0), 2) buy_hundred_user_num_cost,
|
|
|
- SUM(buy_first_role_num) buy_first_role_num,
|
|
|
- SUM(buy_role_num) buy_role_num,
|
|
|
- SUM(buy_new_user_total_role_num) buy_new_user_total_role_num,
|
|
|
- round(IF(SUM(buy_first_role_num) > 0, SUM(cost) / SUM(buy_first_role_num), 0), 2) buy_first_role_num_cost,
|
|
|
- round(IF(SUM(buy_role_num) > 0, SUM(cost) / SUM(buy_role_num), 0), 2) buy_role_num_cost,
|
|
|
- round(IF(SUM(buy_new_user_total_role_num) >0, SUM(cost) / SUM(buy_new_user_total_role_num), 0), 2) buy_new_user_total_role_num_cost,
|
|
|
- round(IF(SUM(buy_reg_num) >0, SUM(buy_first_role_num) / SUM(buy_reg_num), 0), 4) buy_first_role_num_rate,
|
|
|
- round(IF(SUM(buy_reg_num) >0, SUM(buy_role_num) / SUM(buy_reg_num), 0), 4) buy_role_num_rate,
|
|
|
- round(IF(SUM(buy_reg_num) >0, SUM(buy_new_user_total_role_num) / SUM(buy_reg_num), 0), 4) buy_new_user_total_role_num_rate,
|
|
|
-
|
|
|
- """
|
|
|
- + amountDay("nature_") +
|
|
|
- """
|
|
|
- CONCAT(
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 29 day) <= LocalDate.now() , CAST(SPLIT_PART(nature_amount_m1 , '/', 1) AS DECIMAL(10, 2)), 0 )), '/',
|
|
|
- SUM(CAST(SPLIT_PART(nature_amount_m1, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(nature_amount_m1, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 29 day) <= LocalDate.now(), cost, 0)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 29 day) <= LocalDate.now(), CAST(SPLIT_PART(nature_amount_d1 , '/', 1) AS DECIMAL(10, 2)) , 0))
|
|
|
- ) AS nature_amount_m1,
|
|
|
- CONCAT(
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 59 day) <= LocalDate.now() , CAST(SPLIT_PART(nature_amount_m2 , '/', 1) AS DECIMAL(10, 2)), 0 )), '/',
|
|
|
- SUM(CAST(SPLIT_PART(nature_amount_m2, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(nature_amount_m2, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 59 day) <= LocalDate.now(), cost, 0)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 59 day) <= LocalDate.now(), CAST(SPLIT_PART(nature_amount_d1 , '/', 1) AS DECIMAL(10, 2)) , 0))
|
|
|
- ) AS nature_amount_m2,
|
|
|
- CONCAT(
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 89 day) <= LocalDate.now() , CAST(SPLIT_PART(nature_amount_m3 , '/', 1) AS DECIMAL(10, 2)), 0 )), '/',
|
|
|
- SUM(CAST(SPLIT_PART(nature_amount_m3, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(nature_amount_m3, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 89 day) <= LocalDate.now(), cost, 0)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 89 day) <= LocalDate.now(), CAST(SPLIT_PART(nature_amount_d1 , '/', 1) AS DECIMAL(10, 2)) , 0))
|
|
|
- ) AS nature_amount_m3,
|
|
|
- CONCAT(
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 179 day) <= LocalDate.now() , CAST(SPLIT_PART(nature_amount_m6 , '/', 1) AS DECIMAL(10, 2)), 0 )), '/',
|
|
|
- SUM(CAST(SPLIT_PART(nature_amount_m6, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(nature_amount_m6, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 179 day) <= LocalDate.now(), cost, 0)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 179 day) <= LocalDate.now(), CAST(SPLIT_PART(nature_amount_d1 , '/', 1) AS DECIMAL(10, 2)) , 0))
|
|
|
- ) AS nature_amount_m6,
|
|
|
- CONCAT(
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 1 year) <= LocalDate.now() , CAST(SPLIT_PART(nature_amount_y1 , '/', 1) AS DECIMAL(10, 2)), 0 )), '/',
|
|
|
- SUM(CAST(SPLIT_PART(nature_amount_y1, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(nature_amount_y1, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 1 year) <= LocalDate.now(), cost, 0)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 1 year) <= LocalDate.now(), CAST(SPLIT_PART(nature_amount_d1 , '/', 1) AS DECIMAL(10, 2)) , 0))
|
|
|
- ) AS nature_amount_y1,
|
|
|
- CONCAT(
|
|
|
- SUM(CAST(SPLIT_PART(nature_amount_sum , '/', 1) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(nature_amount_sum, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(nature_amount_sum, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(cost), '/',
|
|
|
- SUM(CAST(SPLIT_PART(nature_amount_d1 , '/', 1) AS DECIMAL(10, 2)))
|
|
|
- ) AS nature_amount_sum,
|
|
|
- IFNULL(SUM(nature_first_new_user_amount_count), 0) nature_first_new_user_amount_count,
|
|
|
- IFNULL(SUM(nature_first_new_user_amount_num), 0) nature_first_new_user_amount_num,
|
|
|
- IFNULL(SUM(nature_first_new_user_amount), 0) nature_first_new_user_amount,
|
|
|
- IFNULL(SUM(nature_old_user_count), 0) nature_old_user_count,
|
|
|
- IFNULL(SUM(nature_old_user_num), 0) nature_old_user_num,
|
|
|
- IFNULL(SUM(nature_old_user_amount), 0) nature_old_user_amount,
|
|
|
- IFNULL(SUM(nature_amount_count), 0) nature_amount_count,
|
|
|
- IFNULL(SUM(nature_amount_num), 0) nature_amount_num,
|
|
|
- IFNULL(SUM(nature_amount), 0) nature_amount,
|
|
|
- IFNULL(SUM(nature_new_user_total_amount_count), 0) nature_new_user_total_amount_count,
|
|
|
- IFNULL(SUM(nature_new_user_total_amount_num), 0) nature_new_user_total_amount_num,
|
|
|
- IFNULL(SUM(nature_new_user_total_amount), 0) nature_new_user_total_amount,
|
|
|
- round(if(SUM(cost) > 0 , SUM(nature_first_new_user_amount) / SUM(cost) ,0), 4) nature_first_roi,
|
|
|
- round(if(SUM(nature_reg_num) > 0 , SUM(nature_first_new_user_amount_num) / SUM(nature_reg_num) ,0), 4) nature_first_amount_rate,
|
|
|
- round(if(SUM(nature_reg_num) > 0, SUM(nature_new_user_total_amount_num) / SUM(nature_reg_num), 0) ,4) nature_today_amount_rate,
|
|
|
- round(if(SUM(nature_amount_num) > 0 , SUM(nature_first_new_user_amount_num) / SUM(nature_amount_num) ,0), 4) nature_new_user_rate,
|
|
|
- round(if(SUM(nature_first_new_user_amount_count) > 0, SUM(nature_first_new_user_amount) / SUM(nature_first_new_user_amount_count), 0), 2) nature_first_avg_amount,
|
|
|
- round(if(SUM(nature_new_user_total_amount_count) > 0, SUM(nature_new_user_total_amount) / SUM(nature_new_user_total_amount_count), 0), 2) nature_today_avg_amount,
|
|
|
- round(if(SUM(nature_amount_count) > 0, SUM(nature_amount) / SUM(nature_amount_count), 0), 2) nature_avg_amount,
|
|
|
- round(if(SUM(nature_new_user_total_amount_num) > 0, SUM(nature_reg_order_user_again) / SUM(nature_new_user_total_amount_num), 0), 4) nature_user_again_rate,
|
|
|
- round(if(SUM(nature_reg_num) > 0, SUM(nature_new_user_total_amount) / SUM(nature_reg_num), 0), 2) nature_reg_user_arpu,
|
|
|
- round(if(SUM(nature_first_new_user_amount_num) > 0 , SUM(nature_first_new_user_amount) / SUM(nature_first_new_user_amount_num), 0), 2) nature_first_amount_arpu,
|
|
|
- round(if(SUM(nature_new_user_total_amount_num) > 0 , SUM(nature_new_user_total_amount) / SUM(nature_new_user_total_amount_num), 0), 2) nature_today_amount_arpu,
|
|
|
- round(if(SUM(nature_amount_num) > 0, SUM(nature_amount) / SUM(nature_amount_num), 0), 2) nature_amount_arpu,
|
|
|
- round(if(SUM(nature_reg_num) > 0, SUM(cost) / SUM(nature_reg_num), 0), 2) nature_reg_cost,
|
|
|
- round(if(SUM(nature_first_new_user_amount_num) > 0, SUM(cost) / SUM(nature_first_new_user_amount_num), 0), 2) nature_first_new_user_recharge_cost,
|
|
|
- round(if(SUM(nature_new_user_total_amount_num) > 0, SUM(cost) / SUM(nature_new_user_total_amount_num), 0), 2) nature_total_recharge_cost,
|
|
|
- round(if(SUM(cost) > 0, SUM(nature_new_user_total_amount) / SUM(cost), 0), 4) nature_total_roi,
|
|
|
- SUM(nature_hundred_user_num) nature_hundred_user_num,
|
|
|
- round(IF(SUM(nature_hundred_user_num) > 0, SUM(cost) / SUM(nature_hundred_user_num), 0), 2) nature_hundred_user_num_cost,
|
|
|
- SUM(nature_first_role_num) nature_first_role_num,
|
|
|
- SUM(nature_role_num) nature_role_num,
|
|
|
- SUM(nature_new_user_total_role_num) nature_new_user_total_role_num,
|
|
|
- round(IF(SUM(nature_first_role_num) > 0, SUM(cost) / SUM(nature_first_role_num), 0), 2) nature_first_role_num_cost,
|
|
|
- round(IF(SUM(nature_role_num) > 0, SUM(cost) / SUM(nature_role_num), 0), 2) nature_role_num_cost,
|
|
|
- round(IF(SUM(nature_new_user_total_role_num) >0, SUM(cost) / SUM(nature_new_user_total_role_num), 0), 2) nature_new_user_total_role_num_cost,
|
|
|
- round(IF(SUM(nature_reg_num) >0, SUM(nature_first_role_num) / SUM(nature_reg_num), 0), 4) nature_first_role_num_rate,
|
|
|
- round(IF(SUM(nature_reg_num) >0, SUM(nature_role_num) / SUM(nature_reg_num), 0), 4) nature_role_num_rate,
|
|
|
- round(IF(SUM(nature_reg_num) >0, SUM(nature_new_user_total_role_num) / SUM(nature_reg_num), 0), 4) nature_new_user_total_role_num_rate,
|
|
|
-
|
|
|
- """
|
|
|
- + amountDay("") +
|
|
|
- """
|
|
|
- CONCAT(
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 29 day) <= LocalDate.now() , CAST(SPLIT_PART(amount_m1 , '/', 1) AS DECIMAL(10, 2)), 0 )), '/',
|
|
|
- SUM(CAST(SPLIT_PART(amount_m1, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(amount_m1, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 29 day) <= LocalDate.now(), cost, 0)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 29 day) <= LocalDate.now(), CAST(SPLIT_PART(amount_d1 , '/', 1) AS DECIMAL(10, 2)) , 0))
|
|
|
- ) AS amount_m1,
|
|
|
- CONCAT(
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 59 day) <= LocalDate.now() , CAST(SPLIT_PART(amount_m2 , '/', 1) AS DECIMAL(10, 2)), 0 )), '/',
|
|
|
- SUM(CAST(SPLIT_PART(amount_m2, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(amount_m2, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 59 day) <= LocalDate.now(), cost, 0)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 59 day) <= LocalDate.now(), CAST(SPLIT_PART(amount_d1 , '/', 1) AS DECIMAL(10, 2)) , 0))
|
|
|
- ) AS amount_m2,
|
|
|
- CONCAT(
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 89 day) <= LocalDate.now() , CAST(SPLIT_PART(amount_m3 , '/', 1) AS DECIMAL(10, 2)), 0 )), '/',
|
|
|
- SUM(CAST(SPLIT_PART(amount_m3, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(amount_m3, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 89 day) <= LocalDate.now(), cost, 0)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 89 day) <= LocalDate.now(), CAST(SPLIT_PART(amount_d1 , '/', 1) AS DECIMAL(10, 2)) , 0))
|
|
|
- ) AS amount_m3,
|
|
|
- CONCAT(
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 179 day) <= LocalDate.now() , CAST(SPLIT_PART(amount_m6 , '/', 1) AS DECIMAL(10, 2)), 0 )), '/',
|
|
|
- SUM(CAST(SPLIT_PART(amount_m6, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(amount_m6, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 179 day) <= LocalDate.now(), cost, 0)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 179 day) <= LocalDate.now(), CAST(SPLIT_PART(amount_d1 , '/', 1) AS DECIMAL(10, 2)) , 0))
|
|
|
- ) AS amount_m6,
|
|
|
- CONCAT(
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 1 year) <= LocalDate.now() , CAST(SPLIT_PART(amount_y1 , '/', 1) AS DECIMAL(10, 2)), 0 )), '/',
|
|
|
- SUM(CAST(SPLIT_PART(amount_y1, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(amount_y1, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 1 year) <= LocalDate.now(), cost, 0)), '/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL 1 year) <= LocalDate.now(), CAST(SPLIT_PART(amount_d1 , '/', 1) AS DECIMAL(10, 2)) , 0))
|
|
|
- ) AS amount_y1,
|
|
|
- CONCAT(
|
|
|
- SUM(CAST(SPLIT_PART(amount_sum , '/', 1) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(amount_sum, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(amount_sum, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(cost), '/',
|
|
|
- SUM(CAST(SPLIT_PART(amount_d1 , '/', 1) AS DECIMAL(10, 2)))
|
|
|
- ) AS amount_sum,
|
|
|
- IFNULL(SUM(first_new_user_amount_count), 0) first_new_user_amount_count,
|
|
|
- IFNULL(SUM(first_new_user_amount_num), 0) first_new_user_amount_num,
|
|
|
- IFNULL(SUM(first_new_user_amount), 0) first_new_user_amount,
|
|
|
- IFNULL(SUM(old_user_count), 0) old_user_count,
|
|
|
- IFNULL(SUM(old_user_num), 0) old_user_num,
|
|
|
- IFNULL(SUM(old_user_amount), 0) old_user_amount,
|
|
|
- IFNULL(SUM(amount_count), 0) amount_count,
|
|
|
- IFNULL(SUM(amount_num), 0) amount_num,
|
|
|
- IFNULL(SUM(amount), 0) amount,
|
|
|
- IFNULL(SUM(new_user_total_amount_count), 0) new_user_total_amount_count,
|
|
|
- IFNULL(SUM(new_user_total_amount_num), 0) new_user_total_amount_num,
|
|
|
- IFNULL(SUM(new_user_total_amount), 0) new_user_total_amount,
|
|
|
- round(if(SUM(cost) > 0 , SUM(first_new_user_amount) / SUM(cost) ,0), 4) first_roi,
|
|
|
- round(if(SUM(reg_num) > 0 , SUM(first_new_user_amount_num) / SUM(reg_num) ,0), 4) first_amount_rate,
|
|
|
- round(if(SUM(reg_num) > 0, SUM(new_user_total_amount_num) / SUM(reg_num), 0) ,4) today_amount_rate,
|
|
|
- round(if(SUM(amount_num) > 0 , SUM(first_new_user_amount_num) / SUM(amount_num) ,0), 4) new_user_rate,
|
|
|
- round(if(SUM(first_new_user_amount_count) > 0, SUM(first_new_user_amount) / SUM(first_new_user_amount_count), 0), 2) first_avg_amount,
|
|
|
- round(if(SUM(new_user_total_amount_count) > 0, SUM(new_user_total_amount) / SUM(new_user_total_amount_count), 0), 2) today_avg_amount,
|
|
|
- round(if(SUM(amount_count) > 0, SUM(amount) / SUM(amount_count), 0), 2) avg_amount,
|
|
|
- round(if(SUM(new_user_total_amount_num) > 0, SUM(reg_order_user_again) / SUM(new_user_total_amount_num), 0), 4) user_again_rate,
|
|
|
- round(if(SUM(reg_num) > 0, SUM(new_user_total_amount) / SUM(reg_num), 0), 2) reg_user_arpu,
|
|
|
- round(if(SUM(first_new_user_amount_num) > 0 , SUM(first_new_user_amount) / SUM(first_new_user_amount_num), 0), 2) first_amount_arpu,
|
|
|
- round(if(SUM(new_user_total_amount_num) > 0 , SUM(new_user_total_amount) / SUM(new_user_total_amount_num), 0), 2) today_amount_arpu,
|
|
|
- round(if(SUM(amount_num) > 0, SUM(amount) / SUM(amount_num), 0), 2) amount_arpu,
|
|
|
- round(if(SUM(reg_num) > 0, SUM(cost) / SUM(reg_num), 0), 2) reg_cost,
|
|
|
- round(if(SUM(first_new_user_amount_num) > 0, SUM(cost) / SUM(first_new_user_amount_num), 0), 2) first_new_user_recharge_cost,
|
|
|
- round(if(SUM(new_user_total_amount_num) > 0, SUM(cost) / SUM(new_user_total_amount_num), 0), 2) total_recharge_cost,
|
|
|
- round(if(SUM(cost) > 0, SUM(new_user_total_amount) / SUM(cost), 0), 4) total_roi,
|
|
|
- SUM(hundred_user_num) hundred_user_num,
|
|
|
- round(IF(SUM(hundred_user_num) > 0, SUM(cost) / SUM(hundred_user_num), 0), 2) hundred_user_num_cost,
|
|
|
- SUM(first_role_num) first_role_num,
|
|
|
- SUM(role_num) role_num,
|
|
|
- SUM(new_user_total_role_num) new_user_total_role_num,
|
|
|
- round(IF(SUM(first_role_num) > 0, SUM(cost) / SUM(first_role_num), 0), 2) first_role_num_cost,
|
|
|
- round(IF(SUM(role_num) > 0, SUM(cost) / SUM(role_num), 0), 2) role_num_cost,
|
|
|
- round(IF(SUM(new_user_total_role_num) >0, SUM(cost) / SUM(new_user_total_role_num), 0), 2) new_user_total_role_num_cost,
|
|
|
- round(IF(SUM(reg_num) >0, SUM(first_role_num) / SUM(reg_num), 0), 4) first_role_num_rate,
|
|
|
- round(IF(SUM(reg_num) >0, SUM(role_num) / SUM(reg_num), 0), 4) role_num_rate,
|
|
|
- round(IF(SUM(reg_num) >0, SUM(new_user_total_role_num) / SUM(reg_num), 0), 4) new_user_total_role_num_rate
|
|
|
-
|
|
|
- FROM
|
|
|
- ads_game_day
|
|
|
-
|
|
|
-
|
|
|
- """;
|
|
|
+ IFNULL(SUM(cost), 0) cost,
|
|
|
+ IFNULL(SUM(buy_reg_num), 0) buy_reg_num,
|
|
|
+ IFNULL(SUM(nature_reg_num), 0) nature_reg_num,
|
|
|
+ IFNULL(SUM(reg_num), 0) reg_num,
|
|
|
+ """
|
|
|
+ + amountDay("buy_") +
|
|
|
+ """
|
|
|
+ IFNULL(SUM(buy_first_new_user_amount_count), 0) buy_first_new_user_amount_count,
|
|
|
+ IFNULL(SUM(buy_first_new_user_amount_num), 0) buy_first_new_user_amount_num,
|
|
|
+ IFNULL(SUM(buy_first_new_user_amount), 0) buy_first_new_user_amount,
|
|
|
+ IFNULL(SUM(buy_old_user_count), 0) buy_old_user_count,
|
|
|
+ IFNULL(SUM(buy_old_user_num), 0) buy_old_user_num,
|
|
|
+ IFNULL(SUM(buy_old_user_amount), 0) buy_old_user_amount,
|
|
|
+ IFNULL(SUM(buy_amount_count), 0) buy_amount_count,
|
|
|
+ IFNULL(SUM(buy_amount_num), 0) buy_amount_num,
|
|
|
+ IFNULL(SUM(buy_amount), 0) buy_amount,
|
|
|
+ IFNULL(SUM(buy_new_user_total_amount_count), 0) buy_new_user_total_amount_count,
|
|
|
+ IFNULL(SUM(buy_new_user_total_amount_num), 0) buy_new_user_total_amount_num,
|
|
|
+ IFNULL(SUM(buy_new_user_total_amount), 0) buy_new_user_total_amount,
|
|
|
+ round(if(SUM(cost) > 0 , SUM(buy_first_new_user_amount) / SUM(cost) ,0), 4) buy_first_roi,
|
|
|
+ round(if(SUM(buy_reg_num) > 0 , SUM(buy_first_new_user_amount_num) / SUM(buy_reg_num) ,0), 4) buy_first_amount_rate,
|
|
|
+ round(if(SUM(buy_reg_num) > 0, SUM(buy_new_user_total_amount_num) / SUM(buy_reg_num), 0) ,4) buy_today_amount_rate,
|
|
|
+ round(if(SUM(buy_amount_num) > 0 , SUM(buy_first_new_user_amount_num) / SUM(buy_amount_num) ,0), 4) buy_new_user_rate,
|
|
|
+ round(if(SUM(buy_first_new_user_amount_count) > 0, SUM(buy_first_new_user_amount) / SUM(buy_first_new_user_amount_count), 0), 2) buy_first_avg_amount,
|
|
|
+ round(if(SUM(buy_new_user_total_amount_count) > 0, SUM(buy_new_user_total_amount) / SUM(buy_new_user_total_amount_count), 0), 2) buy_today_avg_amount,
|
|
|
+ round(if(SUM(buy_amount_count) > 0, SUM(buy_amount) / SUM(buy_amount_count), 0), 2) buy_avg_amount,
|
|
|
+ round(if(SUM(buy_new_user_total_amount_num) > 0, SUM(buy_reg_order_user_again) / SUM(buy_new_user_total_amount_num), 0), 4) buy_user_again_rate,
|
|
|
+ round(if(SUM(buy_reg_num) > 0, SUM(buy_new_user_total_amount) / SUM(buy_reg_num), 0), 2) buy_reg_user_arpu,
|
|
|
+ round(if(SUM(buy_first_new_user_amount_num) > 0 , SUM(buy_first_new_user_amount) / SUM(buy_first_new_user_amount_num), 0), 2) buy_first_amount_arpu,
|
|
|
+ round(if(SUM(buy_new_user_total_amount_num) > 0 , SUM(buy_new_user_total_amount) / SUM(buy_new_user_total_amount_num), 0), 2) buy_today_amount_arpu,
|
|
|
+ round(if(SUM(buy_amount_num) > 0, SUM(buy_amount) / SUM(buy_amount_num), 0), 2) buy_amount_arpu,
|
|
|
+ round(if(SUM(buy_reg_num) > 0, SUM(cost) / SUM(buy_reg_num), 0), 2) buy_reg_cost,
|
|
|
+ round(if(SUM(buy_first_new_user_amount_num) > 0, SUM(cost) / SUM(buy_first_new_user_amount_num), 0), 2) buy_first_new_user_recharge_cost,
|
|
|
+ round(if(SUM(buy_new_user_total_amount_num) > 0, SUM(cost) / SUM(buy_new_user_total_amount_num), 0), 2) buy_total_recharge_cost,
|
|
|
+ round(if(SUM(cost) > 0, SUM(buy_new_user_total_amount) / SUM(cost), 0), 4) buy_total_roi,
|
|
|
+ SUM(buy_hundred_user_num) buy_hundred_user_num,
|
|
|
+ round(IF(SUM(buy_hundred_user_num) > 0, SUM(cost) / SUM(buy_hundred_user_num), 0), 2) buy_hundred_user_num_cost,
|
|
|
+ SUM(buy_first_role_num) buy_first_role_num,
|
|
|
+ SUM(buy_role_num) buy_role_num,
|
|
|
+ SUM(buy_new_user_total_role_num) buy_new_user_total_role_num,
|
|
|
+ round(IF(SUM(buy_first_role_num) > 0, SUM(cost) / SUM(buy_first_role_num), 0), 2) buy_first_role_num_cost,
|
|
|
+ round(IF(SUM(buy_role_num) > 0, SUM(cost) / SUM(buy_role_num), 0), 2) buy_role_num_cost,
|
|
|
+ round(IF(SUM(buy_new_user_total_role_num) >0, SUM(cost) / SUM(buy_new_user_total_role_num), 0), 2) buy_new_user_total_role_num_cost,
|
|
|
+ round(IF(SUM(buy_reg_num) >0, SUM(buy_first_role_num) / SUM(buy_reg_num), 0), 4) buy_first_role_num_rate,
|
|
|
+ round(IF(SUM(buy_reg_num) >0, SUM(buy_role_num) / SUM(buy_reg_num), 0), 4) buy_role_num_rate,
|
|
|
+ round(IF(SUM(buy_reg_num) >0, SUM(buy_new_user_total_role_num) / SUM(buy_reg_num), 0), 4) buy_new_user_total_role_num_rate,
|
|
|
+ """
|
|
|
+ + amountDay("nature_") +
|
|
|
+ """
|
|
|
+ IFNULL(SUM(nature_first_new_user_amount_count), 0) nature_first_new_user_amount_count,
|
|
|
+ IFNULL(SUM(nature_first_new_user_amount_num), 0) nature_first_new_user_amount_num,
|
|
|
+ IFNULL(SUM(nature_first_new_user_amount), 0) nature_first_new_user_amount,
|
|
|
+ IFNULL(SUM(nature_old_user_count), 0) nature_old_user_count,
|
|
|
+ IFNULL(SUM(nature_old_user_num), 0) nature_old_user_num,
|
|
|
+ IFNULL(SUM(nature_old_user_amount), 0) nature_old_user_amount,
|
|
|
+ IFNULL(SUM(nature_amount_count), 0) nature_amount_count,
|
|
|
+ IFNULL(SUM(nature_amount_num), 0) nature_amount_num,
|
|
|
+ IFNULL(SUM(nature_amount), 0) nature_amount,
|
|
|
+ IFNULL(SUM(nature_new_user_total_amount_count), 0) nature_new_user_total_amount_count,
|
|
|
+ IFNULL(SUM(nature_new_user_total_amount_num), 0) nature_new_user_total_amount_num,
|
|
|
+ IFNULL(SUM(nature_new_user_total_amount), 0) nature_new_user_total_amount,
|
|
|
+ round(if(SUM(cost) > 0 , SUM(nature_first_new_user_amount) / SUM(cost) ,0), 4) nature_first_roi,
|
|
|
+ round(if(SUM(nature_reg_num) > 0 , SUM(nature_first_new_user_amount_num) / SUM(nature_reg_num) ,0), 4) nature_first_amount_rate,
|
|
|
+ round(if(SUM(nature_reg_num) > 0, SUM(nature_new_user_total_amount_num) / SUM(nature_reg_num), 0) ,4) nature_today_amount_rate,
|
|
|
+ round(if(SUM(nature_amount_num) > 0 , SUM(nature_first_new_user_amount_num) / SUM(nature_amount_num) ,0), 4) nature_new_user_rate,
|
|
|
+ round(if(SUM(nature_first_new_user_amount_count) > 0, SUM(nature_first_new_user_amount) / SUM(nature_first_new_user_amount_count), 0), 2) nature_first_avg_amount,
|
|
|
+ round(if(SUM(nature_new_user_total_amount_count) > 0, SUM(nature_new_user_total_amount) / SUM(nature_new_user_total_amount_count), 0), 2) nature_today_avg_amount,
|
|
|
+ round(if(SUM(nature_amount_count) > 0, SUM(nature_amount) / SUM(nature_amount_count), 0), 2) nature_avg_amount,
|
|
|
+ round(if(SUM(nature_new_user_total_amount_num) > 0, SUM(nature_reg_order_user_again) / SUM(nature_new_user_total_amount_num), 0), 4) nature_user_again_rate,
|
|
|
+ round(if(SUM(nature_reg_num) > 0, SUM(nature_new_user_total_amount) / SUM(nature_reg_num), 0), 2) nature_reg_user_arpu,
|
|
|
+ round(if(SUM(nature_first_new_user_amount_num) > 0 , SUM(nature_first_new_user_amount) / SUM(nature_first_new_user_amount_num), 0), 2) nature_first_amount_arpu,
|
|
|
+ round(if(SUM(nature_new_user_total_amount_num) > 0 , SUM(nature_new_user_total_amount) / SUM(nature_new_user_total_amount_num), 0), 2) nature_today_amount_arpu,
|
|
|
+ round(if(SUM(nature_amount_num) > 0, SUM(nature_amount) / SUM(nature_amount_num), 0), 2) nature_amount_arpu,
|
|
|
+ round(if(SUM(nature_reg_num) > 0, SUM(cost) / SUM(nature_reg_num), 0), 2) nature_reg_cost,
|
|
|
+ round(if(SUM(nature_first_new_user_amount_num) > 0, SUM(cost) / SUM(nature_first_new_user_amount_num), 0), 2) nature_first_new_user_recharge_cost,
|
|
|
+ round(if(SUM(nature_new_user_total_amount_num) > 0, SUM(cost) / SUM(nature_new_user_total_amount_num), 0), 2) nature_total_recharge_cost,
|
|
|
+ round(if(SUM(cost) > 0, SUM(nature_new_user_total_amount) / SUM(cost), 0), 4) nature_total_roi,
|
|
|
+ SUM(nature_hundred_user_num) nature_hundred_user_num,
|
|
|
+ round(IF(SUM(nature_hundred_user_num) > 0, SUM(cost) / SUM(nature_hundred_user_num), 0), 2) nature_hundred_user_num_cost,
|
|
|
+ SUM(nature_first_role_num) nature_first_role_num,
|
|
|
+ SUM(nature_role_num) nature_role_num,
|
|
|
+ SUM(nature_new_user_total_role_num) nature_new_user_total_role_num,
|
|
|
+ round(IF(SUM(nature_first_role_num) > 0, SUM(cost) / SUM(nature_first_role_num), 0), 2) nature_first_role_num_cost,
|
|
|
+ round(IF(SUM(nature_role_num) > 0, SUM(cost) / SUM(nature_role_num), 0), 2) nature_role_num_cost,
|
|
|
+ round(IF(SUM(nature_new_user_total_role_num) >0, SUM(cost) / SUM(nature_new_user_total_role_num), 0), 2) nature_new_user_total_role_num_cost,
|
|
|
+ round(IF(SUM(nature_reg_num) >0, SUM(nature_first_role_num) / SUM(nature_reg_num), 0), 4) nature_first_role_num_rate,
|
|
|
+ round(IF(SUM(nature_reg_num) >0, SUM(nature_role_num) / SUM(nature_reg_num), 0), 4) nature_role_num_rate,
|
|
|
+ round(IF(SUM(nature_reg_num) >0, SUM(nature_new_user_total_role_num) / SUM(nature_reg_num), 0), 4) nature_new_user_total_role_num_rate,
|
|
|
+ """
|
|
|
+ + amountDay("") +
|
|
|
+ """
|
|
|
+ IFNULL(SUM(first_new_user_amount_count), 0) first_new_user_amount_count,
|
|
|
+ IFNULL(SUM(first_new_user_amount_num), 0) first_new_user_amount_num,
|
|
|
+ IFNULL(SUM(first_new_user_amount), 0) first_new_user_amount,
|
|
|
+ IFNULL(SUM(old_user_count), 0) old_user_count,
|
|
|
+ IFNULL(SUM(old_user_num), 0) old_user_num,
|
|
|
+ IFNULL(SUM(old_user_amount), 0) old_user_amount,
|
|
|
+ IFNULL(SUM(amount_count), 0) amount_count,
|
|
|
+ IFNULL(SUM(amount_num), 0) amount_num,
|
|
|
+ IFNULL(SUM(amount), 0) amount,
|
|
|
+ IFNULL(SUM(new_user_total_amount_count), 0) new_user_total_amount_count,
|
|
|
+ IFNULL(SUM(new_user_total_amount_num), 0) new_user_total_amount_num,
|
|
|
+ IFNULL(SUM(new_user_total_amount), 0) new_user_total_amount,
|
|
|
+ round(if(SUM(cost) > 0 , SUM(first_new_user_amount) / SUM(cost) ,0), 4) first_roi,
|
|
|
+ round(if(SUM(reg_num) > 0 , SUM(first_new_user_amount_num) / SUM(reg_num) ,0), 4) first_amount_rate,
|
|
|
+ round(if(SUM(reg_num) > 0, SUM(new_user_total_amount_num) / SUM(reg_num), 0) ,4) today_amount_rate,
|
|
|
+ round(if(SUM(amount_num) > 0 , SUM(first_new_user_amount_num) / SUM(amount_num) ,0), 4) new_user_rate,
|
|
|
+ round(if(SUM(first_new_user_amount_count) > 0, SUM(first_new_user_amount) / SUM(first_new_user_amount_count), 0), 2) first_avg_amount,
|
|
|
+ round(if(SUM(new_user_total_amount_count) > 0, SUM(new_user_total_amount) / SUM(new_user_total_amount_count), 0), 2) today_avg_amount,
|
|
|
+ round(if(SUM(amount_count) > 0, SUM(amount) / SUM(amount_count), 0), 2) avg_amount,
|
|
|
+ round(if(SUM(new_user_total_amount_num) > 0, SUM(reg_order_user_again) / SUM(new_user_total_amount_num), 0), 4) user_again_rate,
|
|
|
+ round(if(SUM(reg_num) > 0, SUM(new_user_total_amount) / SUM(reg_num), 0), 2) reg_user_arpu,
|
|
|
+ round(if(SUM(first_new_user_amount_num) > 0 , SUM(first_new_user_amount) / SUM(first_new_user_amount_num), 0), 2) first_amount_arpu,
|
|
|
+ round(if(SUM(new_user_total_amount_num) > 0 , SUM(new_user_total_amount) / SUM(new_user_total_amount_num), 0), 2) today_amount_arpu,
|
|
|
+ round(if(SUM(amount_num) > 0, SUM(amount) / SUM(amount_num), 0), 2) amount_arpu,
|
|
|
+ round(if(SUM(reg_num) > 0, SUM(cost) / SUM(reg_num), 0), 2) reg_cost,
|
|
|
+ round(if(SUM(first_new_user_amount_num) > 0, SUM(cost) / SUM(first_new_user_amount_num), 0), 2) first_new_user_recharge_cost,
|
|
|
+ round(if(SUM(new_user_total_amount_num) > 0, SUM(cost) / SUM(new_user_total_amount_num), 0), 2) total_recharge_cost,
|
|
|
+ round(if(SUM(cost) > 0, SUM(new_user_total_amount) / SUM(cost), 0), 4) total_roi,
|
|
|
+ SUM(hundred_user_num) hundred_user_num,
|
|
|
+ round(IF(SUM(hundred_user_num) > 0, SUM(cost) / SUM(hundred_user_num), 0), 2) hundred_user_num_cost,
|
|
|
+ SUM(first_role_num) first_role_num,
|
|
|
+ SUM(role_num) role_num,
|
|
|
+ SUM(new_user_total_role_num) new_user_total_role_num,
|
|
|
+ round(IF(SUM(first_role_num) > 0, SUM(cost) / SUM(first_role_num), 0), 2) first_role_num_cost,
|
|
|
+ round(IF(SUM(role_num) > 0, SUM(cost) / SUM(role_num), 0), 2) role_num_cost,
|
|
|
+ round(IF(SUM(new_user_total_role_num) >0, SUM(cost) / SUM(new_user_total_role_num), 0), 2) new_user_total_role_num_cost,
|
|
|
+ round(IF(SUM(reg_num) >0, SUM(first_role_num) / SUM(reg_num), 0), 4) first_role_num_rate,
|
|
|
+ round(IF(SUM(reg_num) >0, SUM(role_num) / SUM(reg_num), 0), 4) role_num_rate,
|
|
|
+ round(IF(SUM(reg_num) >0, SUM(new_user_total_role_num) / SUM(reg_num), 0), 4) new_user_total_role_num_rate
|
|
|
+ FROM
|
|
|
+ ads_game_day
|
|
|
+ """;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -2406,20 +2468,79 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
* @param type 输入的参数表示选择表的类型
|
|
|
* @return String : Dn的充值金额 / D1-Dn的充值总金额 / Dn的充值人数 /当前消耗(剔除不存在的天数数据) /D1充值金额总和(剔除不存在的天数数据)/type
|
|
|
*/
|
|
|
+ /*private String amountDay(String type) {
|
|
|
+ //拼接查询条件
|
|
|
+ StringBuilder trendDay = new StringBuilder(StringUtils.EMPTY);
|
|
|
+ for (int day = 1; day <= 90; day++) {
|
|
|
+ trendDay.append("""
|
|
|
+ CONCAT(
|
|
|
+ SUM(IF( DATE_ADD(dt, INTERVAL %s day) <= LocalDate.now() , CAST(SPLIT_PART(%samount_d%s , '/', 1) AS DECIMAL(10, 2)), 0 )),'/',
|
|
|
+ SUM(CAST(SPLIT_PART( %samount_d%s, '/', 6) AS DECIMAL(10, 2))),'/',
|
|
|
+ SUM(CAST(SPLIT_PART(%samount_d%s, '/', 2) AS BIGINT)),'/',
|
|
|
+ SUM(IF( DATE_ADD(dt, INTERVAL %s day) <= LocalDate.now(), cost, 0)),'/',
|
|
|
+ SUM(IF( DATE_ADD(dt, INTERVAL %s day) <= LocalDate.now(), CAST(SPLIT_PART(%samount_d1 , '/', 1) AS DECIMAL(10, 2)) , 0))
|
|
|
+ ) AS %samount_d%s ,
|
|
|
+ """.formatted(day - 1, type, day, type, day, type, day, day - 1, day - 1, type, type, day));
|
|
|
+ }
|
|
|
+ for (int month = 4; month <= 12; month++) {
|
|
|
+ trendDay.append("""
|
|
|
+ CONCAT(
|
|
|
+ SUM(IF( DATE_ADD(dt, INTERVAL %s month) <= LocalDate.now() , CAST(SPLIT_PART(%samount_m%s , '/', 1) AS DECIMAL(10, 2)), 0 )),'/',
|
|
|
+ SUM(CAST(SPLIT_PART(%samount_m%s, '/', 6) AS DECIMAL(10, 2))),'/',
|
|
|
+ SUM(CAST(SPLIT_PART(%samount_m%s, '/', 2) AS BIGINT)),'/',
|
|
|
+ SUM(IF( DATE_ADD(dt, INTERVAL %s month) <= LocalDate.now(), cost, 0)),'/',
|
|
|
+ SUM(IF( DATE_ADD(dt, INTERVAL %s month) <= LocalDate.now(), CAST(SPLIT_PART(%samount_d1 , '/', 1) AS DECIMAL(10, 2)) , 0))
|
|
|
+ ) AS %samount_m%s ,
|
|
|
+ """.formatted(month, type, month, type, month, type, month, month, month, type, type, month));
|
|
|
+ }
|
|
|
+ //拼接sum数据
|
|
|
+ trendDay.append("""
|
|
|
+ CONCAT(
|
|
|
+ SUM(CAST(SPLIT_PART(%samount_sum , '/', 1) AS DECIMAL(10, 2))), '/',
|
|
|
+ SUM(CAST(SPLIT_PART(%samount_sum, '/', 6) AS DECIMAL(10, 2))), '/',
|
|
|
+ SUM(CAST(SPLIT_PART(%samount_sum, '/', 2) AS BIGINT)), '/',
|
|
|
+ SUM(cost), '/',
|
|
|
+ SUM(CAST(SPLIT_PART(%samount_d1 , '/', 1) AS DECIMAL(10, 2)))
|
|
|
+ ) AS %samount_sum ,
|
|
|
+ """.formatted(type, type, type, type, type));
|
|
|
+
|
|
|
+ return trendDay.toString();
|
|
|
+ }*/
|
|
|
private String amountDay(String type) {
|
|
|
//拼接查询条件
|
|
|
StringBuilder trendDay = new StringBuilder(StringUtils.EMPTY);
|
|
|
- for (int day = 1; day <= 29; day++) {
|
|
|
+ for (int day = 1; day <= 90; day++) {
|
|
|
trendDay.append("""
|
|
|
CONCAT(
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL %s day) <= LocalDate.now() , CAST(SPLIT_PART(%samount_d%s , '/', 1) AS DECIMAL(10, 2)), 0 )),'/',
|
|
|
- SUM(CAST(SPLIT_PART( %samount_d%s, '/', 6) AS DECIMAL(10, 2))),'/',
|
|
|
- SUM(CAST(SPLIT_PART(%samount_d%s, '/', 2) AS BIGINT)),'/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL %s day) <= LocalDate.now(), cost, 0)),'/',
|
|
|
- SUM(IF( DATE_ADD(dt, INTERVAL %s day) <= LocalDate.now(), CAST(SPLIT_PART(%samount_d1 , '/', 1) AS DECIMAL(10, 2)) , 0))
|
|
|
+ SUM(IF(DATE_ADD(dt, INTERVAL %s day) <= DATE(NOW()), SPLIT_PART(%samount_d%s , '/', 1), 0 )),'/',
|
|
|
+ SUM(SPLIT_PART(%samount_d%s, '/', 6)),'/',
|
|
|
+ SUM(SPLIT_PART(%samount_d%s, '/', 2)),'/',
|
|
|
+ SUM(IF(DATE_ADD(dt, INTERVAL %s day) <= DATE(NOW()), cost, 0)),'/',
|
|
|
+ SUM(IF(DATE_ADD(dt, INTERVAL %s day) <= DATE(NOW()), SPLIT_PART(%samount_d1 , '/', 1), 0))
|
|
|
) AS %samount_d%s ,
|
|
|
- """.formatted(day - 1, type, day, type, day, type, day, day - 1, day - 1, type, type, day));
|
|
|
+ """.formatted(day - 1, type, day, type, day, type, day, day - 1, day - 1, type, type, day));
|
|
|
}
|
|
|
+ for (int month = 4; month <= 12; month++) {
|
|
|
+ trendDay.append("""
|
|
|
+ CONCAT(
|
|
|
+ SUM(IF(DATE_ADD(dt, INTERVAL %s month) <= DATE(NOW()), SPLIT_PART(%samount_m%s , '/', 1), 0 )),'/',
|
|
|
+ SUM(SPLIT_PART(%samount_m%s, '/', 6)),'/',
|
|
|
+ SUM(SPLIT_PART(%samount_m%s, '/', 2)),'/',
|
|
|
+ SUM(IF(DATE_ADD(dt, INTERVAL %s month) <= DATE(NOW()), cost, 0)),'/',
|
|
|
+ SUM(IF(DATE_ADD(dt, INTERVAL %s month) <= DATE(NOW()), SPLIT_PART(%samount_d1 , '/', 1), 0))
|
|
|
+ ) AS %samount_m%s ,
|
|
|
+ """.formatted(month, type, month, type, month, type, month, month, month, type, type, month));
|
|
|
+ }
|
|
|
+ //拼接sum数据
|
|
|
+ trendDay.append("""
|
|
|
+ CONCAT(
|
|
|
+ SUM(SPLIT_PART(%samount_sum, '/', 1)), '/',
|
|
|
+ SUM(SPLIT_PART(%samount_sum, '/', 6)), '/',
|
|
|
+ SUM(SPLIT_PART(%samount_sum, '/', 2)), '/',
|
|
|
+ SUM(cost), '/',
|
|
|
+ SUM(SPLIT_PART(%samount_d1, '/', 1))
|
|
|
+ ) AS %samount_sum ,
|
|
|
+ """.formatted(type, type, type, type, type));
|
|
|
|
|
|
return trendDay.toString();
|
|
|
}
|
|
@@ -4991,8 +5112,66 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
buy_da28 as da28,
|
|
|
buy_da29 as da29,
|
|
|
buy_da30 as da30,
|
|
|
- buy_m2 as m2,
|
|
|
- buy_m3 as m3,
|
|
|
+ buy_da31 as da31,
|
|
|
+ buy_da32 as da32,
|
|
|
+ buy_da33 as da33,
|
|
|
+ buy_da34 as da34,
|
|
|
+ buy_da35 as da35,
|
|
|
+ buy_da36 as da36,
|
|
|
+ buy_da37 as da37,
|
|
|
+ buy_da38 as da38,
|
|
|
+ buy_da39 as da39,
|
|
|
+ buy_da40 as da40,
|
|
|
+ buy_da41 as da41,
|
|
|
+ buy_da42 as da42,
|
|
|
+ buy_da43 as da43,
|
|
|
+ buy_da44 as da44,
|
|
|
+ buy_da45 as da45,
|
|
|
+ buy_da46 as da46,
|
|
|
+ buy_da47 as da47,
|
|
|
+ buy_da48 as da48,
|
|
|
+ buy_da49 as da49,
|
|
|
+ buy_da50 as da50,
|
|
|
+ buy_da51 as da51,
|
|
|
+ buy_da52 as da52,
|
|
|
+ buy_da53 as da53,
|
|
|
+ buy_da54 as da54,
|
|
|
+ buy_da55 as da55,
|
|
|
+ buy_da56 as da56,
|
|
|
+ buy_da57 as da57,
|
|
|
+ buy_da58 as da58,
|
|
|
+ buy_da59 as da59,
|
|
|
+ buy_da60 as da60,
|
|
|
+ buy_da61 as da61,
|
|
|
+ buy_da62 as da62,
|
|
|
+ buy_da63 as da63,
|
|
|
+ buy_da64 as da64,
|
|
|
+ buy_da65 as da65,
|
|
|
+ buy_da66 as da66,
|
|
|
+ buy_da67 as da67,
|
|
|
+ buy_da68 as da68,
|
|
|
+ buy_da69 as da69,
|
|
|
+ buy_da70 as da70,
|
|
|
+ buy_da71 as da71,
|
|
|
+ buy_da72 as da72,
|
|
|
+ buy_da73 as da73,
|
|
|
+ buy_da74 as da74,
|
|
|
+ buy_da75 as da75,
|
|
|
+ buy_da76 as da76,
|
|
|
+ buy_da77 as da77,
|
|
|
+ buy_da78 as da78,
|
|
|
+ buy_da79 as da79,
|
|
|
+ buy_da80 as da80,
|
|
|
+ buy_da81 as da81,
|
|
|
+ buy_da82 as da82,
|
|
|
+ buy_da83 as da83,
|
|
|
+ buy_da84 as da84,
|
|
|
+ buy_da85 as da85,
|
|
|
+ buy_da86 as da86,
|
|
|
+ buy_da87 as da87,
|
|
|
+ buy_da88 as da88,
|
|
|
+ buy_da89 as da89,
|
|
|
+ buy_da90 as da90,
|
|
|
buy_m4 as m4,
|
|
|
buy_m5 as m5,
|
|
|
buy_m6 as m6,
|
|
@@ -5001,7 +5180,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
buy_m9 as m9,
|
|
|
buy_m10 as m10,
|
|
|
buy_m11 as m11,
|
|
|
- buy_y1 as y1,
|
|
|
+ buy_m12 as m12,
|
|
|
buy_total as total
|
|
|
FROM
|
|
|
ads_game_first_new_user_again_day
|
|
@@ -5103,8 +5282,66 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
nature_da28 as da28,
|
|
|
nature_da29 as da29,
|
|
|
nature_da30 as da30,
|
|
|
- nature_m2 as m2,
|
|
|
- nature_m3 as m3,
|
|
|
+ nature_da31 as da31,
|
|
|
+ nature_da32 as da32,
|
|
|
+ nature_da33 as da33,
|
|
|
+ nature_da34 as da34,
|
|
|
+ nature_da35 as da35,
|
|
|
+ nature_da36 as da36,
|
|
|
+ nature_da37 as da37,
|
|
|
+ nature_da38 as da38,
|
|
|
+ nature_da39 as da39,
|
|
|
+ nature_da40 as da40,
|
|
|
+ nature_da41 as da41,
|
|
|
+ nature_da42 as da42,
|
|
|
+ nature_da43 as da43,
|
|
|
+ nature_da44 as da44,
|
|
|
+ nature_da45 as da45,
|
|
|
+ nature_da46 as da46,
|
|
|
+ nature_da47 as da47,
|
|
|
+ nature_da48 as da48,
|
|
|
+ nature_da49 as da49,
|
|
|
+ nature_da50 as da50,
|
|
|
+ nature_da51 as da51,
|
|
|
+ nature_da52 as da52,
|
|
|
+ nature_da53 as da53,
|
|
|
+ nature_da54 as da54,
|
|
|
+ nature_da55 as da55,
|
|
|
+ nature_da56 as da56,
|
|
|
+ nature_da57 as da57,
|
|
|
+ nature_da58 as da58,
|
|
|
+ nature_da59 as da59,
|
|
|
+ nature_da60 as da60,
|
|
|
+ nature_da61 as da61,
|
|
|
+ nature_da62 as da62,
|
|
|
+ nature_da63 as da63,
|
|
|
+ nature_da64 as da64,
|
|
|
+ nature_da65 as da65,
|
|
|
+ nature_da66 as da66,
|
|
|
+ nature_da67 as da67,
|
|
|
+ nature_da68 as da68,
|
|
|
+ nature_da69 as da69,
|
|
|
+ nature_da70 as da70,
|
|
|
+ nature_da71 as da71,
|
|
|
+ nature_da72 as da72,
|
|
|
+ nature_da73 as da73,
|
|
|
+ nature_da74 as da74,
|
|
|
+ nature_da75 as da75,
|
|
|
+ nature_da76 as da76,
|
|
|
+ nature_da77 as da77,
|
|
|
+ nature_da78 as da78,
|
|
|
+ nature_da79 as da79,
|
|
|
+ nature_da80 as da80,
|
|
|
+ nature_da81 as da81,
|
|
|
+ nature_da82 as da82,
|
|
|
+ nature_da83 as da83,
|
|
|
+ nature_da84 as da84,
|
|
|
+ nature_da85 as da85,
|
|
|
+ nature_da86 as da86,
|
|
|
+ nature_da87 as da87,
|
|
|
+ nature_da88 as da88,
|
|
|
+ nature_da89 as da89,
|
|
|
+ nature_da90 as da90,
|
|
|
nature_m4 as m4,
|
|
|
nature_m5 as m5,
|
|
|
nature_m6 as m6,
|
|
@@ -5113,7 +5350,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
nature_m9 as m9,
|
|
|
nature_m10 as m10,
|
|
|
nature_m11 as m11,
|
|
|
- nature_y1 as y1,
|
|
|
+ nature_m12 as m12,
|
|
|
nature_total as total
|
|
|
FROM
|
|
|
ads_game_first_new_user_again_day
|
|
@@ -5216,8 +5453,66 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
da28,
|
|
|
da29,
|
|
|
da30,
|
|
|
- m2,
|
|
|
- m3,
|
|
|
+ da31,
|
|
|
+ da32,
|
|
|
+ da33,
|
|
|
+ da34,
|
|
|
+ da35,
|
|
|
+ da36,
|
|
|
+ da37,
|
|
|
+ da38,
|
|
|
+ da39,
|
|
|
+ da40,
|
|
|
+ da41,
|
|
|
+ da42,
|
|
|
+ da43,
|
|
|
+ da44,
|
|
|
+ da45,
|
|
|
+ da46,
|
|
|
+ da47,
|
|
|
+ da48,
|
|
|
+ da49,
|
|
|
+ da50,
|
|
|
+ da51,
|
|
|
+ da52,
|
|
|
+ da53,
|
|
|
+ da54,
|
|
|
+ da55,
|
|
|
+ da56,
|
|
|
+ da57,
|
|
|
+ da58,
|
|
|
+ da59,
|
|
|
+ da60,
|
|
|
+ da61,
|
|
|
+ da62,
|
|
|
+ da63,
|
|
|
+ da64,
|
|
|
+ da65,
|
|
|
+ da66,
|
|
|
+ da67,
|
|
|
+ da68,
|
|
|
+ da69,
|
|
|
+ da70,
|
|
|
+ da71,
|
|
|
+ da72,
|
|
|
+ da73,
|
|
|
+ da74,
|
|
|
+ da75,
|
|
|
+ da76,
|
|
|
+ da77,
|
|
|
+ da78,
|
|
|
+ da79,
|
|
|
+ da80,
|
|
|
+ da81,
|
|
|
+ da82,
|
|
|
+ da83,
|
|
|
+ da84,
|
|
|
+ da85,
|
|
|
+ da86,
|
|
|
+ da87,
|
|
|
+ da88,
|
|
|
+ da89,
|
|
|
+ da90,
|
|
|
m4,
|
|
|
m5,
|
|
|
m6,
|
|
@@ -5226,7 +5521,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
m9,
|
|
|
m10,
|
|
|
m11,
|
|
|
- y1,
|
|
|
+ m12,
|
|
|
total
|
|
|
FROM
|
|
|
ads_game_first_new_user_again_day
|
|
@@ -5256,7 +5551,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
StringBuilder trendDay = new StringBuilder(StringUtils.EMPTY);
|
|
|
trendDay.append("SELECT ");
|
|
|
//30天数据
|
|
|
- for (int day = 1; day <= 30; day++) {
|
|
|
+ for (int day = 1; day <= 90; day++) {
|
|
|
trendDay.append("""
|
|
|
CONCAT( SUM(CAST(SPLIT_PART(%sda%s, '/', 1) AS DECIMAL(10, 2))), '/',
|
|
|
SUM(CAST(SPLIT_PART(%sda%s, '/', 2) AS BIGINT)), '/',
|
|
@@ -5265,7 +5560,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
""".formatted(type, day, type, day, day-1, type, day));
|
|
|
}
|
|
|
//m2-m11数据
|
|
|
- for (int month = 2; month <= 11; month++) {
|
|
|
+ for (int month = 4; month <= 12; month++) {
|
|
|
trendDay.append("""
|
|
|
CONCAT( SUM(CAST(SPLIT_PART(%sm%s, '/', 1) AS DECIMAL(10, 2))), '/',
|
|
|
SUM(CAST(SPLIT_PART(%sm%s, '/', 2) AS BIGINT)), '/',
|
|
@@ -5273,13 +5568,6 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
) AS m%s,
|
|
|
""".formatted(type, month, type, month, month, type, month));
|
|
|
}
|
|
|
- //y1数据
|
|
|
- trendDay.append("""
|
|
|
- CONCAT( SUM(CAST(SPLIT_PART(%sy1, '/', 1) AS DECIMAL(10, 2))), '/',
|
|
|
- SUM(CAST(SPLIT_PART(%sy1, '/', 2) AS BIGINT)), '/',
|
|
|
- SUM(IF(DATE_ADD(dt, INTERVAL 1 year) <= Local.now(), CAST(SPLIT_PART(%sda1, '/', 2) AS BIGINT), 0))
|
|
|
- ) AS y1,
|
|
|
- """.formatted(type, type, type));
|
|
|
//total数据
|
|
|
trendDay.append("""
|
|
|
CONCAT( SUM(CAST(SPLIT_PART(%stotal, '/', 1) AS DECIMAL(10, 2))), '/',
|