浏览代码

修改代码生成

kk 9 月之前
父节点
当前提交
fc6e2098f0
共有 21 个文件被更改,包括 154 次插入737 次删除
  1. 34 0
      game-business/src/main/java/com/game/business/controller/GameController.java
  2. 67 0
      game-business/src/main/java/com/game/business/domain/AppGameBetting.java
  3. 0 64
      game-business/src/main/java/com/game/business/domain/GameLottery.java
  4. 0 75
      game-business/src/main/java/com/game/business/domain/GameRecord.java
  5. 0 43
      game-business/src/main/java/com/game/business/domain/GameType.java
  6. 8 0
      game-business/src/main/java/com/game/business/mapper/AppGameBettingMapper.java
  7. 0 44
      game-business/src/main/java/com/game/business/mapper/GameLotteryMapper.java
  8. 0 36
      game-business/src/main/java/com/game/business/mapper/GameRecordMapper.java
  9. 0 43
      game-business/src/main/java/com/game/business/mapper/GameTypeMapper.java
  10. 0 42
      game-business/src/main/java/com/game/business/service/GameLotteryService.java
  11. 0 34
      game-business/src/main/java/com/game/business/service/GameRecordService.java
  12. 0 42
      game-business/src/main/java/com/game/business/service/GameTypeService.java
  13. 7 0
      game-business/src/main/java/com/game/business/service/IAppGameBettingService.java
  14. 11 0
      game-business/src/main/java/com/game/business/service/impl/AppGameBettingServiceImpl.java
  15. 0 36
      game-business/src/main/java/com/game/business/service/impl/GameLotteryServiceImpl.java
  16. 0 31
      game-business/src/main/java/com/game/business/service/impl/GameRecordServiceImpl.java
  17. 0 36
      game-business/src/main/java/com/game/business/service/impl/GameTypeServiceImpl.java
  18. 27 42
      game-business/src/main/java/com/game/business/websocket/client/GameOneClient.java
  19. 0 57
      game-business/src/main/resources/mapper/business/GameLotteryMapper.xml
  20. 0 51
      game-business/src/main/resources/mapper/business/GameRecordMapper.xml
  21. 0 61
      game-business/src/main/resources/mapper/business/GameTypeMapper.xml

+ 34 - 0
game-business/src/main/java/com/game/business/controller/GameController.java

@@ -0,0 +1,34 @@
+package com.game.business.controller;
+
+import com.game.business.domain.GameBetting;
+import com.game.common.core.controller.BaseController;
+import com.game.common.core.domain.AjaxResult;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/game/record")
+public class GameController extends BaseController{
+
+    /**
+     * 下注
+     */
+    @PostMapping(value = "/betting")
+    public AjaxResult betting(@RequestBody GameBetting gameBetting)
+    {
+        // 获取用户金额,判断投注金额是否大于余额
+        if(gameBetting.getBettingAmount() > 0){
+            return error("余额不足,投注失败。");
+        }
+
+        // 投注时间判断,根据游戏ID和期号,查询游戏开奖剩余时间
+        if(gameBetting.getBettingAmount() > 0){
+            return error("已超过投注下单时间");
+        }
+
+        // 插入投注记录
+    }
+
+}

+ 67 - 0
game-business/src/main/java/com/game/business/domain/AppGameBetting.java

