|
@@ -831,23 +831,23 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
Criteria criRc = Cnd.cri();
|
|
|
if (StringUtils.isNotBlank(vo.getGameName())) {
|
|
|
//拼接游戏名称查询条件
|
|
|
- criRc.where().andEquals("b.game_name", vo.getGameName());
|
|
|
+ criRc.where().andEquals("game_name", vo.getGameName());
|
|
|
}
|
|
|
if (vo.getGameClassify() != null) {
|
|
|
//拼接游戏类型查询条件
|
|
|
- criRc.where().andEquals("b.game_classify", vo.getGameClassify());
|
|
|
+ criRc.where().andEquals("game_classify", vo.getGameClassify());
|
|
|
}
|
|
|
if (vo.getGameId() != null) {
|
|
|
//拼接游戏id查询条件
|
|
|
- criRc.where().andEquals("b.game_id", vo.getGameId());
|
|
|
+ criRc.where().andEquals("game_id", vo.getGameId());
|
|
|
}
|
|
|
if (dto.getRechargeBeginDate() != null && dto.getRechargeEndDate() != null) {
|
|
|
//拼接充值日期查询条件
|
|
|
- criRc.where().andBetween("b.dt", dto.getRechargeBeginDate(), dto.getRechargeEndDate());
|
|
|
+ criRc.where().andBetween("dt", dto.getRechargeBeginDate(), dto.getRechargeEndDate());
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(dto.getSourceSystem())) {
|
|
|
//拼接SDK来源
|
|
|
- criRc.where().andEquals("b.source_system", dto.getSourceSystem());
|
|
|
+ criRc.where().andEquals("source_system", dto.getSourceSystem());
|
|
|
}
|
|
|
//创建sql语句
|
|
|
Sql sqlWithRechargeDate = Sqls.create(gameDataTotalSqlRecharge() + criRc);
|
|
@@ -905,7 +905,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
//创建查询条件
|
|
|
Criteria cri = Cnd.cri();
|
|
|
if (dayNMap.get("registerBeginDate") != null && dayNMap.get("registerEndDate") != null) {
|
|
|
- //拼接充值时间查询条件
|
|
|
+ //拼接注册时间查询条件
|
|
|
cri.where().andBetween("dt", dayNMap.get("registerBeginDate"), dayNMap.get("registerEndDate"));
|
|
|
}
|
|
|
if (dayNMap.get("gameId") != null) {
|
|
@@ -983,6 +983,27 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
.build();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /*//查询新用户充值人数
|
|
|
+ Criteria newUserAmountNumCri = cri;
|
|
|
+ if (dayNMap.get("rechargeBeginDate") != null && dayNMap.get("rechargeEndDate") != null) {
|
|
|
+ //拼接充值时间查询条件
|
|
|
+ newUserAmountNumCri.where().andBetween("dt", dayNMap.get("rechargeBeginDate"), dayNMap.get("rechargeEndDate"));
|
|
|
+ }
|
|
|
+ Sql newUserAmountNumSql = Sqls.create("""
|
|
|
+ SELECT
|
|
|
+ DISTINCT(user_id)
|
|
|
+ FROM
|
|
|
+ game_ads.ads_information
|
|
|
+ """ + newUserAmountNumCri);
|
|
|
+ newUserAmountNumSql.setCallback(Sqls.callback.longValue());
|
|
|
+ //执行sql
|
|
|
+ dao.execute(newUserAmountNumSql);
|
|
|
+ //得到结果 新用户充值人数
|
|
|
+ Long newUserAmountNum = newUserAmountNumSql.getLong();
|
|
|
+ //设置新用户充值人数
|
|
|
+ dayN.setRechargeNum(newUserAmountNum);*/
|
|
|
+
|
|
|
return dayN;
|
|
|
}
|
|
|
|
|
@@ -2012,25 +2033,25 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
private String gameDataTotalSqlRecharge() {
|
|
|
return """
|
|
|
SELECT
|
|
|
- ifnull(sum(b.buy_amount_count),0) buy_amount_count,
|
|
|
- ifnull(sum(b.buy_amount_num),0) buy_amount_num,
|
|
|
- ifnull(sum(b.buy_amount),0) buy_amount,
|
|
|
- ifnull(sum(b.nature_amount_count),0) nature_amount_count,
|
|
|
- ifnull(sum(b.nature_amount_num),0) nature_amount_num,
|
|
|
- ifnull(sum(b.nature_amount),0) nature_amount,
|
|
|
- ifnull(sum(b.amount_count),0) amount_count,
|
|
|
- ifnull(sum(b.amount_num),0) amount_num,
|
|
|
- ifnull(sum(b.amount),0) 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(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(amount_count),0) amount_count,
|
|
|
+ ifnull(sum(amount_num),0) amount_num,
|
|
|
+ ifnull(sum(amount),0) 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(b.nature_amount_count) > 0, sum(b.nature_amount) / sum(b.nature_amount_count), 0), 2) nature_avg_amount,
|
|
|
- round(if(sum(b.amount_count) > 0, sum(b.amount) / sum(b.amount_count), 0), 2) avg_amount,
|
|
|
- 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(b.nature_amount_num) > 0 , sum(b.nature_amount) / sum(b.nature_amount_num), 0), 2) nature_amount_arpu,
|
|
|
- round(if(sum(b.amount_num) > 0 , sum(b.amount) / sum(b.amount_num), 0), 2) amount_arpu
|
|
|
+ round(if(sum(buy_amount_count) > 0, sum(buy_amount) / sum(buy_amount_count), 0), 2) buy_avg_amount,
|
|
|
+ round(if(sum(nature_amount_count) > 0, sum(nature_amount) / sum(nature_amount_count), 0), 2) nature_avg_amount,
|
|
|
+ round(if(sum(amount_count) > 0, sum(amount) / sum(amount_count), 0), 2) avg_amount,
|
|
|
+ round(if(sum(buy_amount_num) > 0 , sum(buy_amount) / sum(buy_amount_num), 0), 2) buy_amount_arpu,
|
|
|
+ round(if(sum(nature_amount_num) > 0 , sum(nature_amount) / sum(nature_amount_num), 0), 2) nature_amount_arpu,
|
|
|
+ round(if(sum(amount_num) > 0 , sum(amount) / sum(amount_num), 0), 2) amount_arpu
|
|
|
|
|
|
FROM
|
|
|
- ads_game_day b
|
|
|
+ game_ads.ads_game_day
|
|
|
|
|
|
""";
|
|
|
}
|