瀏覽代碼

修改内容:玩家列表

lth 1 年之前
父節點
當前提交
d014aa2bb2

+ 2 - 18
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/controller/PlayerDataController.java

@@ -1,9 +1,8 @@
 package com.zanxiang.game.data.serve.controller;
 
+import com.zanxiang.erp.security.annotation.PreAuthorize;
 import com.zanxiang.game.data.serve.pojo.dto.PlayerDataListDTO;
-import com.zanxiang.game.data.serve.pojo.dto.PlayerDataListTotalDTO;
 import com.zanxiang.game.data.serve.pojo.dto.PlayerRoleDataListDTO;
-import com.zanxiang.game.data.serve.pojo.dto.PlayerRoleDataListTotalDTO;
 import com.zanxiang.game.data.serve.pojo.vo.PlayerDataVO;
 import com.zanxiang.game.data.serve.pojo.vo.PlayerRoleDataVO;
 import com.zanxiang.game.data.serve.service.IPlayerDataService;
@@ -33,19 +32,12 @@ public class PlayerDataController {
     private IPlayerDataService playerDataService;
 
     @ApiOperation("玩家列表")
-    //@PreAuthorize(permissionKey = "playerData:player:list")
+    @PreAuthorize(permissionKey = "playerData:player:list")
     @PostMapping("/list")
     public ResultVO<Page<PlayerDataVO>> getPlayerDataList(@RequestBody PlayerDataListDTO dto) {
         return ResultVO.ok(playerDataService.getPlayerDataList(dto));
     }
 
-    @ApiOperation("玩家列表总计一栏")
-    //@PreAuthorize(permissionKey = "playerData:player:listTotal")
-    @PostMapping("/listTotal")
-    public ResultVO<PlayerDataVO> getPlayerDataListTotal(@RequestBody PlayerDataListTotalDTO dto) {
-        return ResultVO.ok(playerDataService.getPlayerDataListTotal(dto));
-    }
-
     @ApiOperation("玩家角色列表")
     //@PreAuthorize(permissionKey = "playerData:role:list")
     @PostMapping("/role/list")
@@ -53,12 +45,4 @@ public class PlayerDataController {
         return ResultVO.ok(playerDataService.getPlayerRoleDataList(dto));
     }
 
-    @ApiOperation("玩家角色列表总计一栏")
-    //@PreAuthorize(permissionKey = "playerData:role:listTotal")
-    @PostMapping("/role/listTotal")
-    public ResultVO<PlayerRoleDataVO> getPlayerRoleDataListTotal(@RequestBody PlayerRoleDataListTotalDTO dto) {
-        return ResultVO.ok(playerDataService.getPlayerRoleDataListTotal(dto));
-    }
-
-
 }

+ 152 - 2
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/PlayerDataListDTO.java

@@ -1,8 +1,10 @@
 package com.zanxiang.game.data.serve.pojo.dto;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.zanxiang.game.data.serve.pojo.base.BasePage;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.time.LocalDate;
 
@@ -14,16 +16,164 @@ import java.time.LocalDate;
 @Data
 public class PlayerDataListDTO extends BasePage {
 
+    /**
+     * 玩家id
+     */
+    @ApiModelProperty(notes = "玩家id")
+    private Long userId;
+
+    /**
+     * 玩家账号
+     */
+    @ApiModelProperty(notes = "玩家账号")
+    private String userName;
+
+    /**
+     * 玩家昵称
+     */
+    @ApiModelProperty(notes = "玩家昵称")
+    private String nickname;
+
+    /**
+     * 绑定手机号码
+     */
+    @ApiModelProperty(notes = "绑定手机号码")
+    private String mobile;
+
+    /**
+     * 注册IP
+     */
+    @ApiModelProperty(notes = "注册IP")
+    private String regIp;
+
+    /**
+     * 是否实名认证
+     */
+    @ApiModelProperty(notes = "是否实名认证")
+    private Boolean isAuth;
+
+    /**
+     * 玩家手机绑定状态
+     */
+    @ApiModelProperty(notes = "玩家手机绑定状态")
+    private Boolean isBindMobile;
+
+    /**
+     * cp名称对应的id
+     */
+    @ApiModelProperty(notes = "cp名称对应的id")
+    private Long cpId;
+
+    /**
+     * 游戏名称对应的id
+     */
+    @ApiModelProperty(notes = "游戏名称对应的id")
+    private Long gameId;
+
+    /**
+     * 游戏应用类型对应的id
+     */
+    @ApiModelProperty(notes = "游戏应用类型对应的id")
+    private Long gameCategoryId;
+
+    /**
+     * 最近充值开始时间
+     */
+    @ApiModelProperty(notes = "最近充值开始时间")
+    private LocalDate rechargeBeginDate;
+
+    /**
+     * 最近充值结束时间
+     */
+    @ApiModelProperty(notes = "最近充值结束时间")
+    private LocalDate rechargeEndDate;
+
+    /**
+     * 是否充值
+     */
+    @ApiModelProperty(notes = "是否充值, true : 是, false : 否")
+    private Boolean isRecharge;
+
+    /**
+     * 玩家状态, 0 : 正常, 1 : 封禁
+     */
+    @ApiModelProperty(notes = "玩家状态, 0 : 正常, 1 : 封禁")
+    private Integer status;
+
+    /**
+     * 注册渠道对应的id
+     */
+    @ApiModelProperty(notes = "注册渠道对应的id")
+    private Long channelId;
+
+    /**
+     * 归因推广账号
+     */
+    @ApiModelProperty(notes = "归因推广账号")
+    private String accountId;
+
+    /**
+     * 归因投放人员
+     */
+    @ApiModelProperty(notes = "归因投放人员")
+    private String pitcherId;
+
     /**
      * 注册开始时间
      */
-    @ApiModelProperty("注册开始时间")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty(value = "注册开始时间")
     private LocalDate beginDate;
 
     /**
      * 注册结束时间
      */
-    @ApiModelProperty("注册结束时间")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty(value = "注册结束时间")
     private LocalDate endDate;
 
+    @ApiModelProperty("充值到注册的最小间隔时间(分)")
+    private Long regPayIntervalTimeMin;
+
+    @ApiModelProperty("充值到注册的最大间隔时间(分)")
+    private Long regPayIntervalTimeMax;
+
+    /**
+     * 是否创角
+     */
+    @ApiModelProperty(notes = "是否创角")
+    private Boolean createRole;
+
+    /**
+     * 角色数量最小值
+     */
+    @ApiModelProperty(notes = "角色数量最小值")
+    private Integer roleCountMin;
+
+    /**
+     * 角色数量最大值
+     */
+    @ApiModelProperty(notes = "角色数量最大值")
+    private Integer roleCountMax;
+
+    /**
+     * 排序字段
+     */
+    @ApiModelProperty("排序字段")
+    private String sortFiled;
+
+    /**
+     * 排序方式
+     */
+    @ApiModelProperty("排序方式")
+    private String sortType;
+
+    /**
+     * SDK来源
+     */
+    @ApiModelProperty("SDK来源")
+    private String sourceSystem;
+
 }