@@ -0,0 +1,67 @@
+package com.game.business.domain;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.game.common.annotation.Excel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+@TableName(value = "app_game_betting")
+public class AppGameBetting {
+
+    @ApiModelProperty(value = "游戏投注Id")
+    @TableId(value = "id" , type = IdType.AUTO)
+    @Excel(name = "游戏投注Id", cellType = Excel.ColumnType.NUMERIC, prompt = "游戏投注Id")
+    private Long id;
+
+    @Excel(name = "游戏Id")
+    @TableField(value = "game_id")
+    @ApiModelProperty(value = "游戏Id")
+    private Long gameId;
+
+    @Excel(name = "用户ID")
+    @TableField(value = "user_id")
+    @ApiModelProperty(value = "用户ID")
+    private Long userId;
+
+    @Excel(name = "游戏期号")
+    @TableField(value = "game_date")
+    @ApiModelProperty(value = "游戏期号")
+    private String gameDate;
+
+    @Excel(name = "投注选项")
+    @TableField(value = "betting_item")
+    @ApiModelProperty(value = "投注选项")
+    private String bettingItem;
+
+    @Excel(name = "投注选项倍数")
+    @TableField(value = "betting_multiple")
+    @ApiModelProperty(value = "投注选项倍数")
+    private Integer bettingMultiple;
+
+    @Excel(name = "投注金额")
+    @TableField(value = "betting_amount")
+    @ApiModelProperty(value = "投注金额")
+    private Double bettingAmount;
+
+    @Excel(name = "是否中奖:0:未开奖 1:是 2:否")
+    @TableField(value = "is_winning")
+    @ApiModelProperty(value = "是否中奖:0:未开奖 1:是 2:否")
+    private Integer isWinning;
+
+    @Excel(name = "投注时间")
+    @TableField(value = "create_time")
+    @ApiModelProperty(value = "投注时间")
+    private Date createTime;
+
+    @Excel(name = "开奖时间")
+    @TableField(value = "update_time")
+    @ApiModelProperty(value = "投注时间")
+    private Date updateTime;
+
+}

+ 0 - 64
game-business/src/main/java/com/game/business/domain/GameLottery.java

@@ -1,64 +0,0 @@
-package com.game.business.domain;
-
-import com.game.common.annotation.Excel;
-
-public class GameLottery {
-
-    private static final long serialVersionUID = 1L;
-
-    /** 游戏开奖Id */
-    @Excel(name = "游戏开奖Id", cellType = Excel.ColumnType.NUMERIC, prompt = "游戏开奖ID")
-    private Long gameLotteryId;
-
-    @Excel(name = "游戏类型Id")
-    private Long gameTypeId;
-
-    @Excel(name = "游戏期号")
-    private String gameDate;
-
-    @Excel(name = "游戏开奖时间")
-    private String gameLotteryDate;
-
-    @Excel(name = "游戏开奖结果")
-    private String gameLotterySucc;
-
-    public Long getGameLotteryId() {
-        return gameLotteryId;
-    }
-
-    public void setGameLotteryId(Long gameLotteryId) {
-        this.gameLotteryId = gameLotteryId;
-    }
-
-    public Long getGameTypeId() {
-        return gameTypeId;
-    }
-
-    public void setGameTypeId(Long gameTypeId) {
-        this.gameTypeId = gameTypeId;
-    }
-
-    public String getGameDate() {
-        return gameDate;
-    }
-
-    public void setGameDate(String gameDate) {
-        this.gameDate = gameDate;
-    }
-
-    public String getGameLotteryDate() {
-        return gameLotteryDate;
-    }
-
-    public void setGameLotteryDate(String gameLotteryDate) {
-        this.gameLotteryDate = gameLotteryDate;
-    }
-
-    public String getGameLotterySucc() {
-        return gameLotterySucc;
-    }
-
-    public void setGameLotterySucc(String gameLotterySucc) {
-        this.gameLotterySucc = gameLotterySucc;
-    }
-}

+ 0 - 75
game-business/src/main/java/com/game/business/domain/GameRecord.java

