|
@@ -8,6 +8,7 @@ import com.zanxiang.game.data.serve.pojo.entity.*;
|
|
import com.zanxiang.game.data.serve.pojo.enums.OrderByEnum;
|
|
import com.zanxiang.game.data.serve.pojo.enums.OrderByEnum;
|
|
import com.zanxiang.game.data.serve.pojo.vo.*;
|
|
import com.zanxiang.game.data.serve.pojo.vo.*;
|
|
import com.zanxiang.game.data.serve.service.IGameDataService;
|
|
import com.zanxiang.game.data.serve.service.IGameDataService;
|
|
|
|
+import com.zanxiang.game.data.serve.service.IRoleManageService;
|
|
import com.zanxiang.game.data.serve.utils.Page;
|
|
import com.zanxiang.game.data.serve.utils.Page;
|
|
import com.zanxiang.module.util.DateUtil;
|
|
import com.zanxiang.module.util.DateUtil;
|
|
import com.zanxiang.module.util.exception.BaseException;
|
|
import com.zanxiang.module.util.exception.BaseException;
|
|
@@ -61,6 +62,8 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
@Resource
|
|
@Resource
|
|
private IGameDataService basicService;
|
|
private IGameDataService basicService;
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
//用来存储映射
|
|
//用来存储映射
|
|
private static final List<Tuple2<Field, Field>> dayNFieldMapList;
|
|
private static final List<Tuple2<Field, Field>> dayNFieldMapList;
|
|
private static final List<Tuple2<Field, Field>> dayNTotalFieldMapList;
|
|
private static final List<Tuple2<Field, Field>> dayNTotalFieldMapList;
|
|
@@ -3957,13 +3960,13 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
//三月
|
|
//三月
|
|
trendDay.append("""
|
|
trendDay.append("""
|
|
CONCAT(
|
|
CONCAT(
|
|
- SUM(IF(DATE_ADD(a.dt, INTERVAL 2 month) <= DATE(NOW()), %sda3, 0)),'/',
|
|
|
|
- IFNULL(sum(%sda3),0),'/',
|
|
|
|
- sum(ifnull(%sda3_num,0)),'/',
|
|
|
|
|
|
+ SUM(IF(DATE_ADD(a.dt, INTERVAL 2 month) <= DATE(NOW()), %sm3-%sda89, 0)),'/',
|
|
|
|
+ IFNULL(sum(%sm3),0),'/',
|
|
|
|
+ sum(ifnull(%sda90_num,0)),'/',
|
|
SUM(IF(DATE_ADD(a.dt, INTERVAL 2 month) <= DATE(NOW()), cost, 0)),'/',
|
|
SUM(IF(DATE_ADD(a.dt, INTERVAL 2 month) <= DATE(NOW()), cost, 0)),'/',
|
|
SUM(IF(DATE_ADD(a.dt, INTERVAL 2 month) <= DATE(NOW()), %sda1, 0))
|
|
SUM(IF(DATE_ADD(a.dt, INTERVAL 2 month) <= DATE(NOW()), %sda1, 0))
|
|
- ) AS amount_m3 ,
|
|
|
|
- """.formatted(type, type, type, type));
|
|
|
|
|
|
+ ) AS amount_d90 ,
|
|
|
|
+ """.formatted(type, type, type, type,type));
|
|
for (int month = 4; month <= 12; month++) {
|
|
for (int month = 4; month <= 12; month++) {
|
|
trendDay.append("""
|
|
trendDay.append("""
|
|
CONCAT(
|
|
CONCAT(
|
|
@@ -5691,7 +5694,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
|
|
|
//查询总记录数
|
|
//查询总记录数
|
|
//默认子游戏
|
|
//默认子游戏
|
|
- Sql countSql = Sqls.create(getCountNumSubgameSql(cri, agentCri, subGameSql,yesterdayTotalAmountCri));
|
|
|
|
|
|
+ Sql countSql = Sqls.create(getCountNumSubgameSql2(cri, agentCri, subGameSql,yesterdayTotalAmountCri));
|
|
if (dto.getGameDimension() == 2) {
|
|
if (dto.getGameDimension() == 2) {
|
|
countSql = Sqls.create(getCountNumSql(cri, agentCri,yesterdayTotalAmountCri));
|
|
countSql = Sqls.create(getCountNumSql(cri, agentCri,yesterdayTotalAmountCri));
|
|
}
|
|
}
|
|
@@ -5702,7 +5705,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
|
|
|
|
//查询sql
|
|
//查询sql
|
|
//默认子游戏
|
|
//默认子游戏
|
|
- Sql sql = Sqls.create(flowMonitorSubgameSql(cri, agentCri, yesterdayTotalAmountCri, subGameSql));
|
|
|
|
|
|
+ Sql sql = Sqls.create(flowMonitorSubgameSql2(cri, agentCri, yesterdayTotalAmountCri, subGameSql));
|
|
if (dto.getGameDimension() == 2) {
|
|
if (dto.getGameDimension() == 2) {
|
|
sql = Sqls.create(flowMonitorSql(cri, agentCri, yesterdayTotalAmountCri));
|
|
sql = Sqls.create(flowMonitorSql(cri, agentCri, yesterdayTotalAmountCri));
|
|
}
|
|
}
|
|
@@ -5837,7 +5840,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
""" + cri + """
|
|
""" + cri + """
|
|
and hour(order_create_time) < 10
|
|
and hour(order_create_time) < 10
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
- account_type) b
|
|
|
|
|
|
+ account_type,game_id) b
|
|
on a.source_system = b.source_system and a.day = b.day and a.agent_id = b.order_agent_id
|
|
on a.source_system = b.source_system and a.day = b.day and a.agent_id = b.order_agent_id
|
|
and a.game_id=b.parent_game_id
|
|
and a.game_id=b.parent_game_id
|
|
left join (select source_system,
|
|
left join (select source_system,
|
|
@@ -5852,7 +5855,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
""" + cri + """
|
|
""" + cri + """
|
|
and hour(order_create_time) < 14
|
|
and hour(order_create_time) < 14
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
- account_type) c
|
|
|
|
|
|
+ account_type,game_id) c
|
|
on a.source_system = c.source_system and a.day = c.day and a.agent_id = c.order_agent_id
|
|
on a.source_system = c.source_system and a.day = c.day and a.agent_id = c.order_agent_id
|
|
and a.game_id=c.parent_game_id
|
|
and a.game_id=c.parent_game_id
|
|
left join (select source_system,
|
|
left join (select source_system,
|
|
@@ -5867,7 +5870,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
""" + cri + """
|
|
""" + cri + """
|
|
and hour(order_create_time) < 17
|
|
and hour(order_create_time) < 17
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
- account_type) d
|
|
|
|
|
|
+ account_type,game_id) d
|
|
on a.source_system = d.source_system and a.day = d.day and a.agent_id = d.order_agent_id
|
|
on a.source_system = d.source_system and a.day = d.day and a.agent_id = d.order_agent_id
|
|
and a.game_id=d.parent_game_id
|
|
and a.game_id=d.parent_game_id
|
|
"""
|
|
"""
|
|
@@ -5897,7 +5900,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
""" + cri + """
|
|
""" + cri + """
|
|
and order_agent_id = 0
|
|
and order_agent_id = 0
|
|
group by source_system, day, pitcher_id, zx_pitcher_name, order_agent_id, agent_name,
|
|
group by source_system, day, pitcher_id, zx_pitcher_name, order_agent_id, agent_name,
|
|
- account_id, parent_game_id, account_type
|
|
|
|
|
|
+ account_id, parent_game_id, account_type,game_id
|
|
)a
|
|
)a
|
|
left join (
|
|
left join (
|
|
select
|
|
select
|
|
@@ -5913,7 +5916,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
""" + cri + """
|
|
""" + cri + """
|
|
and hour(order_create_time) < 10 and order_agent_id=0
|
|
and hour(order_create_time) < 10 and order_agent_id=0
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
- account_type) b
|
|
|
|
|
|
+ account_type,game_id) b
|
|
on a.source_system = b.source_system and a.day = b.day and a.order_agent_id = b.order_agent_id
|
|
on a.source_system = b.source_system and a.day = b.day and a.order_agent_id = b.order_agent_id
|
|
and a.parent_game_id=b.parent_game_id
|
|
and a.parent_game_id=b.parent_game_id
|
|
left join (select source_system,
|
|
left join (select source_system,
|
|
@@ -5928,7 +5931,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
""" + cri + """
|
|
""" + cri + """
|
|
and hour(order_create_time) < 14 and order_agent_id = 0
|
|
and hour(order_create_time) < 14 and order_agent_id = 0
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
- account_type) c
|
|
|
|
|
|
+ account_type,game_id) c
|
|
on a.source_system = c.source_system and a.day = c.day and a.order_agent_id = c.order_agent_id
|
|
on a.source_system = c.source_system and a.day = c.day and a.order_agent_id = c.order_agent_id
|
|
and a.parent_game_id=c.parent_game_id
|
|
and a.parent_game_id=c.parent_game_id
|
|
left join (select source_system,
|
|
left join (select source_system,
|
|
@@ -5943,7 +5946,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
""" + cri + """
|
|
""" + cri + """
|
|
and hour(order_create_time) < 17 and order_agent_id = 0
|
|
and hour(order_create_time) < 17 and order_agent_id = 0
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
- account_type) d
|
|
|
|
|
|
+ account_type,game_id) d
|
|
on a.source_system = d.source_system and a.day = d.day and a.order_agent_id = d.order_agent_id
|
|
on a.source_system = d.source_system and a.day = d.day and a.order_agent_id = d.order_agent_id
|
|
and a.parent_game_id=d.parent_game_id
|
|
and a.parent_game_id=d.parent_game_id
|
|
) f
|
|
) f
|
|
@@ -5956,8 +5959,240 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
return sql;
|
|
return sql;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
- * 流水监控父游戏sql
|
|
|
|
|
|
+ * 流水监控子游戏总条数sql
|
|
|
|
+ *
|
|
|
|
+ * @param cri
|
|
|
|
+ * @param agentCri
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ private String getCountNumSubgameSql2(Criteria cri, Criteria agentCri, Criteria subGameSql,Criteria yesterdayTotalAmountCri) {
|
|
|
|
+ String sql = """
|
|
|
|
+ select count(*) from (
|
|
|
|
+ select
|
|
|
|
+ day as order_date,
|
|
|
|
+ source_system,
|
|
|
|
+ ten_amount,
|
|
|
|
+ if(yesterday_amount>0,round(ten_amount/yesterday_amount,4),0)*100 ten_rate,
|
|
|
|
+ fourteen_amount,
|
|
|
|
+ if(yesterday_amount>0,round(fourteen_amount/yesterday_amount,4),0)*100 fourteen_rate,
|
|
|
|
+ seventeen_amount,
|
|
|
|
+ if(yesterday_amount>0,round(seventeen_amount/yesterday_amount,4),0)*100 seventeen_rate,
|
|
|
|
+ twentyfour_amount,
|
|
|
|
+ if(yesterday_amount>0,round(twentyfour_amount/yesterday_amount,4),0)*100 twentyfour_rate,
|
|
|
|
+ yesterday_amount
|
|
|
|
+ from (
|
|
|
|
+ select source_system,
|
|
|
|
+ day,
|
|
|
|
+ sum(ten_amount) as ten_amount,
|
|
|
|
+ sum(fourteen_amount) as fourteen_amount,
|
|
|
|
+ sum(seventeen_amount) as seventeen_amount,
|
|
|
|
+ sum(twentyfour_amount) as twentyfour_amount,
|
|
|
|
+ ANY_VALUE(yesterday_amount) as yesterday_amount
|
|
|
|
+ from (
|
|
|
|
+ select ifnull(x.source_system, a.source_system) as source_system,
|
|
|
|
+ ifnull(a.day, x.day) as day,
|
|
|
|
+ ten_amount,
|
|
|
|
+ fourteen_amount,
|
|
|
|
+ seventeen_amount,
|
|
|
|
+ twentyfour_amount,
|
|
|
|
+ (
|
|
|
|
+ select sum(amount) from game_dw.dw_order_day_amount
|
|
|
|
+ """+yesterdayTotalAmountCri+"""
|
|
|
|
+ AND day = adddate(a.day, -1)
|
|
|
|
+ )as yesterday_amount
|
|
|
|
+ from (
|
|
|
|
+ select source_system,
|
|
|
|
+ dt as day,
|
|
|
|
+ pitcher_id,
|
|
|
|
+ agent_id,
|
|
|
|
+ account_id,
|
|
|
|
+ game_id,
|
|
|
|
+ account_type
|
|
|
|
+ from game_dw.dw_agent_day
|
|
|
|
+ """ + agentCri + """
|
|
|
|
+ group by source_system, dt, pitcher_id, agent_id, account_id, game_id,account_type
|
|
|
|
+ ) a
|
|
|
|
+ join (select source_system,
|
|
|
|
+ day,
|
|
|
|
+ pitcher_id,
|
|
|
|
+ zx_pitcher_name pitcher_name,
|
|
|
|
+ order_agent_id,
|
|
|
|
+ agent_name,
|
|
|
|
+ account_id,
|
|
|
|
+ parent_game_id,
|
|
|
|
+ account_type,
|
|
|
|
+ sum(amount) twentyfour_amount,
|
|
|
|
+ game_id
|
|
|
|
+ from game_dw.dw_order_day_amount
|
|
|
|
+ """ + cri + """
|
|
|
|
+ AND order_agent_id != 0
|
|
|
|
+ group by source_system, day, pitcher_id, zx_pitcher_name, order_agent_id, agent_name,account_id, parent_game_id, account_type, game_id) x
|
|
|
|
+ on a.source_system = x.source_system and a.day = x.day and a.agent_id = x.order_agent_id and a.game_id = x.parent_game_id
|
|
|
|
+ left join (select source_system,
|
|
|
|
+ day,
|
|
|
|
+ pitcher_id,
|
|
|
|
+ order_agent_id,
|
|
|
|
+ account_id,
|
|
|
|
+ parent_game_id,
|
|
|
|
+ account_type,
|
|
|
|
+ sum(amount) ten_amount -- 10
|
|
|
|
+ ,
|
|
|
|
+ game_id
|
|
|
|
+ from game_dw.dw_order_day_amount
|
|
|
|
+ """ + cri + """
|
|
|
|
+ and hour(order_create_time) < 10
|
|
|
|
+ and order_agent_id != 0
|
|
|
|
+ group by source_system, day, pitcher_id, order_agent_id,
|
|
|
|
+ account_id, parent_game_id,
|
|
|
|
+ account_type, game_id) b
|
|
|
|
+ on x.source_system = b.source_system and x.day = b.day and
|
|
|
|
+ x.order_agent_id = b.order_agent_id
|
|
|
|
+ and x.game_id = b.game_id
|
|
|
|
+ left join (select source_system,
|
|
|
|
+ day,
|
|
|
|
+ pitcher_id,
|
|
|
|
+ order_agent_id,
|
|
|
|
+ account_id,
|
|
|
|
+ parent_game_id,
|
|
|
|
+ account_type,
|
|
|
|
+ sum(amount) fourteen_amount -- 14
|
|
|
|
+ ,
|
|
|
|
+ game_id
|
|
|
|
+ from game_dw.dw_order_day_amount
|
|
|
|
+ """ + cri + """
|
|
|
|
+ and hour(order_create_time) < 14
|
|
|
|
+ and order_agent_id != 0
|
|
|
|
+ group by source_system, day, pitcher_id, order_agent_id,
|
|
|
|
+ account_id, parent_game_id,
|
|
|
|
+ account_type, game_id) c
|
|
|
|
+ on x.source_system = c.source_system and x.day = c.day and
|
|
|
|
+ x.order_agent_id = c.order_agent_id
|
|
|
|
+ and x.game_id = c.game_id
|
|
|
|
+ left join (select source_system,
|
|
|
|
+ day,
|
|
|
|
+ pitcher_id,
|
|
|
|
+ order_agent_id,
|
|
|
|
+ account_id,
|
|
|
|
+ parent_game_id,
|
|
|
|
+ account_type,
|
|
|
|
+ sum(amount) seventeen_amount -- 17
|
|
|
|
+ ,
|
|
|
|
+ game_id
|
|
|
|
+ from game_dw.dw_order_day_amount
|
|
|
|
+ """ + cri + """
|
|
|
|
+ and hour(order_create_time) < 17
|
|
|
|
+ and order_agent_id != 0
|
|
|
|
+ group by source_system, day, pitcher_id, order_agent_id,
|
|
|
|
+ account_id, parent_game_id,
|
|
|
|
+ account_type, game_id) d
|
|
|
|
+ on x.source_system = d.source_system and x.day = d.day and
|
|
|
|
+ x.order_agent_id = d.order_agent_id
|
|
|
|
+ and x.game_id = d.game_id
|
|
|
|
+ WHERE x.source_system is not null
|
|
|
|
+
|
|
|
|
+ union all
|
|
|
|
+
|
|
|
|
+ select x.source_system,
|
|
|
|
+ x.day,
|
|
|
|
+ ten_amount,
|
|
|
|
+ fourteen_amount,
|
|
|
|
+ seventeen_amount,
|
|
|
|
+ twentyfour_amount,
|
|
|
|
+ (select sum(amount)
|
|
|
|
+ from game_dw.dw_order_day_amount
|
|
|
|
+ """+yesterdayTotalAmountCri+"""
|
|
|
|
+ AND day = adddate(x.day, -1)) as yesterday_amount
|
|
|
|
+ from (select source_system,
|
|
|
|
+ day,
|
|
|
|
+ pitcher_id,
|
|
|
|
+ zx_pitcher_name pitcher_name,
|
|
|
|
+ order_agent_id,
|
|
|
|
+ agent_name,
|
|
|
|
+ account_id,
|
|
|
|
+ parent_game_id,
|
|
|
|
+ account_type,
|
|
|
|
+ sum(amount) twentyfour_amount,
|
|
|
|
+ game_id
|
|
|
|
+ from game_dw.dw_order_day_amount
|
|
|
|
+ """ + cri + """
|
|
|
|
+ and order_agent_id = 0
|
|
|
|
+ group by source_system, day, pitcher_id, zx_pitcher_name, order_agent_id,
|
|
|
|
+ agent_name,
|
|
|
|
+ account_id, parent_game_id, account_type, game_id) x
|
|
|
|
+
|
|
|
|
+ left join (select source_system,
|
|
|
|
+ day,
|
|
|
|
+ pitcher_id,
|
|
|
|
+ order_agent_id,
|
|
|
|
+ account_id,
|
|
|
|
+ parent_game_id,
|
|
|
|
+ account_type,
|
|
|
|
+ sum(amount) ten_amount -- 10
|
|
|
|
+ ,
|
|
|
|
+ game_id
|
|
|
|
+ from game_dw.dw_order_day_amount
|
|
|
|
+ """ + cri + """
|
|
|
|
+ and hour(order_create_time) < 10
|
|
|
|
+ and order_agent_id = 0
|
|
|
|
+ group by source_system, day, pitcher_id, order_agent_id,
|
|
|
|
+ account_id, parent_game_id,
|
|
|
|
+ account_type, game_id) b
|
|
|
|
+ on x.source_system = b.source_system and x.day = b.day and
|
|
|
|
+ x.order_agent_id = b.order_agent_id
|
|
|
|
+ and x.game_id = b.game_id
|
|
|
|
+ left join (select source_system,
|
|
|
|
+ day,
|
|
|
|
+ pitcher_id,
|
|
|
|
+ order_agent_id,
|
|
|
|
+ account_id,
|
|
|
|
+ parent_game_id,
|
|
|
|
+ account_type,
|
|
|
|
+ sum(amount) fourteen_amount -- 14
|
|
|
|
+ ,
|
|
|
|
+ game_id
|
|
|
|
+ from game_dw.dw_order_day_amount
|
|
|
|
+ """ + cri + """
|
|
|
|
+ and hour(order_create_time) < 14
|
|
|
|
+ and order_agent_id = 0
|
|
|
|
+ group by source_system, day, pitcher_id, order_agent_id,
|
|
|
|
+ account_id, parent_game_id,
|
|
|
|
+ account_type, game_id) c
|
|
|
|
+ on x.source_system = c.source_system and x.day = c.day and
|
|
|
|
+ x.order_agent_id = c.order_agent_id
|
|
|
|
+ and x.game_id = c.game_id
|
|
|
|
+ left join (select source_system,
|
|
|
|
+ day,
|
|
|
|
+ pitcher_id,
|
|
|
|
+ order_agent_id,
|
|
|
|
+ account_id,
|
|
|
|
+ parent_game_id,
|
|
|
|
+ account_type,
|
|
|
|
+ sum(amount) seventeen_amount -- 17
|
|
|
|
+ ,
|
|
|
|
+ game_id
|
|
|
|
+ from game_dw.dw_order_day_amount
|
|
|
|
+ """ + cri + """
|
|
|
|
+ and hour(order_create_time) < 17
|
|
|
|
+ and order_agent_id = 0
|
|
|
|
+ group by source_system, day, pitcher_id, order_agent_id,
|
|
|
|
+ account_id, parent_game_id,
|
|
|
|
+ account_type, game_id) d
|
|
|
|
+ on x.source_system = d.source_system and x.day = d.day and
|
|
|
|
+ x.order_agent_id = d.order_agent_id
|
|
|
|
+ and x.game_id = d.game_id
|
|
|
|
+ WHERE x.source_system is not null) a
|
|
|
|
+ group by day, source_system
|
|
|
|
+ )abc
|
|
|
|
+ ) ab
|
|
|
|
+ """;
|
|
|
|
+
|
|
|
|
+ return sql;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 流水监控子游戏sql
|
|
*
|
|
*
|
|
* @param cri
|
|
* @param cri
|
|
* @param agentCri
|
|
* @param agentCri
|
|
@@ -6040,7 +6275,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
""" + cri + """
|
|
""" + cri + """
|
|
and hour(order_create_time) < 10
|
|
and hour(order_create_time) < 10
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
- account_type) b
|
|
|
|
|
|
+ account_type,game_id) b
|
|
on a.source_system = b.source_system and a.day = b.day and a.agent_id = b.order_agent_id
|
|
on a.source_system = b.source_system and a.day = b.day and a.agent_id = b.order_agent_id
|
|
and a.game_id=b.parent_game_id
|
|
and a.game_id=b.parent_game_id
|
|
left join (select source_system,
|
|
left join (select source_system,
|
|
@@ -6055,7 +6290,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
""" + cri + """
|
|
""" + cri + """
|
|
and hour(order_create_time) < 14
|
|
and hour(order_create_time) < 14
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
- account_type) c
|
|
|
|
|
|
+ account_type,game_id) c
|
|
on a.source_system = c.source_system and a.day = c.day and a.agent_id = c.order_agent_id
|
|
on a.source_system = c.source_system and a.day = c.day and a.agent_id = c.order_agent_id
|
|
and a.game_id=c.parent_game_id
|
|
and a.game_id=c.parent_game_id
|
|
left join (select source_system,
|
|
left join (select source_system,
|
|
@@ -6070,7 +6305,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
""" + cri + """
|
|
""" + cri + """
|
|
and hour(order_create_time) < 17
|
|
and hour(order_create_time) < 17
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
- account_type) d
|
|
|
|
|
|
+ account_type,game_id) d
|
|
on a.source_system = d.source_system and a.day = d.day and a.agent_id = d.order_agent_id
|
|
on a.source_system = d.source_system and a.day = d.day and a.agent_id = d.order_agent_id
|
|
and a.game_id=d.parent_game_id
|
|
and a.game_id=d.parent_game_id
|
|
"""
|
|
"""
|
|
@@ -6102,7 +6337,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
""" + cri + """
|
|
""" + cri + """
|
|
and order_agent_id = 0
|
|
and order_agent_id = 0
|
|
group by source_system, day, pitcher_id, zx_pitcher_name, order_agent_id, agent_name,
|
|
group by source_system, day, pitcher_id, zx_pitcher_name, order_agent_id, agent_name,
|
|
- account_id, parent_game_id, account_type
|
|
|
|
|
|
+ account_id, parent_game_id, account_type,game_id
|
|
)a
|
|
)a
|
|
left join (
|
|
left join (
|
|
select
|
|
select
|
|
@@ -6118,7 +6353,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
""" + cri + """
|
|
""" + cri + """
|
|
and hour(order_create_time) < 10 and order_agent_id=0
|
|
and hour(order_create_time) < 10 and order_agent_id=0
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
- account_type) b
|
|
|
|
|
|
+ account_type,game_id) b
|
|
on a.source_system = b.source_system and a.day = b.day and a.order_agent_id = b.order_agent_id
|
|
on a.source_system = b.source_system and a.day = b.day and a.order_agent_id = b.order_agent_id
|
|
and a.parent_game_id=b.parent_game_id
|
|
and a.parent_game_id=b.parent_game_id
|
|
left join (select source_system,
|
|
left join (select source_system,
|
|
@@ -6133,7 +6368,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
""" + cri + """
|
|
""" + cri + """
|
|
and hour(order_create_time) < 14 and order_agent_id = 0
|
|
and hour(order_create_time) < 14 and order_agent_id = 0
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
- account_type) c
|
|
|
|
|
|
+ account_type,game_id) c
|
|
on a.source_system = c.source_system and a.day = c.day and a.order_agent_id = c.order_agent_id
|
|
on a.source_system = c.source_system and a.day = c.day and a.order_agent_id = c.order_agent_id
|
|
and a.parent_game_id=c.parent_game_id
|
|
and a.parent_game_id=c.parent_game_id
|
|
left join (select source_system,
|
|
left join (select source_system,
|
|
@@ -6148,7 +6383,7 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
""" + cri + """
|
|
""" + cri + """
|
|
and hour(order_create_time) < 17 and order_agent_id = 0
|
|
and hour(order_create_time) < 17 and order_agent_id = 0
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
- account_type) d
|
|
|
|
|
|
+ account_type,game_id) d
|
|
on a.source_system = d.source_system and a.day = d.day and a.order_agent_id = d.order_agent_id
|
|
on a.source_system = d.source_system and a.day = d.day and a.order_agent_id = d.order_agent_id
|
|
and a.parent_game_id=d.parent_game_id
|
|
and a.parent_game_id=d.parent_game_id
|
|
) f
|
|
) f
|
|
@@ -6161,6 +6396,238 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
return sql;
|
|
return sql;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 流水监控子游戏sql
|
|
|
|
+ *
|
|
|
|
+ * @param cri
|
|
|
|
+ * @param agentCri
|
|
|
|
+ * @param yesterdayTotalAmountCri
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ private String flowMonitorSubgameSql2(Criteria cri, Criteria agentCri, Criteria yesterdayTotalAmountCri, Criteria subGameSql) {
|
|
|
|
+ String sql = """
|
|
|
|
+ select
|
|
|
|
+ day as order_date,
|
|
|
|
+ source_system,
|
|
|
|
+ ten_amount,
|
|
|
|
+ if(yesterday_amount>0,round(ten_amount/yesterday_amount,4),0)*100 ten_rate,
|
|
|
|
+ fourteen_amount,
|
|
|
|
+ if(yesterday_amount>0,round(fourteen_amount/yesterday_amount,4),0)*100 fourteen_rate,
|
|
|
|
+ seventeen_amount,
|
|
|
|
+ if(yesterday_amount>0,round(seventeen_amount/yesterday_amount,4),0)*100 seventeen_rate,
|
|
|
|
+ twentyfour_amount,
|
|
|
|
+ if(yesterday_amount>0,round(twentyfour_amount/yesterday_amount,4),0)*100 twentyfour_rate,
|
|
|
|
+ yesterday_amount
|
|
|
|
+ from (
|
|
|
|
+ select source_system,
|
|
|
|
+ day,
|
|
|
|
+ sum(ten_amount) as ten_amount,
|
|
|
|
+ sum(fourteen_amount) as fourteen_amount,
|
|
|
|
+ sum(seventeen_amount) as seventeen_amount,
|
|
|
|
+ sum(twentyfour_amount) as twentyfour_amount,
|
|
|
|
+ ANY_VALUE(yesterday_amount) as yesterday_amount
|
|
|
|
+ from (
|
|
|
|
+ select ifnull(x.source_system, a.source_system) as source_system,
|
|
|
|
+ ifnull(a.day, x.day) as day,
|
|
|
|
+ ten_amount,
|
|
|
|
+ fourteen_amount,
|
|
|
|
+ seventeen_amount,
|
|
|
|
+ twentyfour_amount,
|
|
|
|
+ (
|
|
|
|
+ select sum(amount) from game_dw.dw_order_day_amount
|
|
|
|
+ """+yesterdayTotalAmountCri+"""
|
|
|
|
+ AND day = adddate(a.day, -1)
|
|
|
|
+ )as yesterday_amount
|
|
|
|
+ from (
|
|
|
|
+ select source_system,
|
|
|
|
+ dt as day,
|
|
|
|
+ pitcher_id,
|
|
|
|
+ agent_id,
|
|
|
|
+ account_id,
|
|
|
|
+ game_id,
|
|
|
|
+ account_type
|
|
|
|
+ from game_dw.dw_agent_day
|
|
|
|
+ """ + agentCri + """
|
|
|
|
+ group by source_system, dt, pitcher_id, agent_id, account_id, game_id,account_type
|
|
|
|
+ ) a
|
|
|
|
+ join (select source_system,
|
|
|
|
+ day,
|
|
|
|
+ pitcher_id,
|
|
|
|
+ zx_pitcher_name pitcher_name,
|
|
|
|
+ order_agent_id,
|
|
|
|
+ agent_name,
|
|
|
|
+ account_id,
|
|
|
|
+ parent_game_id,
|
|
|
|
+ account_type,
|
|
|
|
+ sum(amount) twentyfour_amount,
|
|
|
|
+ game_id
|
|
|
|
+ from game_dw.dw_order_day_amount
|
|
|
|
+ """ + cri + """
|
|
|
|
+ AND order_agent_id != 0
|
|
|
|
+ group by source_system, day, pitcher_id, zx_pitcher_name, order_agent_id, agent_name,account_id, parent_game_id, account_type, game_id) x
|
|
|
|
+ on a.source_system = x.source_system and a.day = x.day and a.agent_id = x.order_agent_id and a.game_id = x.parent_game_id
|
|
|
|
+ left join (select source_system,
|
|
|
|
+ day,
|
|
|
|
+ pitcher_id,
|
|
|
|
+ order_agent_id,
|
|
|
|
+ account_id,
|
|
|
|
+ parent_game_id,
|
|
|
|
+ account_type,
|
|
|
|
+ sum(amount) ten_amount -- 10
|
|
|
|
+ ,
|
|
|
|
+ game_id
|
|
|
|
+ from game_dw.dw_order_day_amount
|
|
|
|
+ """ + cri + """
|
|
|
|
+ and hour(order_create_time) < 10
|
|
|
|
+ and order_agent_id != 0
|
|
|
|
+ group by source_system, day, pitcher_id, order_agent_id,
|
|
|
|
+ account_id, parent_game_id,
|
|
|
|
+ account_type, game_id) b
|
|
|
|
+ on x.source_system = b.source_system and x.day = b.day and
|
|
|
|
+ x.order_agent_id = b.order_agent_id
|
|
|
|
+ and x.game_id = b.game_id
|
|
|
|
+ left join (select source_system,
|
|
|
|
+ day,
|
|
|
|
+ pitcher_id,
|
|
|
|
+ order_agent_id,
|
|
|
|
+ account_id,
|
|
|
|
+ parent_game_id,
|
|
|
|
+ account_type,
|
|
|
|
+ sum(amount) fourteen_amount -- 14
|
|
|
|
+ ,
|
|
|
|
+ game_id
|
|
|
|
+ from game_dw.dw_order_day_amount
|
|
|
|
+ """ + cri + """
|
|
|
|
+ and hour(order_create_time) < 14
|
|
|
|
+ and order_agent_id != 0
|
|
|
|
+ group by source_system, day, pitcher_id, order_agent_id,
|
|
|
|
+ account_id, parent_game_id,
|
|
|
|
+ account_type, game_id) c
|
|
|
|
+ on x.source_system = c.source_system and x.day = c.day and
|
|
|
|
+ x.order_agent_id = c.order_agent_id
|
|
|
|
+ and x.game_id = c.game_id
|
|
|
|
+ left join (select source_system,
|
|
|
|
+ day,
|
|
|
|
+ pitcher_id,
|
|
|
|
+ order_agent_id,
|
|
|
|
+ account_id,
|
|
|
|
+ parent_game_id,
|
|
|
|
+ account_type,
|
|
|
|
+ sum(amount) seventeen_amount -- 17
|
|
|
|
+ ,
|
|
|
|
+ game_id
|
|
|
|
+ from game_dw.dw_order_day_amount
|
|
|
|
+ """ + cri + """
|
|
|
|
+ and hour(order_create_time) < 17
|
|
|
|
+ and order_agent_id != 0
|
|
|
|
+ group by source_system, day, pitcher_id, order_agent_id,
|
|
|
|
+ account_id, parent_game_id,
|
|
|
|
+ account_type, game_id) d
|
|
|
|
+ on x.source_system = d.source_system and x.day = d.day and
|
|
|
|
+ x.order_agent_id = d.order_agent_id
|
|
|
|
+ and x.game_id = d.game_id
|
|
|
|
+ WHERE x.source_system is not null
|
|
|
|
+
|
|
|
|
+ union all
|
|
|
|
+
|
|
|
|
+ select x.source_system,
|
|
|
|
+ x.day,
|
|
|
|
+ ten_amount,
|
|
|
|
+ fourteen_amount,
|
|
|
|
+ seventeen_amount,
|
|
|
|
+ twentyfour_amount,
|
|
|
|
+ (select sum(amount)
|
|
|
|
+ from game_dw.dw_order_day_amount
|
|
|
|
+ """+yesterdayTotalAmountCri+"""
|
|
|
|
+ AND day = adddate(x.day, -1)) as yesterday_amount
|
|
|
|
+ from (select source_system,
|
|
|
|
+ day,
|
|
|
|
+ pitcher_id,
|
|
|
|
+ zx_pitcher_name pitcher_name,
|
|
|
|
+ order_agent_id,
|
|
|
|
+ agent_name,
|
|
|
|
+ account_id,
|
|
|
|
+ parent_game_id,
|
|
|
|
+ account_type,
|
|
|
|
+ sum(amount) twentyfour_amount,
|
|
|
|
+ game_id
|
|
|
|
+ from game_dw.dw_order_day_amount
|
|
|
|
+ """ + cri + """
|
|
|
|
+ and order_agent_id = 0
|
|
|
|
+ group by source_system, day, pitcher_id, zx_pitcher_name, order_agent_id,
|
|
|
|
+ agent_name,
|
|
|
|
+ account_id, parent_game_id, account_type, game_id) x
|
|
|
|
+
|
|
|
|
+ left join (select source_system,
|
|
|
|
+ day,
|
|
|
|
+ pitcher_id,
|
|
|
|
+ order_agent_id,
|
|
|
|
+ account_id,
|
|
|
|
+ parent_game_id,
|
|
|
|
+ account_type,
|
|
|
|
+ sum(amount) ten_amount -- 10
|
|
|
|
+ ,
|
|
|
|
+ game_id
|
|
|
|
+ from game_dw.dw_order_day_amount
|
|
|
|
+ """ + cri + """
|
|
|
|
+ and hour(order_create_time) < 10
|
|
|
|
+ and order_agent_id = 0
|
|
|
|
+ group by source_system, day, pitcher_id, order_agent_id,
|
|
|
|
+ account_id, parent_game_id,
|
|
|
|
+ account_type, game_id) b
|
|
|
|
+ on x.source_system = b.source_system and x.day = b.day and
|
|
|
|
+ x.order_agent_id = b.order_agent_id
|
|
|
|
+ and x.game_id = b.game_id
|
|
|
|
+ left join (select source_system,
|
|
|
|
+ day,
|
|
|
|
+ pitcher_id,
|
|
|
|
+ order_agent_id,
|
|
|
|
+ account_id,
|
|
|
|
+ parent_game_id,
|
|
|
|
+ account_type,
|
|
|
|
+ sum(amount) fourteen_amount -- 14
|
|
|
|
+ ,
|
|
|
|
+ game_id
|
|
|
|
+ from game_dw.dw_order_day_amount
|
|
|
|
+ """ + cri + """
|
|
|
|
+ and hour(order_create_time) < 14
|
|
|
|
+ and order_agent_id = 0
|
|
|
|
+ group by source_system, day, pitcher_id, order_agent_id,
|
|
|
|
+ account_id, parent_game_id,
|
|
|
|
+ account_type, game_id) c
|
|
|
|
+ on x.source_system = c.source_system and x.day = c.day and
|
|
|
|
+ x.order_agent_id = c.order_agent_id
|
|
|
|
+ and x.game_id = c.game_id
|
|
|
|
+ left join (select source_system,
|
|
|
|
+ day,
|
|
|
|
+ pitcher_id,
|
|
|
|
+ order_agent_id,
|
|
|
|
+ account_id,
|
|
|
|
+ parent_game_id,
|
|
|
|
+ account_type,
|
|
|
|
+ sum(amount) seventeen_amount -- 17
|
|
|
|
+ ,
|
|
|
|
+ game_id
|
|
|
|
+ from game_dw.dw_order_day_amount
|
|
|
|
+ """ + cri + """
|
|
|
|
+ and hour(order_create_time) < 17
|
|
|
|
+ and order_agent_id = 0
|
|
|
|
+ group by source_system, day, pitcher_id, order_agent_id,
|
|
|
|
+ account_id, parent_game_id,
|
|
|
|
+ account_type, game_id) d
|
|
|
|
+ on x.source_system = d.source_system and x.day = d.day and
|
|
|
|
+ x.order_agent_id = d.order_agent_id
|
|
|
|
+ and x.game_id = d.game_id
|
|
|
|
+ WHERE x.source_system is not null) a
|
|
|
|
+ group by day, source_system
|
|
|
|
+ )abc
|
|
|
|
+ order by `day` desc
|
|
|
|
+
|
|
|
|
+ """;
|
|
|
|
+ return sql;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 昨日总充值金额查询条件
|
|
* 昨日总充值金额查询条件
|
|
*
|
|
*
|
|
@@ -6815,6 +7282,18 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
return cri;
|
|
return cri;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 获取子游戏id
|
|
|
|
+ */
|
|
|
|
+ public List<Long> getSubGameId(){
|
|
|
|
+ //默认子游戏
|
|
|
|
+ Sql sql = Sqls.create("select id from dm_game_order.t_game where source_system= 'ZX_ONE'");
|
|
|
|
+ sql.setCallback(Sqls.callback.longs());
|
|
|
|
+ dao.execute(sql);
|
|
|
|
+ return sql.getList(Long.class);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 拼接查询条件
|
|
* 拼接查询条件
|
|
*
|
|
*
|
|
@@ -6824,6 +7303,13 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
public Criteria getOrderQueryStr(FlowMonitorDTO dto) {
|
|
public Criteria getOrderQueryStr(FlowMonitorDTO dto) {
|
|
Criteria cri = Cnd.cri();
|
|
Criteria cri = Cnd.cri();
|
|
|
|
|
|
|
|
+ //如果选择子游戏维度,并且没有选择游戏那么就查询所有游戏拼上条件
|
|
|
|
+// if(dto.getGameDimension()==1&&CollectionUtils.isEmpty(dto.getGameId())){
|
|
|
|
+// //查询游戏列表
|
|
|
|
+// List<Long> subGameId = getSubGameId();
|
|
|
|
+// dto.setGameId(subGameId);
|
|
|
|
+// }
|
|
|
|
+
|
|
//SDK类型
|
|
//SDK类型
|
|
if (StringUtils.isNotBlank(dto.getSourceSystem())) {
|
|
if (StringUtils.isNotBlank(dto.getSourceSystem())) {
|
|
cri.where().andEquals("source_system", dto.getSourceSystem());
|
|
cri.where().andEquals("source_system", dto.getSourceSystem());
|