+ 0 - 28
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/PlayerDataListTotalDTO.java

@@ -1,28 +0,0 @@
-package com.zanxiang.game.data.serve.pojo.dto;
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import java.time.LocalDate;
-
-/**
- * @author tianhua
- * @time 2023/9/6
- * @Description 前端玩家列表总计查询参数实体
- **/
-@Data
-public class PlayerDataListTotalDTO {
-
-    /**
-     * 注册开始时间
-     */
-    @ApiModelProperty("注册开始时间")
-    private LocalDate beginDate;
-
-    /**
-     * 注册结束时间
-     */
-    @ApiModelProperty("注册结束时间")
-    private LocalDate endDate;
-
-}

+ 160 - 4
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/PlayerRoleDataListDTO.java

@@ -1,8 +1,10 @@
 package com.zanxiang.game.data.serve.pojo.dto;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.zanxiang.game.data.serve.pojo.base.BasePage;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.time.LocalDate;
 
@@ -15,15 +17,169 @@ import java.time.LocalDate;
 public class PlayerRoleDataListDTO extends BasePage {
 
     /**
-     * 注册开始时间
+     * 玩家id
+     */
+    @ApiModelProperty(notes = "玩家id")
+    private Long userId;
+
+    /**
+     * 玩家账号
+     */
+    @ApiModelProperty(notes = "玩家账号")
+    private String userName;
+
+    /**
+     * 玩家昵称
+     */
+    @ApiModelProperty(notes = "玩家昵称")
+    private String nickname;
+
+    /**
+     * 注册IP
+     */
+    @ApiModelProperty(notes = "注册IP")
+    private String regIp;
+
+    /**
+     * 游戏区服
+     */
+    @ApiModelProperty(notes = "游戏区服")
+    private String serverName;
+
+    /**
+     * 游戏角色
+     */
+    @ApiModelProperty(notes = "游戏角色")
+    private String roleName;
+
+    /**
+     * cp名称对应的id
+     */
+    @ApiModelProperty(notes = "cp名称对应的id")
+    private Long cpId;
+
+    /**
+     * 游戏名称对应的id
+     */
+    @ApiModelProperty(notes = "游戏名称对应的id")
+    private Long gameId;
+
+    /**
+     * 游戏应用类型对应的id
+     */
+    @ApiModelProperty(notes = "游戏应用类型对应的id")
+    private Long gameCategoryId;
+
+    /**
+     * 注册渠道对应的id
+     */
+    @ApiModelProperty(notes = "注册渠道对应的id")
+    private Long channelId;
+
+    /**
+     * 归因推广账号
+     */
+    @ApiModelProperty(notes = "归因推广账号")
+    private String accountId;
+
+    /**
+     * 归因投放人员
+     */
+    @ApiModelProperty(notes = "归因投放人员")
+    private String pitcherId;
+
+    /**
+     * 操作系统对应的id
+     */
+    @ApiModelProperty(notes = "操作系统对应的id, 全部 : null或者不传")
+    private String os;
+
+    /**
+     * 是否充值
+     */
+    @ApiModelProperty(notes = "是否充值, true : 是, false : 否, 全部 : null或者不传")
+    private Boolean isRecharge;
+
+    /**
+     * 角色vip
+     */
+    @ApiModelProperty(notes = "角色vip, 全部 : null或者不传")
+    private Integer vipLevel;
+
+    /**
+     * 最近充值开始时间
+     */
+    @ApiModelProperty(notes = "最近充值开始时间")
+    private LocalDate rechargeBeginDate;
+
+    /**
+     * 最近充值结束时间
      */
-    @ApiModelProperty("注册开始时间")
+    @ApiModelProperty(notes = "最近充值结束时间")
+    private LocalDate rechargeEndDate;
+
+    /**
+     * 角色创建开始时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty(value = "角色创建开始时间")
     private LocalDate beginDate;
 
     /**
-     * 注册结束时间
+     * 角色创建结束时间
      */
-    @ApiModelProperty("注册结束时间")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @ApiModelProperty(value = "角色创建结束时间")
     private LocalDate endDate;
 
+    /**
+     * 最小角色等级
+     */
+    @ApiModelProperty(value = "最小角色等级")
+    private Long roleLevelMin;
+
+    /**
+     * 最大角色等级
+     */
+    @ApiModelProperty(value = "最大角色等级")
+    private Long roleLevelMax;
+
+    /**
+     * 注册开始时间
+     */
+    @ApiModelProperty(value = "注册开始时间")
+    private LocalDate regTimeBeginDate;
+
+    /**
+     * 注册结束时间
+     */
+    @ApiModelProperty(value = "注册结束时间")
+    private LocalDate regTimeEndDate;
+
+    @ApiModelProperty("充值到注册的间隔时间(分)")
+    private Long regPayIntervalTimeMin;
+
+    @ApiModelProperty("充值到注册的间隔时间(分)")
+    private Long regPayIntervalTimeMax;
+
+    /**
+     * 排序字段
+     */
+    @ApiModelProperty("排序字段")
+    private String sortFiled;
+
+    /**
+     * 排序方式
+     */
+    @ApiModelProperty("排序方式")
+    private String sortType;
+
+    /**
+     * SDK来源
+     */
+    @ApiModelProperty("SDK来源")
+    private String sourceSystem;
+
 }