@@ -1,75 +0,0 @@
-package com.game.business.domain;
-
-import com.game.common.annotation.Excel;
-
-public class GameRecord {
-
-    private static final long serialVersionUID = 1L;
-
-    /** 游戏开奖Id */
-    @Excel(name = "游戏记录Id", cellType = Excel.ColumnType.NUMERIC, prompt = "游戏记录Id")
-    private Long gameRecordId;
-
-    @Excel(name = "游戏类型Id")
-    private Long gameTypeId;
-
-    @Excel(name = "游戏期号")
-    private String gameDate;
-
-    @Excel(name = "是否为开奖:0:否 1:是")
-    private Integer isLottery;
-
-    @Excel(name = "游戏记录时间")
-    private String gameRecordDate;
-
-    @Excel(name = "游戏开奖结果")
-    private String gameLotterySucc;
-
-    public Long getGameRecordId() {
-        return gameRecordId;
-    }
-
-    public void setGameRecordId(Long gameRecordId) {
-        this.gameRecordId = gameRecordId;
-    }
-
-    public Long getGameTypeId() {
-        return gameTypeId;
-    }
-
-    public void setGameTypeId(Long gameTypeId) {
-        this.gameTypeId = gameTypeId;
-    }
-
-    public String getGameDate() {
-        return gameDate;
-    }
-
-    public void setGameDate(String gameDate) {
-        this.gameDate = gameDate;
-    }
-
-    public Integer getIsLottery() {
-        return isLottery;
-    }
-
-    public void setIsLottery(Integer isLottery) {
-        this.isLottery = isLottery;
-    }
-
-    public String getGameRecordDate() {
-        return gameRecordDate;
-    }
-
-    public void setGameRecordDate(String gameRecordDate) {
-        this.gameRecordDate = gameRecordDate;
-    }
-
-    public String getGameLotterySucc() {
-        return gameLotterySucc;
-    }
-
-    public void setGameLotterySucc(String gameLotterySucc) {
-        this.gameLotterySucc = gameLotterySucc;
-    }
-}

+ 0 - 43
game-business/src/main/java/com/game/business/domain/GameType.java

@@ -1,43 +0,0 @@
-package com.game.business.domain;
-
-import com.game.common.annotation.Excel;
-import com.game.common.core.domain.BaseEntity;
-
-public class GameType extends BaseEntity {
-
-    private static final long serialVersionUID = 1L;
-
-    /** 游戏类型ID */
-    @Excel(name = "游戏类型ID", cellType = Excel.ColumnType.NUMERIC, prompt = "游戏类型ID")
-    private Long gameTypeId;
-
-    @Excel(name = "游戏名称")
-    private String gameTypeName;
-
-    @Excel(name = "游戏编码")
-    private String gameTypeCode;
-
-    public Long getGameTypeId() {
-        return gameTypeId;
-    }
-
-    public void setGameTypeId(Long gameTypeId) {
-        this.gameTypeId = gameTypeId;
-    }
-
-    public String getGameTypeName() {
-        return gameTypeName;
-    }
-
-    public void setGameTypeName(String gameTypeName) {
-        this.gameTypeName = gameTypeName;
-    }
-
-    public String getGameTypeCode() {
-        return gameTypeCode;
-    }
-
-    public void setGameTypeCode(String gameTypeCode) {
-        this.gameTypeCode = gameTypeCode;
-    }
-}

+ 8 - 0
game-business/src/main/java/com/game/business/mapper/AppGameBettingMapper.java

@@ -0,0 +1,8 @@
+package com.game.business.mapper;
+
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.game.business.domain.AppGameBetting;
+
+public interface AppGameBettingMapper extends BaseMapper<AppGameBetting> {
+}

+ 0 - 44
game-business/src/main/java/com/game/business/mapper/GameLotteryMapper.java

@@ -1,44 +0,0 @@
-package com.game.business.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.game.business.domain.GameLottery;
-
-import java.util.List;
-
-public interface GameLotteryMapper extends BaseMapper<GameLottery> {
-
-
-    /**
-     * 新增开奖信息
-     *
-     * @param gameLottery 开奖信息
-     * @return 结果
-     */
-    public int insertGameLottery(GameLottery gameLottery);
-
-    /**
-     * 修改开奖信息
-     *
-     * @param gameLottery 开奖信息
-     * @return 结果
-     */
-    public int updateGameLottery(GameLottery gameLottery);
-
-
-    /**
-     * 根据条件查询开奖列表
-     *
-     * @param gameLottery 开奖信息
-     * @return 结果
-     */
-    public List<GameLottery> selectGameLotteryList(GameLottery gameLottery);
-
-    /**
-     * 根据条件查询开奖信息
-     *
-     * @param gameLottery 开奖信息
-     * @return 结果
-     */
-    public GameLottery selectGameLottery(GameLottery gameLottery);
-
-}

+ 0 - 36
game-business/src/main/java/com/game/business/mapper/GameRecordMapper.java

