|
@@ -7836,26 +7836,15 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
ifnull(x.twentyfour_amount, 0) twentyfour_amount,
|
|
ifnull(x.twentyfour_amount, 0) twentyfour_amount,
|
|
ifnull(e.yesterday_amount, 0) yesterday_amount
|
|
ifnull(e.yesterday_amount, 0) yesterday_amount
|
|
from (
|
|
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 left join (
|
|
|
|
select
|
|
select
|
|
source_system,
|
|
source_system,
|
|
day,
|
|
day,
|
|
pitcher_id,
|
|
pitcher_id,
|
|
zx_pitcher_name pitcher_name,
|
|
zx_pitcher_name pitcher_name,
|
|
- order_agent_id,
|
|
|
|
|
|
+ order_agent_id as agent_id,
|
|
agent_name,
|
|
agent_name,
|
|
account_id,
|
|
account_id,
|
|
- parent_game_id,
|
|
|
|
|
|
+ parent_game_id as game_id,
|
|
account_type,
|
|
account_type,
|
|
sum(amount) twentyfour_amount
|
|
sum(amount) twentyfour_amount
|
|
from game_dw.dw_order_day_amount
|
|
from game_dw.dw_order_day_amount
|
|
@@ -7927,97 +7916,6 @@ public class GameDataServiceImpl implements IGameDataService {
|
|
and a.agent_id = e.order_agent_id
|
|
and a.agent_id = e.order_agent_id
|
|
and a.game_id=e.parent_game_id
|
|
and a.game_id=e.parent_game_id
|
|
|
|
|
|
- union all
|
|
|
|
-
|
|
|
|
- select a.source_system,
|
|
|
|
- a.day,
|
|
|
|
- ifnull(b.ten_amount, 0) ten_amount,
|
|
|
|
- ifnull(c.fourteen_amount, 0) fourteen_amount,
|
|
|
|
- ifnull(d.seventeen_amount, 0) seventeen_amount,
|
|
|
|
- ifnull(a.twentyfour_amount, 0) twentyfour_amount,
|
|
|
|
- ifnull(e.yesterday_amount, 0) 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
|
|
|
|
- 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
|
|
|
|
- )a
|
|
|
|
- left join (
|
|
|
|
- select
|
|
|
|
- source_system,
|
|
|
|
- day,
|
|
|
|
- pitcher_id,
|
|
|
|
- order_agent_id,
|
|
|
|
- account_id,
|
|
|
|
- parent_game_id,
|
|
|
|
- account_type,
|
|
|
|
- sum(amount) ten_amount -- 10
|
|
|
|
- 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) b
|
|
|
|
- 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
|
|
|
|
- left join (select source_system,
|
|
|
|
- day,
|
|
|
|
- pitcher_id,
|
|
|
|
- order_agent_id,
|
|
|
|
- account_id,
|
|
|
|
- parent_game_id,
|
|
|
|
- account_type,
|
|
|
|
- sum(amount) fourteen_amount -- 14
|
|
|
|
- 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) c
|
|
|
|
- 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
|
|
|
|
- left join (select source_system,
|
|
|
|
- day,
|
|
|
|
- pitcher_id,
|
|
|
|
- order_agent_id,
|
|
|
|
- account_id,
|
|
|
|
- parent_game_id,
|
|
|
|
- account_type,
|
|
|
|
- sum(amount) seventeen_amount -- 17
|
|
|
|
- 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) d
|
|
|
|
- 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
|
|
|
|
- left join (select source_system,
|
|
|
|
- day,
|
|
|
|
- pitcher_id,
|
|
|
|
- order_agent_id,
|
|
|
|
- account_id,
|
|
|
|
- parent_game_id,
|
|
|
|
- account_type,
|
|
|
|
- sum(amount) yesterday_amount -- 昨日
|
|
|
|
- from game_dw.dw_order_day_amount
|
|
|
|
- """ + yesterdayTotalAmountCri + """
|
|
|
|
- and order_agent_id = 0
|
|
|
|
- group by source_system, day, pitcher_id, order_agent_id, account_id, parent_game_id,
|
|
|
|
- account_type) e
|
|
|
|
- on a.source_system = e.source_system and a.day = Date(adddate(e.day, 1))
|
|
|
|
- and a.order_agent_id = e.order_agent_id
|
|
|
|
- and a.parent_game_id=e.parent_game_id
|
|
|
|
-
|
|
|
|
) f
|
|
) f
|
|
group by day, source_system
|
|
group by day, source_system
|
|
) ab
|
|
) ab
|