+ 0 - 28
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/dto/PlayerRoleDataListTotalDTO.java

@@ -1,28 +0,0 @@
-package com.zanxiang.game.data.serve.pojo.dto;
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import java.time.LocalDate;
-
-/**
- * @author tianhua
- * @time 2023/9/6
- * @Description 前端玩家角色列表总计查询参数实体
- **/
-@Data
-public class PlayerRoleDataListTotalDTO {
-
-    /**
-     * 注册开始时间
-     */
-    @ApiModelProperty("注册开始时间")
-    private LocalDate beginDate;
-
-    /**
-     * 注册结束时间
-     */
-    @ApiModelProperty("注册结束时间")
-    private LocalDate endDate;
-
-}

+ 243 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/entity/TGameUser.java

@@ -0,0 +1,243 @@
+package com.zanxiang.game.data.serve.pojo.entity;
+
+import lombok.Data;
+import org.nutz.dao.entity.annotation.Column;
+import org.nutz.dao.entity.annotation.PK;
+import org.nutz.dao.entity.annotation.Table;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+@Data
+@Table(TGameUser.TABLE_NAME)
+@PK({"sourceSystem", "id"})
+public class TGameUser implements Serializable {
+    private static final long serialVersionUID = 1L;
+    public static final String TABLE_NAME = "dm_game_order.t_game_user";
+     
+    /**
+    * SDK来源
+    */
+    private String sourceSystem;
+    
+    /**
+    * id
+    */
+    private Long id;
+    
+    /**
+    * 用户名
+    */    
+    @Column
+    private String username;
+    
+    /**
+    * 昵称
+    */    
+    @Column
+    private String nickname;
+    
+    /**
+    * 注册手机号
+    */    
+    @Column
+    private String regMobile;
+    
+    /**
+    * 注册邮箱
+    */    
+    @Column
+    private String regEmail;
+    
+    /**
+    * 绑定邮箱
+    */    
+    @Column
+    private String email;
+    
+    /**
+    * 绑定手机号码
+    */    
+    @Column
+    private String mobile;
+    
+    /**
+    * 设备来源 mobile,android,iphone,ipad,web,pc,mac,wxapp
+    */    
+    @Column
+    private String fromDevice;
+    
+    /**
+    * 设备ID android 为imei ios 为idfa
+    */    
+    @Column
+    private String deviceId;
+    
+    /**
+    * 游戏ID
+    */    
+    @Column
+    private Integer gameId;
+    
+    /**
+    * 运营商ID
+    */    
+    @Column
+    private Integer opId;
+    
+    /**
+    * 所属渠道ID
+    */    
+    @Column
+    private Integer agentId;
+    
+    /**
+    * 渠道名称
+    */    
+    @Column
+    private String agentGame;
+    
+    /**
+    * 1 为试玩状态 2为正常状态,3为冻结状态
+    */    
+    @Column
+    private Integer status;
+    
+    /**
+    * 父Id
+    */    
+    @Column
+    private Integer parentMemId;
+    
+    /**
+    * 注册时间
+    */    
+    @Column
+    private LocalDateTime createTime;
+    
+    /**
+    * 更改时间
+    */    
+    @Column
+    private LocalDateTime upLocalDateTimeTime;
+    
+    /**
+    * 是否切换 1 切换 2不切换
+    */    
+    @Column
+    private Integer isSwitch;
+    
+    /**
+    * 切量时间 指定切量时间后的订单都会被切量
+    */    
+    @Column
+    private LocalDateTime switchTime;
+    
+    /**
+    * 切量金额 大于指定切量金额的订单都才被切量
+    */    
+    @Column
+    private Long switchMoney;
+    
+    /**
+    * 累计充值次数
+    */    
+    @Column
+    private Integer rechargeCount;
+    
+    /**
+    * 累计充值金额
+    */    
+    @Column
+    private BigDecimal rechargeMoney;
+    
+    /**
+    * 最近充值时间
+    */    
+    @Column
+    private LocalDateTime lastRechargeTime;
+    
+    /**
+    * 平台币余额
+    */    
+    @Column
+    private Double platformCoin;
+    
+    /**
+    * 创角数
+    */    
+    @Column
+    private Integer roleCount;
+    
+    /**
+    * 是否GS
+    */    
+    @Column
+    private Integer isGs;
+    
+    /**
+    * 拥有角色最高vip
+    */    
+    @Column
+    private Integer vipMax;
+    
+    /**
+    * 广告id
+    */    
+    @Column
+    private String adId;
+    
+    /**
+    * 计划ID
+    */    
+    @Column
+    private String promotionId;
+    
+    /**
+    * 项目ID(广告ID)
+    */    
+    @Column
+    private String projectId;
+    
+    /**
+    * 创意ID
+    */    
+    @Column
+    private String advertiserId;
+    
+    /**
+    * 分享用户id
+    */    
+    @Column
+    private Long shareUserId;
+    
+    /**
+    * 关联用户id
+    */    
+    @Column
+    private Long relationUserId;
+    
+    /**
+    * 关联用户建立时间
+    */    
+    @Column
+    private LocalDateTime relationCreateTime;
+    
+    /**
+    * 来源用户id
+    */    
+    @Column
+    private Long associationUserId;
+    
+    /**
+    * 用户注册IP
+    */    
+    @Column
+    private String ip;
+    
+  
+
+}
+
+

+ 87 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/enums/GameCategoryEnum.java

