|
@@ -77,8 +77,6 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
|
|
|
@Override
|
|
|
public Page<GameDataTotalVO> getGameDataTotal(GameDataTotalDTO dto) {
|
|
|
-
|
|
|
- Boolean hasRechargeDate = true;
|
|
|
|
|
|
if (dto.getRegisteredBeginDate() == null || dto.getRechargeEndDate() == null) {
|
|
|
dto.setRegisteredBeginDate(LocalDate.now());
|
|
@@ -86,10 +84,8 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
}
|
|
|
|
|
|
if (dto.getRechargeBeginDate() == null || dto.getRechargeEndDate() == null) {
|
|
|
-
|
|
|
- hasRechargeDate = false;
|
|
|
- dto.setRechargeBeginDate(dto.getRegisteredBeginDate());
|
|
|
- dto.setRechargeEndDate(dto.getRegisteredEndDate());
|
|
|
+ dto.setRechargeBeginDate(LocalDate.now());
|
|
|
+ dto.setRechargeEndDate(LocalDate.now());
|
|
|
}
|
|
|
|
|
|
Criteria cri = Cnd.cri();
|
|
@@ -106,7 +102,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
cri.where().andBetween("a.dt", dto.getRegisteredBeginDate(), dto.getRegisteredEndDate());
|
|
|
}
|
|
|
|
|
|
- cri.getGroupBy().groupBy("a.game_name");
|
|
|
+ cri.getGroupBy().groupBy("a.game_name", "a.game_id", "a.game_classify");
|
|
|
|
|
|
Sql sql = Sqls.create(gameDataTotalSql() + cri);
|
|
|
|
|
@@ -124,10 +120,28 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
List<GameDataTotalVO> list = sql.getList(GameDataTotalVO.class);
|
|
|
|
|
|
pager.setRecordCount(list.size());
|
|
|
-
|
|
|
- if (hasRechargeDate) {
|
|
|
-
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+ list.stream().map(new Function<GameDataTotalVO, Object>() {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Object apply(GameDataTotalVO gameDataTotalVO) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ });*/
|
|
|
|
|
|
|
|
|
return new Page<>(list, pager);
|
|
@@ -145,6 +159,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
dt cost_date,
|
|
|
game_name,
|
|
|
game_classify,
|
|
|
+
|
|
|
buy_reg_num,
|
|
|
nature_reg_num,
|
|
|
reg_num,
|
|
@@ -174,11 +189,13 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
buy_amount_arpu,
|
|
|
buy_amount_d1,
|
|
|
buy_amount_d3,
|
|
|
+ buy_amount_d5,
|
|
|
buy_amount_d7,
|
|
|
buy_amount_d15,
|
|
|
buy_amount_m1,
|
|
|
buy_amount_m2,
|
|
|
buy_amount_m3,
|
|
|
+ buy_amount_m6,
|
|
|
buy_amount_sum,
|
|
|
|
|
|
nature_first_new_user_amount_count,
|
|
@@ -206,11 +223,13 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
nature_amount_arpu,
|
|
|
nature_amount_d1,
|
|
|
nature_amount_d3,
|
|
|
+ nature_amount_d5,
|
|
|
nature_amount_d7,
|
|
|
nature_amount_d15,
|
|
|
nature_amount_m1,
|
|
|
nature_amount_m2,
|
|
|
nature_amount_m3,
|
|
|
+ nature_amount_m6,
|
|
|
nature_amount_sum,
|
|
|
|
|
|
first_new_user_amount_count,
|
|
@@ -238,11 +257,13 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
amount_arpu,
|
|
|
amount_d1,
|
|
|
amount_d3,
|
|
|
+ amount_d5,
|
|
|
amount_d7,
|
|
|
amount_d15,
|
|
|
amount_m1,
|
|
|
amount_m2,
|
|
|
amount_m3,
|
|
|
+ amount_m6,
|
|
|
amount_sum
|
|
|
|
|
|
FROM ads_game_day
|
|
@@ -257,14 +278,85 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
private String gameDataTotalSql() {
|
|
|
return """
|
|
|
SELECT
|
|
|
- a.game_name game_name
|
|
|
+ a.game_id game_id,
|
|
|
+ a.game_name game_name,
|
|
|
+ a.game_classify game_classify,
|
|
|
+
|
|
|
+ sum(a.buy_reg_num) buy_reg_num,
|
|
|
+ sum(a.nature_reg_num) nature_reg_num,
|
|
|
+ sum(a.reg_num) reg_num,
|
|
|
+
|
|
|
+ sum(a.buy_first_new_user_amount_count) buy_first_new_user_amount_count,
|
|
|
+ sum(a.buy_first_new_user_amount_num) buy_first_new_user_amount_num,
|
|
|
+ sum(a.buy_first_new_user_amount) buy_first_new_user_amount,
|
|
|
+ sum(a.nature_first_new_user_amount_count) nature_first_new_user_amount_count,
|
|
|
+ sum(a.nature_first_new_user_amount_num) nature_first_new_user_amount_num,
|
|
|
+ sum(a.nature_first_new_user_amount) nature_first_new_user_amount,
|
|
|
+ sum(a.first_new_user_amount_count) first_new_user_amount_count,
|
|
|
+ sum(a.first_new_user_amount_num) first_new_user_amount_num,
|
|
|
+ sum(a.first_new_user_amount) first_new_user_amount,
|
|
|
+
|
|
|
+ sum(b.buy_amount_count) buy_amount_count,
|
|
|
+ sum(b.buy_amount_num) buy_amount_num,
|
|
|
+ sum(b.buy_amount) buy_amount,
|
|
|
+ sum(b.nature_amount_count) nature_amount_count,
|
|
|
+ sum(b.nature_amount_num) nature_amount_num,
|
|
|
+ sum(b.nature_amount) nature_amount,
|
|
|
+ sum(b.amount_count) amount_count,
|
|
|
+ sum(b.amount_num) amount_num,
|
|
|
+ sum(b.amount) amount,
|
|
|
+
|
|
|
+ sum(a.buy_new_user_total_amount_count) buy_new_user_total_amount_count,
|
|
|
+ sum(a.buy_new_user_total_amount_num) buy_new_user_total_amount_num,
|
|
|
+ sum(a.buy_new_user_total_amount) buy_new_user_total_amount,
|
|
|
+ sum(a.nature_new_user_total_amount_count) nature_new_user_total_amount_count,
|
|
|
+ sum(a.nature_new_user_total_amount_num) nature_new_user_total_amount_num,
|
|
|
+ sum(a.nature_new_user_total_amount) nature_new_user_total_amount,
|
|
|
+ sum(a.new_user_total_amount_count) new_user_total_amount_count,
|
|
|
+ sum(a.new_user_total_amount_num) new_user_total_amount_num,
|
|
|
+ sum(a.new_user_total_amount) new_user_total_amount,
|
|
|
+
|
|
|
+ round(if(sum(a.buy_reg_num) > 0 ,sum(a.buy_first_new_user_amount_num) / sum(a.buy_reg_num), 0), 4) buy_first_roi,
|
|
|
+ round(if(sum(a.buy_reg_num) > 0, sum(a.buy_new_user_total_amount_num) / sum(a.buy_reg_num), 0), 4) buy_today_roi,
|
|
|
+ round(if(sum(a.nature_reg_num) > 0 ,sum(a.nature_first_new_user_amount_num) / sum(a.nature_reg_num), 0), 4) nature_first_roi,
|
|
|
+ round(if(sum(a.nature_reg_num) > 0, sum(a.nature_new_user_total_amount_num) / sum(a.nature_reg_num), 0), 4) nature_today_roi,
|
|
|
+ round(if(sum(a.reg_num) > 0 ,sum(a.first_new_user_amount_num) / sum(a.reg_num), 0), 4) first_roi,
|
|
|
+ round(if(sum(a.reg_num) > 0, sum(a.new_user_total_amount_num) / sum(a.reg_num), 0), 4) today_roi,
|
|
|
+
|
|
|
+ round(if(sum(a.buy_first_new_user_amount_count) > 0, sum(a.buy_first_new_user_amount) / sum(a.buy_first_new_user_amount_count), 0), 2) buy_first_avg_amount,
|
|
|
+ round(if(sum(a.buy_new_user_total_amount_count) > 0, sum(a.buy_new_user_total_amount) / sum(a.buy_new_user_total_amount_count), 0), 2) buy_today_avg_amount,
|
|
|
+ round(if(sum(b.buy_amount_count) > 0, sum(b.buy_amount) / sum(b.buy_amount_count), 0), 2) buy_avg_amount,
|
|
|
+ round(if(sum(a.nature_first_new_user_amount_count) > 0, sum(a.nature_first_new_user_amount) / sum(a.nature_first_new_user_amount_count), 0), 2) nature_first_avg_amount,
|
|
|
+ round(if(sum(a.nature_new_user_total_amount_count) > 0, sum(a.nature_new_user_total_amount) / sum(a.nature_new_user_total_amount_count), 0), 2) nature_today_avg_amount,
|
|
|
+ round(if(sum(b.nature_amount_count) > 0, sum(b.nature_amount) / sum(b.nature_amount_count), 0), 2) nature_avg_amount,
|
|
|
+ round(if(sum(a.first_new_user_amount_count) > 0, sum(a.first_new_user_amount) / sum(a.first_new_user_amount_count), 0), 2) first_avg_amount,
|
|
|
+ round(if(sum(a.new_user_total_amount_count) > 0, sum(a.new_user_total_amount) / sum(a.new_user_total_amount_count), 0), 2) today_avg_amount,
|
|
|
+ round(if(sum(b.amount_count) > 0, sum(b.amount) / sum(b.amount_count), 0), 2) avg_amount,
|
|
|
+
|
|
|
+ round(if(sum(a.buy_new_user_total_amount_num) > 0 , sum(a.buy_reg_order_user_again) / sum(a.buy_new_user_total_amount_num), 0), 4) buy_today_again_rate,
|
|
|
+ round(if(sum(a.nature_new_user_total_amount_num) > 0 , sum(a.nature_reg_order_user_again) / sum(a.nature_new_user_total_amount_num), 0), 4) nature_today_again_rate,
|
|
|
+ round(if(sum(a.new_user_total_amount_num) > 0 , sum(a.reg_order_user_again) / sum(a.new_user_total_amount_num), 0), 4) today_again_rate,
|
|
|
+
|
|
|
+ round(if(sum(a.buy_reg_num) > 0 , sum(a.buy_new_user_total_amount) / sum(a.buy_reg_num), 0), 2) buy_reg_user_arpu,
|
|
|
+ round(if(sum(a.buy_first_new_user_amount_num) > 0 , sum(a.buy_first_new_user_amount) / sum(a.buy_first_new_user_amount_num), 0), 2) buy_first_amount_arpu,
|
|
|
+ round(if(sum(a.buy_new_user_total_amount_num) > 0 , sum(a.buy_new_user_total_amount) / sum(a.buy_new_user_total_amount_num), 0), 2) buy_today_amount_arpu,
|
|
|
+ round(if(sum(b.buy_amount_num) > 0 , sum(b.buy_amount) / sum(b.buy_amount_num), 0), 2) buy_amount_arpu,
|
|
|
+ round(if(sum(a.nature_reg_num) > 0 , sum(a.nature_new_user_total_amount) / sum(a.nature_reg_num), 0), 2) nature_reg_user_arpu,
|
|
|
+ round(if(sum(a.nature_first_new_user_amount_num) > 0 , sum(a.nature_first_new_user_amount) / sum(a.nature_first_new_user_amount_num), 0), 2) nature_first_amount_arpu,
|
|
|
+ round(if(sum(a.nature_new_user_total_amount_num) > 0 , sum(a.nature_new_user_total_amount) / sum(a.nature_new_user_total_amount_num), 0), 2) nature_today_amount_arpu,
|
|
|
+ round(if(sum(b.nature_amount_num) > 0 , sum(b.nature_amount) / sum(b.nature_amount_num), 0), 2) nature_amount_arpu,
|
|
|
+ round(if(sum(a.reg_num) > 0 , sum(a.new_user_total_amount) / sum(a.reg_num), 0), 2) reg_user_arpu,
|
|
|
+ round(if(sum(a.first_new_user_amount_num) > 0 , sum(a.first_new_user_amount) / sum(a.first_new_user_amount_num), 0), 2) first_amount_arpu,
|
|
|
+ round(if(sum(a.new_user_total_amount_num) > 0 , sum(a.new_user_total_amount) / sum(a.new_user_total_amount_num), 0), 2) today_amount_arpu,
|
|
|
+ round(if(sum(b.amount_num) > 0 , sum(b.amount) / sum(b.amount_num), 0), 2) amount_arpu
|
|
|
FROM
|
|
|
ads_game_day a
|
|
|
left join
|
|
|
- game_ads.ads_game_day b
|
|
|
+ ads_game_day b
|
|
|
on
|
|
|
- a.game_name = b.game_name
|
|
|
- and
|
|
|
+ a.game_name = b.game_name and
|
|
|
+ a.game_id = b.game_id and
|
|
|
+ a.game_classify = b.game_classify and
|
|
|
(b.dt between @rechargeBeginDate and @rechargeEndDate)
|
|
|
""";
|
|
|
}
|