|  | @@ -1367,7 +1367,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
 | 
	
		
			
				|  |  |                  select a.country as country,a.role_id as roleId,a.user_id as userId ,any_value(a.role_name) as roleName ,any_value(a.role_level) as roleLevel ,any_value(combat_num) as combatNum,
 | 
	
		
			
				|  |  |                                                                                                              a.server_id as serverId ,any_value(a.server_name) as serverName ,any_value(create_time) as createTime,SUM(IFNULL(b.amount,0)) as roleTotalAmount
 | 
	
		
			
				|  |  |                                                                                                              from dm_game_order.t_game_user_role a
 | 
	
		
			
				|  |  | -                                                                                                            left join game_dw.dw_order_day_amount b on a.role_id = b.role_id
 | 
	
		
			
				|  |  | +                                                                                                            left join game_dw.dw_order_day_amount b on a.role_id = b.role_id and a.source_system = b.source_system  and a.user_id = b.user_id
 | 
	
		
			
				|  |  |                                                                                                              """ + criA + """
 | 
	
		
			
				|  |  |                   GROUP BY a.country, a.role_id, a.user_id, a.server_id
 | 
	
		
			
				|  |  |                  """ + orderCri;
 | 
	
	
		
			
				|  | @@ -1378,7 +1378,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
 | 
	
		
			
				|  |  |                  select count(1) from (select a.country as country,a.role_id as roleId,a.user_id as userId ,any_value(a.role_name) as roleName ,any_value(a.role_level) as roleLevel ,any_value(combat_num) as combatNum,
 | 
	
		
			
				|  |  |                                                                                                                                                 a.server_id as serverId ,any_value(a.server_name) as serverName ,any_value(create_time) as createTime,SUM(IFNULL(b.amount,0)) as roleTotalAmount
 | 
	
		
			
				|  |  |                                                                                                                                                 from dm_game_order.t_game_user_role a
 | 
	
		
			
				|  |  | -                                                                                                                                               left join game_dw.dw_order_day_amount b on a.role_id = b.role_id
 | 
	
		
			
				|  |  | +                                                                                                                                               left join game_dw.dw_order_day_amount b on a.role_id = b.role_id and a.source_system = b.source_system  and a.user_id = b.user_id
 | 
	
		
			
				|  |  |                                                                                                                                                 """ + criA + """
 | 
	
		
			
				|  |  |                                                      GROUP BY a.country, a.role_id, a.user_id, a.server_id) a
 | 
	
		
			
				|  |  |                  """;
 | 
	
	
		
			
				|  | @@ -1440,7 +1440,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
 | 
	
		
			
				|  |  |                                  from (select a.country,
 | 
	
		
			
				|  |  |                                                        a.game_id,
 | 
	
		
			
				|  |  |                                                        a.server_name,
 | 
	
		
			
				|  |  | -                                                      (select IFNULL(sum(amount),0) as amount  from game_dw.dw_order_day_amount where role_id = b.role_id) as role_total_amount,
 | 
	
		
			
				|  |  | +                                                      (select IFNULL(sum(amount),0) as amount  from game_dw.dw_order_day_amount where role_id = b.role_id and source_system = 'ZX_ONE' and user_id = b.user_id) as role_total_amount,
 | 
	
		
			
				|  |  |                                                        if(b.role_level <= 13, 0, 1)      as country_level,
 | 
	
		
			
				|  |  |                                                        if(d.role_id is not null, 1, 0) as active,
 | 
	
		
			
				|  |  |                                                        a.server_id,
 |