@@ -0,0 +1,87 @@
+package com.zanxiang.game.data.serve.pojo.enums;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+import java.util.Objects;
+
+/**
+ * @author : tianhua
+ * @time : 2022-09-07
+ * @description : 游戏应用类型
+ */
+@Getter
+@AllArgsConstructor
+public enum GameCategoryEnum {
+
+    /**
+     * 微信小游戏
+     */
+    CATEGORY_WX_APPLET(6L, "wx_applet", "微信小游戏"),
+
+    /**
+     * h5游戏
+     */
+    CATEGORY_H5(5L, "h5", "h5游戏"),
+
+    /**
+     * IOSApp游戏
+     */
+    CATEGORY_IOS_APP(4L, "ios_app", "IOS APP"),
+
+    /**
+     * AndroidApp游戏
+     */
+    CATEGORY_ANDROID_APP(3L, "android_app", "Android APP"),
+
+    /**
+     * 抖音小游戏
+     */
+    CATEGORY_DY_APPLET(2L, "byte_applet", "抖音小游戏"),
+
+    /**
+     * APP
+     */
+    CATEGORY_APP(1L, "app", "APP");
+
+    /**
+     * 应用id
+     */
+    private Long id;
+
+    /**
+     * 游戏分类key
+     */
+    private String categoryKey;
+
+    /**
+     * 描述
+     */
+    private String name;
+
+    /**
+     * 被分类名字
+     *
+     * @param category 类别
+     * @return {@link String}
+     */
+    public static String getNameByCategory(Long category) {
+        GameCategoryEnum gameCategory = GameCategoryEnum.getGameCategory(category);
+        return gameCategory == null ? null : gameCategory.getName();
+    }
+
+    /**
+     * 获取游戏分类
+     *
+     * @param category 类别
+     * @return {@link String}
+     */
+    public static GameCategoryEnum getGameCategory(Long category) {
+        for (GameCategoryEnum gameCategoryEnum : GameCategoryEnum.values()) {
+            if (Objects.equals(gameCategoryEnum.getId(), category)) {
+                return gameCategoryEnum;
+            }
+        }
+        return null;
+    }
+}

+ 188 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/PlayerDataVO.java

@@ -1,9 +1,197 @@
 package com.zanxiang.game.data.serve.pojo.vo;
 
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
 /**
  * @author tianhua
  * @time 2023/9/6
  * @Description 返给前端的玩家列表实体(玩家列表、玩家列表总计使用)
  **/
+@Data
 public class PlayerDataVO {
+
+    /**
+     * 玩家id
+     */
+    @ApiModelProperty(notes = "玩家id")
+    private Long id;
+
+    /**
+     * 玩家账号
+     */
+    @ApiModelProperty(notes = "玩家账号")
+    private String username;
+
+    /**
+     * 玩家昵称
+     */
+    @ApiModelProperty(notes = "玩家昵称")
+    private String nickname;
+
+    /**
+     * 注册IP
+     */
+    @ApiModelProperty(notes = "注册IP")
+    private String regIp;
+
+    /**
+     * 注册时间
+     */
+    @ApiModelProperty(notes = "注册时间")
+    private LocalDateTime createTime;
+
+    /**
+     * 渠道id
+     */
+    @ApiModelProperty(notes = "渠道id")
+    private Long agentId;
+
+    /**
+     * 渠道名称
+     */
+    @ApiModelProperty(notes = "渠道名称")
+    private String agentName;
+
+    /**
+     * cpId
+     */
+    @ApiModelProperty(notes = "cpId")
+    private Long cpId;
+
+    /**
+     * cp名称
+     */
+    @ApiModelProperty(notes = "cp名称")
+    private String cpName;
+
+    /**
+     * 游戏id
+     */
+    @ApiModelProperty(notes = "游戏id")
+    private Long gameId;
+
+    /**
+     * 游戏名称
+     */
+    @ApiModelProperty(notes = "游戏名称")
+    private String gameName;
+
+    /**
+     * 游戏应用类型id
+     */
+    @ApiModelProperty(notes = "游戏应用类型id")
+    private Long gameCategoryId;
+
+    /**
+     * 游戏应用类型名称
+     */
+    @ApiModelProperty(notes = "游戏应用类型名称")
+    private String gameCategoryName;
+
+    /**
+     * 归因投放人员id
+     */
+    @ApiModelProperty(notes = "归因投放人员id")
+    private Long pitcherId;
+
+    /**
+     * 归因投放人员名字
+     */
+    @ApiModelProperty(notes = "归因投放人员名字")
+    private String pitcherName;
+
+    /**
+     * 归因推广账号id
+     */
+    @ApiModelProperty(notes = "归因推广账号id")
+    private Long accountId;
+
+    /**
+     * 归因推广账号类型(1:腾讯、2:头条)
+     */
+    @ApiModelProperty(notes = "归因推广账号类型")
+    private String accountType;
+
+    /**
+     * 绑定手机号码
+     */
+    @ApiModelProperty(notes = "绑定手机号码")
+    private String mobile;
+
+    /**
+     * 充值金额
+     */
+    @ApiModelProperty(notes = "充值金额")
+    private BigDecimal rechargeMoney;
+
+    /**
+     * 充值次数
+     */
+    @ApiModelProperty(notes = "充值次数")
+    private Integer rechargeCount;
+
+    /**
+     * 创角色数
+     */
+    @ApiModelProperty(notes = "创角色数")
+    private Integer roleCount;
+
+    /**
+     * 最近登录时间
+     */
+    @ApiModelProperty(notes = "最近登录时间")
+    private LocalDateTime updateTime;
+
+    /**
+     * 最近充值时间
+     */
+    @ApiModelProperty(notes = "最近充值时间")
+    private LocalDateTime lastRechargeTime;
+
+    /**
+     * 玩家状态, -1 为冻结状态, 1 为试玩状态 2为正常状态
+     */
+    @ApiModelProperty(notes = "玩家状态, -1 为冻结状态, 1 为试玩状态 2为正常状态")
+    private String status;
+
+    /**
+     * 最新游戏角色名称
+     */
+    @ApiModelProperty(notes = "最新游戏角色名称")
+    private String lastGameRoleName;
+
+    /**
+     * 注册充值时间差
+     */
+    @ApiModelProperty(notes = "注册充值时间差")
+    private Long regPayTimeDiff;
+
+    /**
+     * 关联游戏id
+     */
+    @ApiModelProperty(notes = "关联游戏id")
+    private Long relationGameId;
+
+    /**
+     * 关联游戏名称
+     */
+    @ApiModelProperty(notes = "关联游戏名称")
+    private String relationGameName;
+
+    /**
+     * 关联用户id
+     */
+    @ApiModelProperty(notes = "关联用户id")
+    private Long relationUserId;
+
+    /**
+     * 关联建立时间
+     */
+    @ApiModelProperty(notes = "关联建立时间")
+    private LocalDateTime relationCreateTime;
+
 }

