|
@@ -96,7 +96,9 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
//创建sql
|
|
//创建sql
|
|
StopWatch watch2 = new StopWatch();
|
|
StopWatch watch2 = new StopWatch();
|
|
watch2.start();
|
|
watch2.start();
|
|
- Sql sql = Sqls.create(getRoleRechargeRankingSql(criA, criTodayAmount, margeSql));
|
|
|
|
|
|
+ String roleRechargeRankingSql = getRoleRechargeRankingSql(criA, criTodayAmount, margeSql);
|
|
|
|
+ log.error("------sql:" + roleRechargeRankingSql);
|
|
|
|
+ Sql sql = Sqls.create(roleRechargeRankingSql);
|
|
sql.setCallback(Sqls.callback.maps());
|
|
sql.setCallback(Sqls.callback.maps());
|
|
sql.setPager(pager);
|
|
sql.setPager(pager);
|
|
dao.execute(sql);
|
|
dao.execute(sql);
|
|
@@ -268,7 +270,7 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
criA.where().andGTE("role_level", dto.getRoleLevelMin());
|
|
criA.where().andGTE("role_level", dto.getRoleLevelMin());
|
|
}
|
|
}
|
|
if (dto.getRoleLevelMax() != null) {
|
|
if (dto.getRoleLevelMax() != null) {
|
|
- criA.where().andLTE("role_level", dto.getRoleLevelMin());
|
|
|
|
|
|
+ criA.where().andLTE("role_level", dto.getRoleLevelMax());
|
|
}
|
|
}
|
|
//玩家注册时间
|
|
//玩家注册时间
|
|
if (dto.getRegisterTimeMax() != null && dto.getRegisterTimeMin() != null) {
|
|
if (dto.getRegisterTimeMax() != null && dto.getRegisterTimeMin() != null) {
|
|
@@ -338,14 +340,10 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
if (dto.getIsSendMail() != null) {
|
|
if (dto.getIsSendMail() != null) {
|
|
criA.where().andEquals("is_send_mail", dto.getIsSendMail());
|
|
criA.where().andEquals("is_send_mail", dto.getIsSendMail());
|
|
}
|
|
}
|
|
- if (dto.getIsChange() != null) {
|
|
|
|
- if (dto.getIsChange() == 2) {
|
|
|
|
- //是否转端
|
|
|
|
- criA.where().andIsNull("is_change_game_type");
|
|
|
|
- } else {
|
|
|
|
- //是否转端
|
|
|
|
- criA.where().andEquals("is_change_game_type", dto.getIsChange());
|
|
|
|
- }
|
|
|
|
|
|
+ //是否转端
|
|
|
|
+ List<Long> isChange = dto.getIsChange();
|
|
|
|
+ if (CollectionUtils.isNotEmpty(isChange)) {
|
|
|
|
+ criA.where().andInList("is_change_game_type", dto.getIsChange());
|
|
}
|
|
}
|
|
if (StringUtils.isNotBlank(dto.getWeChatCompany())) {
|
|
if (StringUtils.isNotBlank(dto.getWeChatCompany())) {
|
|
//企业微信号
|
|
//企业微信号
|
|
@@ -399,42 +397,28 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
//玩家操作系统
|
|
//玩家操作系统
|
|
criA.where().andEquals("os", dto.getOs());
|
|
criA.where().andEquals("os", dto.getOs());
|
|
}
|
|
}
|
|
- if (dto.getIsRemoveGame() != null) {
|
|
|
|
- if (dto.getIsRemoveGame() == 2) {
|
|
|
|
- //是否退游
|
|
|
|
- criA.where().andIsNull("is_remove_game");
|
|
|
|
- } else {
|
|
|
|
- //是否退游
|
|
|
|
- criA.where().andEquals("is_remove_game", dto.getIsRemoveGame());
|
|
|
|
- }
|
|
|
|
|
|
+ List<Long> isRemoveGame = dto.getIsRemoveGame();
|
|
|
|
+ if (CollectionUtils.isNotEmpty(isRemoveGame)) {
|
|
|
|
+ //是否退游
|
|
|
|
+ criA.where().andInList("is_remove_game", dto.getIsRemoveGame());
|
|
}
|
|
}
|
|
if (dto.getIsRemoveGameForSystem() != null) {
|
|
if (dto.getIsRemoveGameForSystem() != null) {
|
|
//是否退游(系统判定)
|
|
//是否退游(系统判定)
|
|
criA.where().andEquals("is_remove_game_for_system", dto.getIsRemoveGameForSystem());
|
|
criA.where().andEquals("is_remove_game_for_system", dto.getIsRemoveGameForSystem());
|
|
}
|
|
}
|
|
- if (dto.getIsWakeUp() != null) {
|
|
|
|
- if (dto.getIsWakeUp() == 2) {
|
|
|
|
- //是否唤醒
|
|
|
|
- criA.where().andIsNull("is_wake_up");
|
|
|
|
- } else {
|
|
|
|
- //是否唤醒
|
|
|
|
- criA.where().andEquals("is_wake_up", dto.getIsWakeUp());
|
|
|
|
- }
|
|
|
|
|
|
+ List<Long> isWakeUp = dto.getIsWakeUp();
|
|
|
|
+ if (CollectionUtils.isNotEmpty(isWakeUp)) {
|
|
|
|
+ criA.where().andInList("is_wake_up", dto.getIsWakeUp());
|
|
}
|
|
}
|
|
- if (dto.getIsAddCorpWechat() != null) {
|
|
|
|
- if (dto.getIsAddCorpWechat() == 2) {
|
|
|
|
- //是否添加企微
|
|
|
|
- criA.where().andIsNull("is_add_corp_wechat");
|
|
|
|
- } else {
|
|
|
|
- //是否添加企微
|
|
|
|
- criA.where().andEquals("is_add_corp_wechat", dto.getIsAddCorpWechat());
|
|
|
|
- }
|
|
|
|
|
|
+ List<Long> isAddCorpWechat = dto.getIsAddCorpWechat();
|
|
|
|
+ if (CollectionUtils.isNotEmpty(isAddCorpWechat)) {
|
|
|
|
+ //是否添加企微
|
|
|
|
+ criA.where().andInList("is_add_corp_wechat", dto.getIsAddCorpWechat());
|
|
}
|
|
}
|
|
//角色最近活跃时间
|
|
//角色最近活跃时间
|
|
if (dto.getLastActiveTimeMax() != null && dto.getLastActiveTimeMin() != null) {
|
|
if (dto.getLastActiveTimeMax() != null && dto.getLastActiveTimeMin() != null) {
|
|
criA.where().andBetween("DATE(role_active_time)", dto.getLastActiveTimeMin(), dto.getLastActiveTimeMax());
|
|
criA.where().andBetween("DATE(role_active_time)", dto.getLastActiveTimeMin(), dto.getLastActiveTimeMax());
|
|
}
|
|
}
|
|
-
|
|
|
|
return criA;
|
|
return criA;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -632,13 +616,16 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
if (dto.getIsSendMail() != null) {
|
|
if (dto.getIsSendMail() != null) {
|
|
criA.where().andEquals("is_send_mail", dto.getIsSendMail());
|
|
criA.where().andEquals("is_send_mail", dto.getIsSendMail());
|
|
}
|
|
}
|
|
- if (dto.getIsChange() != null) {
|
|
|
|
- if (dto.getIsChange() == 2) {
|
|
|
|
|
|
+ //是否转端
|
|
|
|
+ List<Long> isChange = dto.getIsChange();
|
|
|
|
+ if (CollectionUtils.isNotEmpty(isChange)) {
|
|
|
|
+ if (isChange.contains(2L)) {
|
|
//是否转端
|
|
//是否转端
|
|
criA.where().andIsNull("is_change_game_type");
|
|
criA.where().andIsNull("is_change_game_type");
|
|
- } else {
|
|
|
|
|
|
+ }
|
|
|
|
+ if (isChange.contains(1L) || isChange.contains(0L)) {
|
|
//是否转端
|
|
//是否转端
|
|
- criA.where().andEquals("is_change_game_type", dto.getIsChange());
|
|
|
|
|
|
+ criA.where().andInList("is_change_game_type", dto.getIsChange());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (StringUtils.isNotBlank(dto.getWeChatCompany())) {
|
|
if (StringUtils.isNotBlank(dto.getWeChatCompany())) {
|
|
@@ -693,36 +680,31 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
//玩家操作系统
|
|
//玩家操作系统
|
|
criA.where().andEquals("os", dto.getOs());
|
|
criA.where().andEquals("os", dto.getOs());
|
|
}
|
|
}
|
|
- if (dto.getIsRemoveGame() != null) {
|
|
|
|
- if (dto.getIsRemoveGame() == 2) {
|
|
|
|
|
|
+ List<Long> isRemoveGame = dto.getIsRemoveGame();
|
|
|
|
+ if (CollectionUtils.isNotEmpty(isRemoveGame)) {
|
|
|
|
+ if (isRemoveGame.contains(2L)) {
|
|
//是否退游
|
|
//是否退游
|
|
criA.where().andIsNull("is_remove_game");
|
|
criA.where().andIsNull("is_remove_game");
|
|
- } else {
|
|
|
|
|
|
+ }
|
|
|
|
+ if (isRemoveGame.contains(1L) || isRemoveGame.contains(0L)) {
|
|
//是否退游
|
|
//是否退游
|
|
- criA.where().andEquals("is_remove_game", dto.getIsRemoveGame());
|
|
|
|
|
|
+ criA.where().andInList("is_remove_game", dto.getIsRemoveGame());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (dto.getIsRemoveGameForSystem() != null) {
|
|
if (dto.getIsRemoveGameForSystem() != null) {
|
|
//是否退游(系统判定)
|
|
//是否退游(系统判定)
|
|
criA.where().andEquals("is_remove_game_for_system", dto.getIsRemoveGameForSystem());
|
|
criA.where().andEquals("is_remove_game_for_system", dto.getIsRemoveGameForSystem());
|
|
}
|
|
}
|
|
- if (dto.getIsWakeUp() != null) {
|
|
|
|
- if (dto.getIsWakeUp() == 2) {
|
|
|
|
- //是否唤醒
|
|
|
|
- criA.where().andIsNull("is_wake_up");
|
|
|
|
- } else {
|
|
|
|
- //是否唤醒
|
|
|
|
- criA.where().andEquals("is_wake_up", dto.getIsWakeUp());
|
|
|
|
- }
|
|
|
|
|
|
+ //是否唤醒
|
|
|
|
+ List<Long> isWakeUp = dto.getIsWakeUp();
|
|
|
|
+ if (CollectionUtils.isNotEmpty(isWakeUp)) {
|
|
|
|
+ criA.where().andInList("is_wake_up", dto.getIsWakeUp());
|
|
}
|
|
}
|
|
- if (dto.getIsAddCorpWechat() != null) {
|
|
|
|
- if (dto.getIsAddCorpWechat() == 2) {
|
|
|
|
- //是否添加企微
|
|
|
|
- criA.where().andIsNull("is_add_corp_wechat");
|
|
|
|
- } else {
|
|
|
|
- //是否添加企微
|
|
|
|
- criA.where().andEquals("is_add_corp_wechat", dto.getIsAddCorpWechat());
|
|
|
|
- }
|
|
|
|
|
|
+ List<Long> isAddCorpWechat = dto.getIsAddCorpWechat();
|
|
|
|
+ if (CollectionUtils.isNotEmpty(isAddCorpWechat)) {
|
|
|
|
+
|
|
|
|
+ criA.where().andInList("is_add_corp_wechat", dto.getIsAddCorpWechat());
|
|
|
|
+
|
|
}
|
|
}
|
|
//给充值时间查询条件
|
|
//给充值时间查询条件
|
|
Criteria criTodayAmount = Cnd.cri();
|
|
Criteria criTodayAmount = Cnd.cri();
|
|
@@ -1563,15 +1545,14 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
IFNULL(j.is_send_mail, 0) as is_send_mail, -- 是否发送邮件
|
|
IFNULL(j.is_send_mail, 0) as is_send_mail, -- 是否发送邮件
|
|
j.send_gift_id as send_gift_id, -- 最新发送礼包id
|
|
j.send_gift_id as send_gift_id, -- 最新发送礼包id
|
|
k.gift_name as gift_name, -- 礼包名
|
|
k.gift_name as gift_name, -- 礼包名
|
|
- j.is_change_game_type as is_change_game_type, -- 是否转端 1-是;0-否
|
|
|
|
- j.is_add_corp_wechat as is_add_corp_wechat, -- 是否添加企微 1-是; 0-否
|
|
|
|
|
|
+ IFNULL(j.is_change_game_type,2) as is_change_game_type, -- 是否转端 1-是;0-否 2-未操作
|
|
|
|
+ IFNULL(j.is_add_corp_wechat,2) as is_add_corp_wechat, -- 是否添加企微 1-是; 0-否 2-未操作
|
|
j.add_corp_user_id as add_corp_user_id, -- 企微号
|
|
j.add_corp_user_id as add_corp_user_id, -- 企微号
|
|
j.user_wechat as user_wechat, -- 客户微信号
|
|
j.user_wechat as user_wechat, -- 客户微信号
|
|
j.user_phone as user_phone, -- 客户手机号
|
|
j.user_phone as user_phone, -- 客户手机号
|
|
- IF(TIMESTAMPDIFF(HOUR, g.update_time, NOW()) > 72,
|
|
|
|
- IF(TIMESTAMPDIFF(HOUR, f.pay_time, NOW()) < 72 , 0, 1) , 0) as is_remove_game_for_system, -- 是否退游 1-是;0-否(系统判定)
|
|
|
|
- j.is_remove_game as is_remove_game, -- 是否退游 1-是;0-否;null-代表未操作数据
|
|
|
|
- j.is_wake_up as is_wake_up, -- 是否唤醒 1-是;0-否
|
|
|
|
|
|
+ IF(TIMESTAMPDIFF(HOUR, g.update_time, NOW()) > 72,IF(TIMESTAMPDIFF(HOUR, f.pay_time, NOW()) < 72 , 0, 1) , 0) as is_remove_game_for_system, -- 是否退游 1-是;0-否(系统判定)
|
|
|
|
+ IFNULL(j.is_remove_game,2) as is_remove_game, -- 是否退游 1-是;0-否;null-代表未操作数据
|
|
|
|
+ IFNULL(j.is_wake_up,2) as is_wake_up, -- 是否唤醒 1-是;0-否 2-未操作
|
|
j.remark as remark, -- 备注
|
|
j.remark as remark, -- 备注
|
|
j.gs_id as gs_id, -- GS_ID
|
|
j.gs_id as gs_id, -- GS_ID
|
|
j.customer_service_id as customer_service_id, -- 客服ID
|
|
j.customer_service_id as customer_service_id, -- 客服ID
|
|
@@ -2367,16 +2348,17 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
a.user_id as user_id, -- 玩家id
|
|
a.user_id as user_id, -- 玩家id
|
|
x.agent_id as agent_id, -- 玩家注册渠道id
|
|
x.agent_id as agent_id, -- 玩家注册渠道id
|
|
IF(x.agent_id = 0 , '自然量', y.agent_name) as agent_name, -- 玩家注册渠道名
|
|
IF(x.agent_id = 0 , '自然量', y.agent_name) as agent_name, -- 玩家注册渠道名
|
|
|
|
+ i.user_create_time as user_create_time, -- 玩家注册时间
|
|
y.put_user_id as put_user_id, -- 投手id
|
|
y.put_user_id as put_user_id, -- 投手id
|
|
IFNULL(j.is_send_mail, 0) as is_send_mail, -- 是否发送邮件
|
|
IFNULL(j.is_send_mail, 0) as is_send_mail, -- 是否发送邮件
|
|
j.send_gift_id as send_gift_id, -- 最新发送礼包id
|
|
j.send_gift_id as send_gift_id, -- 最新发送礼包id
|
|
- j.is_change_game_type as is_change_game_type, -- 是否转端 1-是;0-否
|
|
|
|
- j.is_add_corp_wechat as is_add_corp_wechat, -- 是否添加企微 1-是; 0-否
|
|
|
|
|
|
+ IFNULL(j.is_change_game_type,2) as is_change_game_type, -- 是否转端 1-是;0-否
|
|
|
|
+ IFNULL(j.is_add_corp_wechat,2) as is_add_corp_wechat, -- 是否添加企微 1-是; 0-否
|
|
j.user_phone as user_phone, -- 客户手机号
|
|
j.user_phone as user_phone, -- 客户手机号
|
|
IF(TIMESTAMPDIFF(HOUR, g.update_time, NOW()) > 72,
|
|
IF(TIMESTAMPDIFF(HOUR, g.update_time, NOW()) > 72,
|
|
IF(TIMESTAMPDIFF(HOUR, f.pay_time, NOW()) < 72 , 0, 1) , 0) as is_remove_game_for_system, -- 是否退游 1-是;0-否(系统判定)
|
|
IF(TIMESTAMPDIFF(HOUR, f.pay_time, NOW()) < 72 , 0, 1) , 0) as is_remove_game_for_system, -- 是否退游 1-是;0-否(系统判定)
|
|
- j.is_remove_game as is_remove_game, -- 是否退游 1-是;0-否;null-代表未操作数据
|
|
|
|
- j.is_wake_up as is_wake_up, -- 是否唤醒 1-是;0-否
|
|
|
|
|
|
+ IFNULL(j.is_remove_game,2) as is_remove_game, -- 是否退游 1-是;0-否;2-代表未操作数据
|
|
|
|
+ IFNULL(j.is_wake_up,2) as is_wake_up, -- 是否唤醒 1-是;0-否 2-未操作
|
|
j.gs_id as gs_id, -- GS_ID
|
|
j.gs_id as gs_id, -- GS_ID
|
|
j.customer_service_id as customer_service_id, -- 客服ID
|
|
j.customer_service_id as customer_service_id, -- 客服ID
|
|
j.oper_user_id as oper_user_id, -- 运营ID
|
|
j.oper_user_id as oper_user_id, -- 运营ID
|
|
@@ -2537,6 +2519,35 @@ public class RoleManageServiceImpl implements IRoleManageService {
|
|
""" + margeSql + """
|
|
""" + margeSql + """
|
|
AND is_delete = 0
|
|
AND is_delete = 0
|
|
) r on a.source_system = r.source_system AND a.server_id = r.source_server_ids AND d.super_game_id = r.game_id
|
|
) r on a.source_system = r.source_system AND a.server_id = r.source_server_ids AND d.super_game_id = r.game_id
|
|
|
|
+ LEFT JOIN (
|
|
|
|
+ -- 玩家信息
|
|
|
|
+ -- 玩家ID、玩家账号、玩家昵称、注册电话、注册邮箱、注册时间、注册游戏、注册渠道
|
|
|
|
+ SELECT
|
|
|
|
+ z.source_system as source_system,
|
|
|
|
+ z.association_user_id as association_user_id, -- 来源用户id
|
|
|
|
+ z.id as id, -- 玩家id
|
|
|
|
+ z.username as username,
|
|
|
|
+ z.nickname as nickname,
|
|
|
|
+ z.reg_mobile as reg_mobile,
|
|
|
|
+ z.reg_email as reg_email,
|
|
|
|
+ z.user_create_time as user_create_time,
|
|
|
|
+ z.user_reg_game_id as user_reg_game_id
|
|
|
|
+ FROM
|
|
|
|
+ (
|
|
|
|
+ SELECT
|
|
|
|
+ source_system,
|
|
|
|
+ association_user_id, -- 来源用户id
|
|
|
|
+ id , -- 玩家id
|
|
|
|
+ username ,
|
|
|
|
+ nickname ,
|
|
|
|
+ reg_mobile ,
|
|
|
|
+ reg_email ,
|
|
|
|
+ create_time as user_create_time,
|
|
|
|
+ game_id as user_reg_game_id,
|
|
|
|
+ ROW_NUMBER()over(partition by association_user_id, source_system order by create_time desc, id asc) as num
|
|
|
|
+ FROM dm_game_order.t_game_user
|
|
|
|
+ ) z WHERE z.num = 1
|
|
|
|
+ ) i on a.source_system = i.source_system AND a.association_user_id = i.association_user_id
|
|
LEFT JOIN (
|
|
LEFT JOIN (
|
|
SELECT
|
|
SELECT
|
|
-- 原始服名
|
|
-- 原始服名
|