@@ -1,36 +0,0 @@
-package com.game.business.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.game.business.domain.GameRecord;
-
-import java.util.List;
-
-public interface GameRecordMapper extends BaseMapper<GameRecord> {
-
-    /**
-     * 新增游戏推送信息
-     *
-     * @param gameRecord 游戏推送信息
-     * @return 结果
-     */
-    public int insertGameRecord(GameRecord gameRecord);
-
-
-    /**
-     * 根据条件查询游戏推送列表
-     *
-     * @param gameRecord 游戏推送信息
-     * @return 结果
-     */
-    public List<GameRecord> selectGameLotteryList(GameRecord gameRecord);
-
-    /**
-     * 根据条件查询游戏推送信息
-     *
-     * @param gameRecord 游戏推送信息
-     * @return 结果
-     */
-    public GameRecord selectGameRecord(GameRecord gameRecord);
-
-
-}

+ 0 - 43
game-business/src/main/java/com/game/business/mapper/GameTypeMapper.java

@@ -1,43 +0,0 @@
-package com.game.business.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.game.business.domain.GameType;
-
-import java.util.List;
-
-public interface GameTypeMapper extends BaseMapper<GameType> {
-
-    /**
-     * 新增游戏信息
-     *
-     * @param gameType 游戏信息
-     * @return 结果
-     */
-    public int insertGameType(GameType gameType);
-
-    /**
-     * 修改游戏信息
-     *
-     * @param gameType 游戏信息
-     * @return 结果
-     */
-    public int updateGameType(GameType gameType);
-
-
-    /**
-     * 根据条件查询游戏列表
-     *
-     * @param gameType 游戏信息
-     * @return 结果
-     */
-    public List<GameType> selectGameTypeList(GameType gameType);
-
-    /**
-     * 根据条件查询游戏信息
-     *
-     * @param gameType 游戏信息
-     * @return 结果
-     */
-    public GameType selectGameType(GameType gameType);
-
-}

+ 0 - 42
game-business/src/main/java/com/game/business/service/GameLotteryService.java

@@ -1,42 +0,0 @@
-package com.game.business.service;
-
-import com.game.business.domain.GameLottery;
-
-import java.util.List;
-
-public interface GameLotteryService {
-
-
-    /**
-     * 新增开奖信息
-     *
-     * @param gameLottery 开奖信息
-     * @return 结果
-     */
-    public int insertGameLottery(GameLottery gameLottery);
-
-    /**
-     * 修改开奖信息
-     *
-     * @param gameLottery 开奖信息
-     * @return 结果
-     */
-    public int updateGameLottery(GameLottery gameLottery);
-
-    /**
-     * 根据条件查询开奖列表
-     *
-     * @param gameLottery 开奖信息
-     * @return 结果
-     */
-    public List<GameLottery> selectGameLotteryList(GameLottery gameLottery);
-
-    /**
-     * 根据条件查询开奖信息
-     *
-     * @param gameLottery 开奖信息
-     * @return 结果
-     */
-    public GameLottery selectGameLottery(GameLottery gameLottery);
-
-}

+ 0 - 34
game-business/src/main/java/com/game/business/service/GameRecordService.java

@@ -1,34 +0,0 @@
-package com.game.business.service;
-
-import com.game.business.domain.GameRecord;
-
-import java.util.List;
-
-public interface GameRecordService {
-
-    /**
-     * 新增游戏推送信息
-     *
-     * @param gameRecord 游戏推送信息
-     * @return 结果
-     */
-    public int insertGameRecord(GameRecord gameRecord);
-
-
-    /**
-     * 根据条件查询游戏推送列表
-     *
-     * @param gameRecord 游戏推送信息
-     * @return 结果
-     */
-    public List<GameRecord> selectGameLotteryList(GameRecord gameRecord);
-
-    /**
-     * 根据条件查询游戏推送信息
-     *
-     * @param gameRecord 游戏推送信息
-     * @return 结果
-     */
-    public GameRecord selectGameRecord(GameRecord gameRecord);
-
-}

+ 0 - 42
game-business/src/main/java/com/game/business/service/GameTypeService.java