+ 212 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/pojo/vo/PlayerRoleDataVO.java

@@ -1,9 +1,221 @@
 package com.zanxiang.game.data.serve.pojo.vo;
 
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
 /**
  * @author tianhua
  * @time 2023/9/6
  * @Description 返给前端的玩家角色列表实体(玩家角色列表、玩家角色列表总计使用)
  **/
+@Data
 public class PlayerRoleDataVO {
+
+    /**
+     * 主键id
+     */
+    @ApiModelProperty(notes = "主键id")
+    private Long id;
+
+    /**
+     * 玩家id
+     */
+    @ApiModelProperty(notes = "玩家id")
+    private Long userId;
+
+    /**
+     * 玩家账号
+     */
+    @ApiModelProperty(notes = "玩家账号")
+    private String username;
+
+    /**
+     * 玩家昵称
+     */
+    @ApiModelProperty(notes = "玩家昵称")
+    private String nickname;
+
+    /**
+     * 注册IP
+     */
+    @ApiModelProperty(notes = "注册IP")
+    private String regIp;
+
+    /**
+     * 玩家注册时间
+     */
+    @ApiModelProperty(notes = "玩家注册时间")
+    private LocalDateTime regTime;
+
+    /**
+     * 注册渠道id
+     */
+    @ApiModelProperty(notes = "注册渠道id")
+    private Long agentId;
+
+    /**
+     * 注册渠道名称
+     */
+    @ApiModelProperty(notes = "注册渠道名称")
+    private String agentName;
+
+    /**
+     * cp标识id
+     */
+    @ApiModelProperty(notes = "cp标识id")
+    private Long cpId;
+
+    /**
+     * cp名称
+     */
+    @ApiModelProperty(notes = "cp名称")
+    private String cpName;
+
+    /**
+     * 游戏id
+     */
+    @ApiModelProperty(notes = "游戏id")
+    private Long gameId;
+
+    /**
+     * 游戏名称
+     */
+    @ApiModelProperty(notes = "游戏名称")
+    private String gameName;
+
+    /**
+     * 游戏应用类型id
+     */
+    @ApiModelProperty(notes = "游戏应用类型id")
+    private Long gameCategoryId;
+
+    /**
+     * 游戏应用类型名称
+     */
+    @ApiModelProperty(notes = "游戏应用类型名称")
+    private String gameCategoryName;
+
+    /**
+     * 原始服务器名称
+     */
+    @ApiModelProperty(notes = "原始服务器名称")
+    private String sourceServerName;
+
+    /**
+     * 游戏区服
+     */
+    @ApiModelProperty(notes = "游戏区服")
+    private String serverName;
+
+    /**
+     * 游戏角色
+     */
+    @ApiModelProperty(notes = "游戏角色")
+    private String roleName;
+
+    /**
+     * 游戏角色id
+     */
+    @ApiModelProperty(notes = "游戏角色id")
+    private String roleId;
+
+    /**
+     * 角色等级
+     */
+    @ApiModelProperty(notes = "角色等级")
+    private Long roleLevel;
+
+    /**
+     * 游戏战力
+     */
+    @ApiModelProperty(notes = "游戏战力")
+    private Long rolePower;
+
+    /**
+     * 角色vip
+     */
+    @ApiModelProperty(notes = "角色vip")
+    private Long roleVipLevel;
+
+    /**
+     * 操作系统
+     */
+    @ApiModelProperty(notes = "操作系统")
+    private String os;
+
+    /**
+     * 充值金额
+     */
+    @ApiModelProperty(notes = "充值金额")
+    private BigDecimal rechargeMoney;
+
+    /**
+     * 平台币余额
+     */
+    @ApiModelProperty(notes = "平台币余额")
+    private BigDecimal platformCoin;
+
+    /**
+     * 充值次数
+     */
+    @ApiModelProperty(notes = "充值次数")
+    private Integer rechargeCount;
+
+    /**
+     * 角色创建时间
+     */
+    @ApiModelProperty(notes = "角色创建时间")
+    private LocalDateTime createTime;
+
+    /**
+     * 最近登录时间
+     */
+    @ApiModelProperty(notes = "最近登录时间")
+    private LocalDateTime lastLoginTime;
+
+    /**
+     * 游戏角色更新时间
+     */
+    @ApiModelProperty(notes = "游戏角色更新时间")
+    private LocalDateTime updateTime;
+
+    /**
+     * 最近充值时间
+     */
+    @ApiModelProperty(notes = "最近充值时间")
+    private LocalDateTime lastRechargeTime;
+
+    /**
+     * 归因投放人员id
+     */
+    @ApiModelProperty(notes = "归因投放人员id")
+    private Long pitcherId;
+
+    /**
+     * 归因投放人员名字
+     */
+    @ApiModelProperty(notes = "归因投放人员名字")
+    private String pitcherName;
+
+    /**
+     * 归因推广账号id
+     */
+    @ApiModelProperty(notes = "归因推广账号id")
+    private Long accountId;
+
+    /**
+     * 归因推广账号类型(1:腾讯、2:头条)
+     */
+    @ApiModelProperty(notes = "归因推广账号类型(1:腾讯、2:头条)")
+    private Integer accountType;
+
+    /**
+     * 注册充值时间差
+     */
+    @ApiModelProperty(notes = "注册充值时间差")
+    private Long regPayTimeDiff;
+
 }

+ 0 - 16
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/IPlayerDataService.java

@@ -1,9 +1,7 @@
 package com.zanxiang.game.data.serve.service;
 
 import com.zanxiang.game.data.serve.pojo.dto.PlayerDataListDTO;
-import com.zanxiang.game.data.serve.pojo.dto.PlayerDataListTotalDTO;
 import com.zanxiang.game.data.serve.pojo.dto.PlayerRoleDataListDTO;
-import com.zanxiang.game.data.serve.pojo.dto.PlayerRoleDataListTotalDTO;
 import com.zanxiang.game.data.serve.pojo.vo.PlayerDataVO;
 import com.zanxiang.game.data.serve.pojo.vo.PlayerRoleDataVO;
 import com.zanxiang.game.data.serve.utils.Page;
@@ -22,13 +20,6 @@ public interface IPlayerDataService {
      */
     Page<PlayerDataVO> getPlayerDataList(PlayerDataListDTO dto);
 
-    /**
-     * 玩家列表总计一栏
-     * @param dto PlayerDataListTotalDTO
-     * @return PlayerDataVO
-     */
-    PlayerDataVO getPlayerDataListTotal(PlayerDataListTotalDTO dto);
-
     /**
      * 玩家角色列表
      * @param dto PlayerRoleDataListDTO
@@ -36,11 +27,4 @@ public interface IPlayerDataService {
      */
     Page<PlayerRoleDataVO> getPlayerRoleDataList(PlayerRoleDataListDTO dto);
 
-    /**
-     * 玩家角色列表总计一栏
-     * @param dto PlayerRoleDataListTotalDTO
-     * @return PlayerRoleDataVO
-     */
-    PlayerRoleDataVO getPlayerRoleDataListTotal(PlayerRoleDataListTotalDTO dto);
-
 }

+ 348 - 18
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/PlayerDataServiceImpl.java

@@ -1,15 +1,29 @@
 package com.zanxiang.game.data.serve.service.impl;
 
+import com.zanxiang.game.data.serve.component.DataPowerComponent;
 import com.zanxiang.game.data.serve.pojo.dto.PlayerDataListDTO;
-import com.zanxiang.game.data.serve.pojo.dto.PlayerDataListTotalDTO;
 import com.zanxiang.game.data.serve.pojo.dto.PlayerRoleDataListDTO;
-import com.zanxiang.game.data.serve.pojo.dto.PlayerRoleDataListTotalDTO;
+import com.zanxiang.game.data.serve.pojo.enums.GameCategoryEnum;
+import com.zanxiang.game.data.serve.pojo.enums.OrderByEnum;
 import com.zanxiang.game.data.serve.pojo.vo.PlayerDataVO;
 import com.zanxiang.game.data.serve.pojo.vo.PlayerRoleDataVO;
 import com.zanxiang.game.data.serve.service.IPlayerDataService;
 import com.zanxiang.game.data.serve.utils.Page;
+import org.apache.commons.lang3.BooleanUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.nutz.dao.Cnd;
+import org.nutz.dao.Dao;
+import org.nutz.dao.Sqls;
+import org.nutz.dao.pager.Pager;
+import org.nutz.dao.sql.Criteria;
+import org.nutz.dao.sql.Sql;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
 /**
  * @author tianhua
  * @time 2023/9/6
@@ -18,6 +32,11 @@ import org.springframework.stereotype.Service;
 @Service
 public class PlayerDataServiceImpl implements IPlayerDataService {
 
+    @Autowired
+    private Dao dao;
+    @Autowired
+    private DataPowerComponent dataPowerComponent;
+
     /**
      * 玩家列表
      * @param dto PlayerDataListDTO
@@ -25,17 +44,145 @@ public class PlayerDataServiceImpl implements IPlayerDataService {
      */
     @Override
     public Page<PlayerDataVO> getPlayerDataList(PlayerDataListDTO dto) {
-        return null;
-    }
+        List<Long> gameIds = dto.getGameId() == null ? dataPowerComponent.getSubGameIdList() : Collections.singletonList(dto.getGameId());
+        List<Long> pitcherIds = StringUtils.isBlank(dto.getPitcherId()) ? dataPowerComponent.getSubUserIdList() : Collections.singletonList(Long.valueOf(dto.getPitcherId()));
 