@@ -1,42 +0,0 @@
-package com.game.business.service;
-
-import com.game.business.domain.GameType;
-
-import java.util.List;
-
-public interface GameTypeService {
-
-    /**
-     * 新增游戏信息
-     *
-     * @param gameType 游戏信息
-     * @return 结果
-     */
-    public int insertGameType(GameType gameType);
-
-    /**
-     * 修改游戏信息
-     *
-     * @param gameType 游戏信息
-     * @return 结果
-     */
-    public int updateGameType(GameType gameType);
-
-
-    /**
-     * 根据条件查询游戏列表
-     *
-     * @param gameType 游戏信息
-     * @return 结果
-     */
-    public List<GameType> selectGameTypeList(GameType gameType);
-
-    /**
-     * 根据条件查询游戏信息
-     *
-     * @param gameType 游戏信息
-     * @return 结果
-     */
-    public GameType selectGameType(GameType gameType);
-
-}

+ 7 - 0
game-business/src/main/java/com/game/business/service/IAppGameBettingService.java

@@ -0,0 +1,7 @@
+package com.game.business.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.game.business.domain.AppGameBetting;
+
+public interface IAppGameBettingService extends IService<AppGameBetting> {
+}

+ 11 - 0
game-business/src/main/java/com/game/business/service/impl/AppGameBettingServiceImpl.java

@@ -0,0 +1,11 @@
+package com.game.business.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.game.business.domain.AppGameBetting;
+import com.game.business.mapper.AppGameBettingMapper;
+import com.game.business.service.IAppGameBettingService;
+import org.springframework.stereotype.Service;
+
+@Service
+public class AppGameBettingServiceImpl extends ServiceImpl<AppGameBettingMapper, AppGameBetting> implements IAppGameBettingService {
+}

+ 0 - 36
game-business/src/main/java/com/game/business/service/impl/GameLotteryServiceImpl.java

@@ -1,36 +0,0 @@
-package com.game.business.service.impl;
-
-import com.game.business.domain.GameLottery;
-import com.game.business.mapper.GameLotteryMapper;
-import com.game.business.service.GameLotteryService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-@Service
-public class GameLotteryServiceImpl implements GameLotteryService {
-
-    @Autowired
-    private GameLotteryMapper gameLotteryMapper;
-
-    @Override
-    public int insertGameLottery(GameLottery gameLottery) {
-        return gameLotteryMapper.insertGameLottery(gameLottery);
-    }
-
-    @Override
-    public int updateGameLottery(GameLottery gameLottery) {
-        return gameLotteryMapper.updateGameLottery(gameLottery);
-    }
-
-    @Override
-    public List<GameLottery> selectGameLotteryList(GameLottery gameLottery) {
-        return gameLotteryMapper.selectGameLotteryList(gameLottery);
-    }
-
-    @Override
-    public GameLottery selectGameLottery(GameLottery gameLottery) {
-        return gameLotteryMapper.selectGameLottery(gameLottery);
-    }
-}

+ 0 - 31
game-business/src/main/java/com/game/business/service/impl/GameRecordServiceImpl.java

@@ -1,31 +0,0 @@
-package com.game.business.service.impl;
-
-import com.game.business.domain.GameRecord;
-import com.game.business.mapper.GameRecordMapper;
-import com.game.business.service.GameRecordService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-@Service
-public class GameRecordServiceImpl implements GameRecordService {
-
-    @Autowired
-    private GameRecordMapper gameRecordMapper;
-
-    @Override
-    public int insertGameRecord(GameRecord gameRecord) {
-        return gameRecordMapper.insertGameRecord(gameRecord);
-    }
-
-    @Override
-    public List<GameRecord> selectGameLotteryList(GameRecord gameRecord) {
-        return gameRecordMapper.selectGameLotteryList(gameRecord);
-    }
-
-    @Override
-    public GameRecord selectGameRecord(GameRecord gameRecord) {
-        return gameRecordMapper.selectGameRecord(gameRecord);
-    }
-}

+ 0 - 36
game-business/src/main/java/com/game/business/service/impl/GameTypeServiceImpl.java