-    /**
-     * 玩家列表总计一栏
-     * @param dto PlayerDataListTotalDTO
-     * @return PlayerDataVO
-     */
-    @Override
-    public PlayerDataVO getPlayerDataListTotal(PlayerDataListTotalDTO dto) {
-        return null;
+        //创建查询条件
+        Criteria cri = Cnd.cri();
+        if (StringUtils.isNotBlank(dto.getSourceSystem())) {
+            cri.where().andEquals("source_system", dto.getSourceSystem());
+        }
+        if (dto.getUserId() != null) {
+            cri.where().andEquals("id", dto.getUserId());
+        }
+        if (StringUtils.isNotBlank(dto.getUserName())) {
+            cri.where().andLike("user_name", dto.getUserName());
+        }
+        if (StringUtils.isNotBlank(dto.getNickname())) {
+            cri.where().andLike("nick_name", dto.getNickname());
+        }
+        if (StringUtils.isNotBlank(dto.getMobile())) {
+            cri.where().andEquals("mobile", dto.getMobile());
+        }
+        if (StringUtils.isNotBlank(dto.getRegIp())) {
+            cri.where().andEquals("reg_ip", dto.getRegIp());
+        }
+        if (pitcherIds != null) {
+            cri.where().andInList("pitcher_id", pitcherIds);
+        }
+        //判断是否绑定手机
+        if (BooleanUtils.isFalse(dto.getIsBindMobile())) {
+            cri.where().andIsNull("mobile");
+        }
+        if (BooleanUtils.isTrue(dto.getIsBindMobile())) {
+            cri.where().andNotIsNull("mobile").andNotEquals("mobile", "null");
+        }
+        //判断是否实名
+        if (BooleanUtils.isFalse(dto.getIsAuth())) {
+            //未实名
+            cri.where().andEquals("authentication", 0);
+        }
+        if (BooleanUtils.isTrue(dto.getIsAuth())) {
+            //实名
+            cri.where().andInList("authentication", List.of(1L, 2L));
+        }
+        if (dto.getCpId() != null) {
+            cri.where().andEquals("cp_id", dto.getCpId());
+        }
+        if (gameIds != null) {
+            cri.where().andInList("game_id", gameIds);
+        }
+        if (dto.getGameCategoryId() != null) {
+            cri.where().andEquals("game_category_id", dto.getGameCategoryId());
+        }
+        if (dto.getRechargeBeginDate() != null && dto.getRechargeEndDate() != null) {
+            //充值时间
+            cri.where().andBetween("last_recharge_time", dto.getRechargeBeginDate(), dto.getRechargeEndDate());
+        }
+        //判断是否充值
+        if (BooleanUtils.isFalse(dto.getIsRecharge())) {
+            //未充值 充值金额为0
+            cri.where().andEquals("recharge_money", 0);
+        }
+        if (BooleanUtils.isTrue(dto.getIsAuth())) {
+            //充值金额大于0
+            cri.where().andNotEquals("recharge_money", 0);
+        }
+        if (dto.getStatus() != null) {
+            cri.where().andEquals("status", dto.getStatus());
+        }
+        if (dto.getChannelId() != null) {
+            //渠道id
+            cri.where().andEquals("agent_id", dto.getChannelId());
+        }
+        if (StringUtils.isNotBlank(dto.getAccountId())) {
+            cri.where().andEquals("account_id", dto.getAccountId());
+        }
+        if (dto.getBeginDate() != null && dto.getEndDate() != null) {
+            //注册时间
+            cri.where().andBetween("create_time", dto.getBeginDate(), dto.getEndDate());
+        }
+        if (dto.getRegPayIntervalTimeMin() != null) {
+            //充值到注册的最小间隔时间(分)
+            cri.where().andGTE("TIMESTAMPDIFF(MINUTE, create_time, last_recharge_time)", dto.getRegPayIntervalTimeMin());
+        }
+        if (dto.getRegPayIntervalTimeMax() != null) {
+            //充值到注册的最大间隔时间(分)
+            cri.where().andLTE("TIMESTAMPDIFF(MINUTE, create_time, last_recharge_time)", dto.getRegPayIntervalTimeMax());
+        }
+        //判断是否创角
+        if (BooleanUtils.isFalse(dto.getCreateRole())) {
+            //未创角 创角数为0
+            cri.where().andEquals("role_count", 0);
+        }
+        if (BooleanUtils.isTrue(dto.getCreateRole())) {
+            //创角数大于0
+            cri.where().andNotEquals("role_count", 0);
+        }
+        if (dto.getRoleCountMin() != null) {
+            //创角最小数
+            cri.where().andGTE("role_count", dto.getRoleCountMin());
+        }
+        if (dto.getRoleCountMax() != null) {
+            //创角最大数
+            cri.where().andLTE("role_count", dto.getRoleCountMax());
+        }
+
+        //设置pager
+        Pager pager = dao.createPager(dto.getPageNum(), dto.getPageSize());
+        //设置查询的记录数
+        Sql countSql = Sqls.create(getPlayerDataListCountSql() + cri);
+        countSql.setCallback(Sqls.callback.integer());
+        dao.execute(countSql);
+        pager.setRecordCount(countSql.getInt());
+        //默认排序
+        if (StringUtils.isBlank(dto.getSortType())) {
+            dto.setSortType(OrderByEnum.DESC.getOrderType());
+        }
+        if (StringUtils.isBlank(dto.getSortFiled())) {
+            cri.getOrderBy().orderBy("update_time", dto.getSortType());
+        } else {
+            cri.getOrderBy().orderBy(dto.getSortFiled(), dto.getSortFiled());
+        }
+        //创建sql查询数据
+        Sql sql = Sqls.create(getPlayerDataListSql() + cri);
+        //sql设置pager
+        sql.setPager(pager);
+        //设置自定义回传对象
+        sql.setCallback(Sqls.callback.entities());
+        sql.setEntity(dao.getEntity(PlayerDataVO.class));
+        //执行sql
+        dao.execute(sql);
+        //处理结果
+        List<PlayerDataVO> list = sql.getList(PlayerDataVO.class).stream().map(vo -> {
+            //通过枚举得到游戏应用类型名称
+            if (vo.getGameCategoryId() != null) {
+                vo.setGameCategoryName(GameCategoryEnum.getNameByCategory(vo.getGameCategoryId()));
+            }
+            return vo;
+        }).collect(Collectors.toList());
+
+        return new Page<>(list, pager);
     }
 
     /**
@@ -49,13 +196,196 @@ public class PlayerDataServiceImpl implements IPlayerDataService {
     }
 
     /**
-     * 玩家角色列表总计一栏
-     * @param dto PlayerRoleDataListTotalDTO
-     * @return PlayerRoleDataVO
+     * 查询玩家列表数据SQL
+     * @return String
      */
-    @Override
-    public PlayerRoleDataVO getPlayerRoleDataListTotal(PlayerRoleDataListTotalDTO dto) {
-        return null;
+    private String getPlayerDataListSql() {
+        return """
+                SELECT
+                *
+                FROM (
+                    select
+                        a.source_system as source_system ,
+                        a.id as id ,
+                        a.username as username ,
+                        a.nickname as nickname ,
+                        a.ip as reg_ip,
+                        a.create_time as create_time ,
+                        a.agent_id as agent_id ,
+                        if(a.agent_id = 0, '自然量', c.agent_name) as agent_name ,
+                        f.id as cp_id ,
+                        f.cp_name as cp_name ,
+                        a.game_id as game_id ,
+                        e.game_name as game_name ,
+                        e.classify as game_category_id ,
+                        d.zx_pitcher_name as pitcher_name ,
+                        d.zx_pitcher_id as pitcher_id ,
+                        c.account_id as account_id,
+                        c.account_type as account_type,
+                        a.mobile as mobile ,
+                        IFNULL(i.amount, 0) as recharge_money ,
+                        IFNULL(i.amount_count, 0) as recharge_count,
+                        IFNULL(b.role_num, 0) as role_count,
+                        b.create_time as update_time ,
+                        b.last_recharge_time as last_recharge_time,
+                        a.status as status ,
+                        b.role_name as last_game_role_name ,
+                        h.id as relation_game_id ,
+                        h.game_name as relation_game_name ,
+                        a.relation_user_id as relation_user_id ,
+                        a.relation_create_time as relation_create_time ,
+                        TIMESTAMPDIFF(SECOND , a.create_time, b.last_recharge_time) as reg_pay_time_diff
+                    FROM dm_game_order.t_game_user a
+                    left join (
+                        select
+                            a.source_system ,
+                            a.user_id ,
+                            a.role_name ,
+                            a.create_time ,
+                            b.last_recharge_time ,
+                            a.num,
+                            c.role_num
+                            from (
+                                select
+                                        source_system ,
+                                        user_id ,
+                                        role_name ,
+                                        create_time ,
+                                        ROW_NUMBER() OVER(PARTITION BY user_id,source_system order by create_time desc) as num
+                                    from dm_game_order.t_user_login_log
+                                ) a
+                            left join (
+                                select
+                                        source_system as b_source_system,
+                                        user_id as b_user_id,
+                                        role_name as role_name,
+                                        last_recharge_time ,
+                                        ROW_NUMBER() OVER(PARTITION BY user_id,source_system order by last_recharge_time desc) as b_num
+                                from dm_game_order.t_game_user_role
+                                ) b on a.user_id = b.b_user_id and a.source_system = b.b_source_system and a.num= b.b_num
+                            left join (
+                                select
+                                        source_system as c_source_system,
+                                        user_id as c_user_id,
+                                        count(user_id) as role_num
+                                from dm_game_order.t_game_user_role
+                                group by user_id , source_system
+                            ) c on a.user_id = c.c_user_id and a.source_system = c.c_source_system
+                            WHERE a.num = 1
+                    )b on a.id =b.user_id and a.source_system = b.source_system
+                    left join dm_game_order.t_pitcher_agent c on a.agent_id =c.id and a.source_system = c.source_system
+                    left join dm_game_order.t_pitcher_map d on c.pitcher_id =d.zx_pitcher_id and c.source_system = d.source_system
+                    left join dm_game_order.t_game e on a.game_id =e.id  and a.source_system = e.source_system
+                    left join dm_game_order.t_cp f on e.cp_id  =f.id and e.source_system = f.source_system
+                    left join dm_game_order.t_game_user g on a.relation_user_id = g.id and a.source_system = g.source_system
+                    left join dm_game_order.t_game h on g.game_id = h.id and g.source_system = h.source_system
+                    LEFT JOIN (
+                        select
+                            user_id ,
+                            source_system ,
+                            SUM(real_amount) as amount ,
+                            COUNT(user_id) as amount_count
+                        from dm_game_order.t_game_order
+                        group by user_id , source_system
+                    ) i on a.id = i.user_id and a.source_system = i.source_system
+                ) k
+                """;
+    }
+
+    /**
+     * 查询记录的条数SQL
+     * @return String
+     */
+    private String getPlayerDataListCountSql() {
+        return """
+                SELECT
+                    COUNT(1)
+                FROM (
+                    select
+                        a.source_system as source_system ,
+                        a.id as id ,
+                        a.username as username ,
+                        a.nickname as nickname ,
+                        a.ip as reg_ip,
+                        a.create_time as create_time ,
+                        a.agent_id as agent_id ,
+                        if(a.agent_id = 0, '自然量', c.agent_name) as agent_name ,
+                        f.id as cp_id ,
+                        f.cp_name as cp_name ,
+                        a.game_id as game_id ,
+                        e.game_name as game_name ,
+                        e.classify as game_category_id ,
+                        d.zx_pitcher_name as pitcher_name ,
+                        d.zx_pitcher_id as pitcher_id ,
+                        c.account_id as account_id,
+                        c.account_type as account_type,
+                        a.mobile as mobile ,
+                        IFNULL(i.amount, 0) as recharge_money ,
+                        IFNULL(i.amount_count, 0) as recharge_count,
+                        IFNULL(b.role_num, 0) as role_count,
+                        b.create_time as update_time ,
+                        b.last_recharge_time as last_recharge_time,
+                        a.status as status ,
+                        b.role_name as last_game_role_name ,
+                        h.id as relation_game_id ,
+                        h.game_name as relation_game_name ,
+                        a.relation_user_id as relation_user_id ,
+                        a.relation_create_time as relation_create_time
+                    FROM dm_game_order.t_game_user a
+                    left join (
+                        select
+                            a.source_system ,
+                            a.user_id ,
+                            a.role_name ,
+                            a.create_time ,
+                            b.last_recharge_time ,
+                            a.num,
+                            c.role_num
+                            from (
+                                select
+                                        source_system ,
+                                        user_id ,
+                                        role_name ,
+                                        create_time ,
+                                        ROW_NUMBER() OVER(PARTITION BY user_id,source_system order by create_time desc) as num
+                                    from dm_game_order.t_user_login_log
+                                ) a
+                            left join (
+                                select
+                                        source_system as b_source_system,
+                                        user_id as b_user_id,
+                                        role_name as role_name,
+                                        last_recharge_time ,
+                                        ROW_NUMBER() OVER(PARTITION BY user_id,source_system order by last_recharge_time desc) as b_num
+                                from dm_game_order.t_game_user_role
+                                ) b on a.user_id = b.b_user_id and a.source_system = b.b_source_system and a.num= b.b_num
+                            left join (
+                                select
+                                        source_system as c_source_system,
+                                        user_id as c_user_id,
+                                        count(user_id) as role_num
+                                from dm_game_order.t_game_user_role
+                                group by user_id , source_system
+                            ) c on a.user_id = c.c_user_id and a.source_system = c.c_source_system
+                            WHERE a.num = 1
+                    )b on a.id =b.user_id and a.source_system = b.source_system
+                    left join dm_game_order.t_pitcher_agent c on a.agent_id =c.id and a.source_system = c.source_system
+                    left join dm_game_order.t_pitcher_map d on c.pitcher_id =d.zx_pitcher_id and c.source_system = d.source_system
+                    left join dm_game_order.t_game e on a.game_id =e.id  and a.source_system = e.source_system
+                    left join dm_game_order.t_cp f on e.cp_id  =f.id and e.source_system = f.source_system
+                    left join dm_game_order.t_game_user g on a.relation_user_id = g.id and a.source_system = g.source_system
+                    left join dm_game_order.t_game h on g.game_id = h.id and g.source_system = h.source_system
+                    LEFT JOIN (
+                        select
+                            user_id ,
+                            source_system ,
+                            SUM(real_amount) as amount ,
+                            COUNT(user_id) as amount_count
+                        from dm_game_order.t_game_order
+                        group by user_id , source_system
+                    ) i on a.id = i.user_id and a.source_system = i.source_system
+                ) k
+                """;
     }
 
 }