@@ -1,36 +0,0 @@
-package com.game.business.service.impl;
-
-import com.game.business.domain.GameType;
-import com.game.business.mapper.GameTypeMapper;
-import com.game.business.service.GameTypeService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-@Service
-public class GameTypeServiceImpl implements GameTypeService {
-
-    @Autowired
-    private GameTypeMapper gameTypeMapper;
-
-    @Override
-    public int insertGameType(GameType gameType) {
-        return gameTypeMapper.insertGameType(gameType);
-    }
-
-    @Override
-    public int updateGameType(GameType gameType) {
-        return gameTypeMapper.updateGameType(gameType);
-    }
-
-    @Override
-    public List<GameType> selectGameTypeList(GameType gameType) {
-        return gameTypeMapper.selectGameTypeList(gameType);
-    }
-
-    @Override
-    public GameType selectGameType(GameType gameType) {
-        return gameTypeMapper.selectGameType(gameType);
-    }
-}

+ 27 - 42
game-business/src/main/java/com/game/business/websocket/client/GameOneClient.java

@@ -2,12 +2,6 @@ package com.game.business.websocket.client;
 
 import com.alibaba.fastjson2.JSONObject;
 import com.game.business.config.GameOneConfig;
-import com.game.business.domain.GameLottery;
-import com.game.business.domain.GameRecord;
-import com.game.business.domain.GameType;
-import com.game.business.service.GameLotteryService;
-import com.game.business.service.GameRecordService;
-import com.game.business.service.GameTypeService;
 import com.game.business.util.Common;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -19,15 +13,6 @@ import javax.websocket.*;
 @ClientEndpoint
 public class GameOneClient {
 
-    @Autowired
-    private GameTypeService gameTypeService;
-
-    @Autowired
-    private GameRecordService gameRecordService;
-
-    @Autowired
-    private GameLotteryService gameLotteryService;
-
     @OnOpen
     public void onOpen(Session session) throws Exception{
         System.out.printf("game one 游戏已连接 server");
@@ -75,33 +60,33 @@ public class GameOneClient {
                 return;
             }
 
-            GameType gameType = new GameType();
-            gameType.setGameTypeCode(code);
-            GameType dbGameType = gameTypeService.selectGameType(gameType);
-            if(dbGameType == null){
-                System.out.printf("game one 游戏类型数据库不匹配");
-                return;
-            }
-
-            GameRecord record = JSONObject.parseObject(message, GameRecord.class);
-            record.setGameTypeId(dbGameType.getGameTypeId());
-            gameRecordService.insertGameRecord(record);
-
-            GameLottery gameLottery = new GameLottery();
-            gameLottery.setGameTypeId(dbGameType.getGameTypeId());
-            gameLottery.setGameDate(record.getGameDate());
-
-            GameLottery dbGameLottery = gameLotteryService.selectGameLottery(gameLottery);
-
-            if(dbGameLottery == null){
-                gameLotteryService.insertGameLottery(gameLottery);
-            }else{
-                if(record.getIsLottery() == 1) {
-                    dbGameLottery.setGameLotteryDate(record.getGameRecordDate());
-                    dbGameLottery.setGameLotterySucc(record.getGameLotterySucc());
-                    gameLotteryService.updateGameLottery(dbGameLottery);
-                }
-            }
+//            GameType gameType = new GameType();
+//            gameType.setGameTypeCode(code);
+//            GameType dbGameType = gameTypeService.selectGameType(gameType);
+//            if(dbGameType == null){
+//                System.out.printf("game one 游戏类型数据库不匹配");
+//                return;
+//            }
+//
+//            GameRecord record = JSONObject.parseObject(message, GameRecord.class);
+//            record.setGameTypeId(dbGameType.getGameTypeId());
+//            gameRecordService.insertGameRecord(record);
+//
+//            GameLottery gameLottery = new GameLottery();
+//            gameLottery.setGameTypeId(dbGameType.getGameTypeId());
+//            gameLottery.setGameDate(record.getGameDate());
+//
+//            GameLottery dbGameLottery = gameLotteryService.selectGameLottery(gameLottery);
+//
+//            if(dbGameLottery == null){
+//                gameLotteryService.insertGameLottery(gameLottery);
+//            }else{
+//                if(record.getIsLottery() == 1) {
+//                    dbGameLottery.setGameLotteryDate(record.getGameRecordDate());
+//                    dbGameLottery.setGameLotterySucc(record.getGameLotterySucc());
+//                    gameLotteryService.updateGameLottery(dbGameLottery);
+//                }
+//            }
         }catch (Exception e){
             e.printStackTrace();
             System.out.printf("game one 接收数据异常[" + e.getMessage() + "]");

+ 0 - 57
game-business/src/main/resources/mapper/business/GameLotteryMapper.xml

@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.game.business.mapper.GameLotteryMapper">
-
-    <resultMap type="GameLottery" id="GameLotteryResult">
-        <id     property="gameLotteryId"       column="game_lottery_id"      />
-        <result property="gameTypeId"          column="game_type_id"      />
-        <result property="gameDate"            column="game_date"    />
-        <result property="gameLotteryDate"     column="game_lottery_date"        />
-        <result property="gameLotterySucc"     column="game_lottery_succ"  />
-    </resultMap>
-
-   <select id="selectGameLotteryList" parameterType="GameLottery" resultMap="GameLotteryResult">
-        select * from game_lottery where 1 = 1
-        <if test="gameLotteryId != null and gameLotteryId != 0">
-            AND game_lottery_id = #{gameLotteryId}
-        </if>
-        <if test="gameTypeId != null and gameTypeId != 0">
-            AND game_type_id = #{gameLotteryId}
-        </if>
-        <if test="gameDate != null and gameDate != ''">
-            AND game_date = #{gameDate}
-        </if>
-    </select>
-
-    <select id="selectGameLottery" parameterType="GameLottery" resultMap="GameLotteryResult">
-        select * from game_lottery where 1 = 1
-        <if test="gameLotteryId != null and gameLotteryId != 0">
-            AND game_lottery_id = #{gameLotteryId}
-        </if>
-        <if test="gameTypeId != null and gameTypeId != 0">
-            AND game_type_id = #{gameLotteryId}
-        </if>
-        <if test="gameDate != null and gameDate != ''">
-            AND game_date = #{gameDate}
-        </if>
-    </select>
-
-    <insert id="insertGameLottery" parameterType="GameLottery" useGeneratedKeys="true" keyProperty="gameLotteryId">
-        insert into game_lottery(
-        game_type_id, game_date, game_lottery_date, game_lottery_succ
-        )values(
-        #{gameTypeId}, #{gameDate}, #{gameLotteryDate}, #{gameLotterySucc}
-        )
-    </insert>
-
-    <update id="updateGameLottery" parameterType="GameLottery">
-        update game_lottery
-        <set>
-            <if test="gameTypeId != null and gameTypeId != 0">game_type_id = #{gameTypeId},</if>
-            <if test="gameDate != null and gameDate != ''">user_name = #{gameDate},</if>
-            <if test="gameLotteryDate != null and gameLotteryDate != ''">game_lottery_date = #{gameLotteryDate},</if>
-            <if test="gameLotterySucc != null and gameLotterySucc != ''">game_lottery_succ = #{gameLotterySucc},</if>
-        </set>
-        where game_lottery_id = #{gameLotteryId}
-    </update>
-</mapper>

+ 0 - 51
game-business/src/main/resources/mapper/business/GameRecordMapper.xml

@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.game.business.mapper.GameRecordMapper">
-
-    <resultMap type="GameRecord" id="GameRecordResult">
-        <id     property="gameRecordId"       column="game_record_id"      />
-        <result property="gameTypeId"          column="game_type_id"      />
-        <result property="gameDate"            column="game_date"    />
-        <result property="isLottery"           column="is_lottery"    />
-        <result property="gameRecordDate"     column="game_record_date"        />
-        <result property="gameLotterySucc"     column="game_lottery_succ"  />
-    </resultMap>
-
-    <select id="selectGameRecordList" parameterType="GameRecord" resultMap="GameRecordResult">
-        select * from game_record where 1 = 1
-        <if test="gameLotteryId != null and gameLotteryId != 0">
-            AND game_lottery_id = #{gameLotteryId}
-        </if>
-        <if test="gameTypeId != null and gameTypeId != 0">
-            AND game_type_id = #{gameLotteryId}
-        </if>
-        <if test="gameDate != null and gameDate != ''">
-            AND game_date = #{gameDate}
-        </if>
-        <if test="isLottery != null">
-            AND is_lottery = #{isLottery}
-        </if>
-    </select>
-
-    <select id="selectGameRecord" parameterType="GameRecord" resultMap="GameRecordResult">
-        select * from game_record where 1 = 1
-        <if test="gameLotteryId != null and gameLotteryId != 0">
-            AND game_lottery_id = #{gameLotteryId}
-        </if>
-        <if test="gameTypeId != null and gameTypeId != 0">
-            AND game_type_id = #{gameLotteryId}
-        </if>
-        <if test="gameDate != null and gameDate != ''">
-            AND game_date = #{gameDate}
-        </if>
-    </select>
-
-    <insert id="insertGameRecord" parameterType="GameLottery" useGeneratedKeys="true" keyProperty="gameRecordId">
-        insert into game_record(
-            game_type_id, game_date, is_lottery, game_record_date, game_lottery_succ
-        )values(
-            #{gameTypeId},  #{gameDate},  #{isLottery},  #{gameRecordDate}, #{gameLotterySucc}
-        )
-    </insert>
-
-</mapper>

+ 0 - 61
game-business/src/main/resources/mapper/business/GameTypeMapper.xml

@@ -1,61 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.game.business.mapper.GameTypeMapper">
-
-    <resultMap type="GameType" id="GameTypeResult">
-        <id     property="gameTypeId"            column="game_type_id"      />
-        <result property="gameTypeName"          column="game_type_name"      />
-        <result property="gameTypeCode"          column="game_type_code"    />
-    </resultMap>
-
-    <select id="selectGameTypeList" parameterType="GameType" resultMap="GameTypeResult">
-        select * from game_type where 1 = 1
-        <if test="gameTypeId != null and gameTypeId != 0">
-            AND game_type_id = #{gameTypeId}
-        </if>
-        <if test="gameTypeName != null and gameTypeName != ''">
-            AND game_type_name like concat('%', #{gameTypeName}, '%')
-        </if>
-        <if test="gameTypeCode != null and gameTypeCode != ''">
-            AND game_type_code like concat('%', #{gameTypeCode}, '%')
-        </if>
-    </select>
-
-    <select id="selectGameType" parameterType="GameType" resultMap="GameTypeResult">
-        select * from game_type where 1 = 1
-        <if test="gameTypeId != null and gameTypeId != 0">
-            AND game_type_id = #{gameTypeId}
-        </if>
-        <if test="gameTypeName != null and gameTypeName != ''">
-            AND game_type_name like concat('%', #{gameTypeName}, '%')
-        </if>
-        <if test="gameTypeCode != null and gameTypeCode != ''">
-            AND game_type_code like concat('%', #{gameTypeCode}, '%')
-        </if>
-    </select>
-
-    <insert id="insertGameType" parameterType="GameType" useGeneratedKeys="true" keyProperty="gameTypeId">
-        insert into game_type(
-            game_type_name, game_type_code,
-            <if test="createBy != null and createBy != ''">create_by,</if>
-            <if test="remark != null and remark != ''">remark,</if>
-            create_time
-        )values(
-            #{gameTypeName}, #{gameTypeCode},
-            <if test="createBy != null and createBy != ''">#{createBy},</if>
-            <if test="remark != null and remark != ''">#{remark},</if>
-            sysdate()
-        )
-    </insert>
-
-    <update id="updateGameType" parameterType="GameType">
-        update game_lottery
-        <set>
-            <if test="gameTypeName != null and gameTypeName != ''">game_type_name = #{gameTypeName},</if>
-            <if test="gameTypeCode != null and gameTypeCode != ''">game_type_code = #{gameTypeCode},</if>
-            update_time = sysdate()
-        </set>
-        where game_type_id = #{gameTypeId}
-    </update>
-
-</mapper>