suochencheng vor 7 Jahren
Ursprung
Commit
a716389104

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/BindGameMapper.java

@@ -0,0 +1,33 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.BindGame;
+
+
+/**
+*  Dao接口
+*/
+@Repository("com.zoumaframe.dao.BindGameMapper")
+public interface BindGameMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(BindGame record);
+
+    BindGame selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(BindGame record);
+
+    List<BindGame> queryAllBindGame(BindGame record);
+
+    List<BindGame> queryBindGameByPage(Map<String, Object> parameter);
+
+    int delete(BindGame record);
+
+    BindGame queryBindGame(BindGame record);
+
+    List<BindGame> query(BindGame record);
+}
+

+ 460 - 0
src/main/java/com/izouma/awesomeadmin/dao/BindGameMapper.xml

@@ -0,0 +1,460 @@
+<?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.izouma.awesomeadmin.dao.BindGameMapper">
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.BindGame">
+        <id column="id" property="id" jdbcType="INTEGER"/>
+        <result column="del_flag" property="delFlag" jdbcType="CHAR"/>
+        <result column="update_time" property="updateTime" jdbcType="TIMESTAMP"/>
+        <result column="update_user" property="updateUser" jdbcType="VARCHAR"/>
+        <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
+        <result column="create_user" property="createUser" jdbcType="VARCHAR"/>
+        <result column="game_id" property="gameId" jdbcType="INTEGER"/>
+        <result column="user_id" property="userId" jdbcType="INTEGER"/>
+        <result column="nick_name" property="nickName" jdbcType="VARCHAR"/>
+        <result column="remark" property="remark" jdbcType="VARCHAR"/>
+        <result column="use_flag" property="useFlag" jdbcType="CHAR"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        <trim suffixOverrides=",">
+            id,
+
+            del_flag,
+
+            update_time,
+
+            update_user,
+
+            create_time,
+
+            create_user,
+
+            game_id,
+
+            user_id,
+
+            nick_name,
+
+            remark,
+
+            use_flag,
+
+        </trim>
+    </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
+        select
+        <include refid="Base_Column_List"/>
+        from bind_game
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+        delete from bind_game
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.BindGame" useGeneratedKeys="true"
+            keyProperty="id">
+        insert into bind_game
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id!= null">
+                id,
+            </if>
+            <if test="delFlag!= null">
+                del_flag,
+            </if>
+            <if test="updateTime!= null">
+                update_time,
+            </if>
+            <if test="updateUser!= null">
+                update_user,
+            </if>
+            <if test="createTime!= null">
+                create_time,
+            </if>
+            <if test="createUser!= null">
+                create_user,
+            </if>
+            <if test="gameId!= null">
+                game_id,
+            </if>
+            <if test="userId!= null">
+                user_id,
+            </if>
+            <if test="nickName!= null">
+                nick_name,
+            </if>
+            <if test="remark!= null">
+                remark,
+            </if>
+            <if test="useFlag!= null">
+                use_flag,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">
+                #{id,jdbcType=INTEGER},
+            </if>
+            <if test="delFlag != null">
+                #{delFlag,jdbcType=CHAR},
+            </if>
+            <if test="updateTime != null">
+                #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateUser != null">
+                #{updateUser,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime != null">
+                #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="createUser != null">
+                #{createUser,jdbcType=VARCHAR},
+            </if>
+            <if test="gameId != null">
+                #{gameId,jdbcType=INTEGER},
+            </if>
+            <if test="userId != null">
+                #{userId,jdbcType=INTEGER},
+            </if>
+            <if test="nickName != null">
+                #{nickName,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="useFlag != null">
+                #{useFlag,jdbcType=CHAR},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.BindGame">
+        update bind_game
+        <set>
+            <if test="id != null">
+                id= #{id,jdbcType=INTEGER},
+            </if>
+            <if test="delFlag != null">
+                del_flag= #{delFlag,jdbcType=CHAR},
+            </if>
+            <if test="updateTime != null">
+                update_time= #{updateTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="updateUser != null">
+                update_user= #{updateUser,jdbcType=VARCHAR},
+            </if>
+            <if test="createTime != null">
+                create_time= #{createTime,jdbcType=TIMESTAMP},
+            </if>
+            <if test="createUser != null">
+                create_user= #{createUser,jdbcType=VARCHAR},
+            </if>
+            <if test="gameId != null">
+                game_id= #{gameId,jdbcType=INTEGER},
+            </if>
+            <if test="userId != null">
+                user_id= #{userId,jdbcType=INTEGER},
+            </if>
+            <if test="nickName != null">
+                nick_name= #{nickName,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                remark= #{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="useFlag != null">
+                use_flag= #{useFlag,jdbcType=CHAR},
+            </if>
+        </set>
+        where
+        <if test="id != null and !&quot;&quot;.equals(id)">
+            id = #{id,jdbcType=INTEGER}
+        </if>
+
+        <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+            id in (${idStr})
+        </if>
+
+    </update>
+    <select id="queryBindGameByPage" parameterType="java.util.Map" resultMap="PageBindGameResult">
+        select
+        <include refid="Base_Column_List"/>
+        from bind_game
+        <where>
+            and del_flag = 'N'
+            <if test="record.idStr != null and !&quot;&quot;.equals(record.idStr)">
+                and id in (${record.idStr})
+            </if>
+            <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and id = #{record.id}
+            </if>
+            <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and del_flag = #{record.delFlag}
+            </if>
+            <if test="record.updateTime != null and !&quot;&quot;.equals(record.updateTime)">
+                and update_time = #{record.updateTime}
+            </if>
+            <if test="record.updateUser != null and !&quot;&quot;.equals(record.updateUser)">
+                and update_user = #{record.updateUser}
+            </if>
+            <if test="record.createTime != null and !&quot;&quot;.equals(record.createTime)">
+                and create_time = #{record.createTime}
+            </if>
+            <if test="record.createUser != null and !&quot;&quot;.equals(record.createUser)">
+                and create_user = #{record.createUser}
+            </if>
+            <if test="record.gameId != null and !&quot;&quot;.equals(record.gameId)">
+                and game_id = #{record.gameId}
+            </if>
+            <if test="record.userId != null and !&quot;&quot;.equals(record.userId)">
+                and user_id = #{record.userId}
+            </if>
+            <if test="record.nickName != null and !&quot;&quot;.equals(record.nickName)">
+                and nick_name = #{record.nickName}
+            </if>
+            <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
+                and remark = #{record.remark}
+            </if>
+            <if test="record.useFlag != null and !&quot;&quot;.equals(record.useFlag)">
+                and use_flag = #{record.useFlag}
+            </if>
+            <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR game_id LIKE concat('%',#{record.searchKey},'%')
+                    OR user_id LIKE concat('%',#{record.searchKey},'%')
+                    OR nick_name LIKE concat('%',#{record.searchKey},'%')
+                    OR remark LIKE concat('%',#{record.searchKey},'%')
+                    OR use_flag LIKE concat('%',#{record.searchKey},'%')
+                </trim>
+            </if>
+
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+        </where>
+        order by
+
+        <if test="record.orderByStr != null and !&quot;&quot;.equals(record.orderByStr)">
+
+
+            <trim suffixOverrides=",">
+                <foreach item="item" index="index" separator="," collection="record.orderByStr.split('_;')">
+                    <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                        ${itemDetail}
+                    </foreach>
+                </foreach>
+            </trim>
+            ,
+        </if>
+        id desc
+    </select>
+    <select id="queryAllBindGame" parameterType="java.util.Map" resultMap="PageBindGameResult">
+        select
+        <include refid="Base_Column_List"/>
+        from bind_game
+        <where>
+            and del_flag = 'N'
+            <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+                and id in (${idStr})
+            </if>
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+            <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
+                and update_time = #{updateTime}
+            </if>
+            <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
+                and update_user = #{updateUser}
+            </if>
+            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
+                and create_time = #{createTime}
+            </if>
+            <if test="createUser != null and !&quot;&quot;.equals(createUser)">
+                and create_user = #{createUser}
+            </if>
+            <if test="gameId != null and !&quot;&quot;.equals(gameId)">
+                and game_id = #{gameId}
+            </if>
+            <if test="userId != null and !&quot;&quot;.equals(userId)">
+                and user_id = #{userId}
+            </if>
+            <if test="nickName != null and !&quot;&quot;.equals(nickName)">
+                and nick_name = #{nickName}
+            </if>
+            <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and remark = #{remark}
+            </if>
+            <if test="useFlag != null and !&quot;&quot;.equals(useFlag)">
+                and use_flag = #{useFlag}
+            </if>
+            <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR">
+                    OR game_id LIKE concat('%',#{searchKey},'%')
+                    OR user_id LIKE concat('%',#{searchKey},'%')
+                    OR nick_name LIKE concat('%',#{searchKey},'%')
+                    OR remark LIKE concat('%',#{searchKey},'%')
+                    OR use_flag LIKE concat('%',#{searchKey},'%')
+                </trim>
+            </if>
+            <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+                <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+        </where>
+        order by
+
+        <if test="orderByStr != null and !&quot;&quot;.equals(orderByStr)">
+
+
+            <trim suffixOverrides=",">
+                <foreach item="item" index="index" separator="," collection="orderByStr.split('_;')">
+                    <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                        ${itemDetail}
+                    </foreach>
+                </foreach>
+            </trim>
+            ,
+        </if>
+
+        id desc
+    </select>
+    <select id="queryBindGame" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.BindGame">
+        select
+        <include refid="Base_Column_List"/>
+        from bind_game
+        <where>
+            and del_flag = 'N'
+            <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+            <if test="updateTime != null and !&quot;&quot;.equals(updateTime)">
+                and update_time = #{updateTime}
+            </if>
+            <if test="updateUser != null and !&quot;&quot;.equals(updateUser)">
+                and update_user = #{updateUser}
+            </if>
+            <if test="createTime != null and !&quot;&quot;.equals(createTime)">
+                and create_time = #{createTime}
+            </if>
+            <if test="createUser != null and !&quot;&quot;.equals(createUser)">
+                and create_user = #{createUser}
+            </if>
+            <if test="gameId != null and !&quot;&quot;.equals(gameId)">
+                and game_id = #{gameId}
+            </if>
+            <if test="userId != null and !&quot;&quot;.equals(userId)">
+                and user_id = #{userId}
+            </if>
+            <if test="nickName != null and !&quot;&quot;.equals(nickName)">
+                and nick_name = #{nickName}
+            </if>
+            <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and remark = #{remark}
+            </if>
+            <if test="useFlag != null and !&quot;&quot;.equals(useFlag)">
+                and use_flag = #{useFlag}
+            </if>
+
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE bind_game SET del_flag = 'Y'
+        where
+        <if test="id != null and !&quot;&quot;.equals(id)">
+            id = #{id,jdbcType=INTEGER}
+        </if>
+
+        <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+            id in (${idStr})
+        </if>
+    </update>
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.BindGame">
+        select
+        <include refid="Base_Column_List"/>
+        from bind_game
+        <where>
+            and del_flag = 'N'
+        </where>
+        order by id desc
+    </select>
+
+    <resultMap id="PageBindGameResult" type="com.izouma.awesomeadmin.model.BindGame" extends="BaseResultMap">
+
+        <association property="userInfo"
+                     javaType="com.izouma.awesomeadmin.model.UserInfo"
+                     select="com.izouma.awesomeadmin.dao.UserInfoMapper.querySingleUserInfo"
+                     column="{ id = user_id }"/>
+
+        <association property="gameInfo"
+                     javaType="com.izouma.awesomeadmin.model.GameInfo"
+                     select="com.izouma.awesomeadmin.dao.GameInfoMapper.queryGameInfo"
+                     column="{ id = game_id }"/>
+
+    </resultMap>
+
+</mapper>
+

+ 6 - 9
src/main/java/com/izouma/awesomeadmin/dao/HouseInfoMapper.xml

@@ -863,16 +863,13 @@
         FROM
             `house_info`
         WHERE
-            del_flag = 'N'
+        del_flag = 'N'
         AND use_flag = 'Y'
-        AND status_flag = 0
-        AND (
-            player_number = max_number
-            OR DATE_SUB(
-                CURRENT_TIMESTAMP(),
-                INTERVAL 10 MINUTE
-            )  <![CDATA[>=]]> create_time
-        )
+        AND status_flag = 2
+        AND DATE_SUB(
+        CURRENT_TIMESTAMP (),
+        INTERVAL 60 MINUTE
+        ) <![CDATA[ >= ]]> begin_time
     </select>
 
     <resultMap id="OneHouseInfoResult" type="com.izouma.awesomeadmin.model.HouseInfo" extends="BaseResultMap">

+ 8 - 3
src/main/java/com/izouma/awesomeadmin/dao/PlayerInfoMapper.java

@@ -1,6 +1,7 @@
 package com.izouma.awesomeadmin.dao;
 
 import java.util.*;
+
 import com.izouma.awesomeadmin.datasource.DataSource;
 import com.izouma.awesomeadmin.model.HouseInfo;
 import org.springframework.stereotype.Repository;
@@ -8,10 +9,10 @@ import com.izouma.awesomeadmin.model.PlayerInfo;
 
 
 /**
-*  Dao接口
-*/
+ * Dao接口
+ */
 @Repository("com.zoumaframe.dao.PlayerInfoMapper")
-public interface PlayerInfoMapper{
+public interface PlayerInfoMapper {
 
     int deleteByPrimaryKey(Integer id);
 
@@ -36,5 +37,9 @@ public interface PlayerInfoMapper{
     int userRank(PlayerInfo record);
 
     List<PlayerInfo> queryNoStartPlayer(HouseInfo record);
+
+    int overTimePlayer(PlayerInfo record);
+
+    List<PlayerInfo> querySettlementPlayer(PlayerInfo record);
 }
 

+ 39 - 0
src/main/java/com/izouma/awesomeadmin/dao/PlayerInfoMapper.xml

@@ -1077,6 +1077,45 @@
 
     </select>
 
+    <select id="querySettlementPlayer" parameterType="java.util.Map"
+            resultType="com.izouma.awesomeadmin.model.PlayerInfo">
+        SELECT
+            *
+        FROM
+            player_info
+        WHERE
+            del_flag = 'N'
+        AND status_flag IN (3, 7)
+        AND house_id = #{houseId}
+
+        order by
+        IFNULL(ranking,999) ,
+        IFNULL(live_time,999) ,
+        id desc
+
+    </select>
+
+
+    <update id="overTimePlayer" parameterType="com.izouma.awesomeadmin.model.PlayerInfo">
+        update player_info set status_flag = 7
+        where
+        <if test="id != null and !&quot;&quot;.equals(id)">
+            id = #{id,jdbcType=INTEGER}
+        </if>
+
+        <if test="houseId != null and !&quot;&quot;.equals(houseId)">
+            house_id = #{houseId,jdbcType=INTEGER}
+        </if>
+
+        <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+            id in (${idStr})
+        </if>
+
+        and del_flag = 'N'
+        and status_flag = 2
+
+    </update>
+
 
     <resultMap id="PagePlayerInfoResult" type="com.izouma.awesomeadmin.model.PlayerInfo" extends="BaseResultMap">
 

+ 178 - 0
src/main/java/com/izouma/awesomeadmin/model/BindGame.java

@@ -0,0 +1,178 @@
+package com.izouma.awesomeadmin.model;
+
+import java.util.*;
+
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+
+@JsonAutoDetect
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class BindGame {
+    private Integer id;
+    private String delFlag;
+    private Date updateTime;
+    private String updateUser;
+    private Date createTime;
+    private String createUser;
+    private Integer gameId;
+    private Integer userId;
+    private String nickName;
+    private String remark;
+    private String useFlag;
+
+    private GameInfo gameInfo;
+
+    private UserInfo userInfo;
+
+    private String idStr;
+
+    private String searchKey;
+
+    /**
+     * and,test_name,like,value;or,remark,=,123
+     */
+    private String advancedQuery;
+
+    /**
+     * column_name_,desc_;column_name_,asc
+     */
+    private String orderByStr;
+
+    public Integer getId() {
+        return this.id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public String getDelFlag() {
+        return this.delFlag;
+    }
+
+    public void setDelFlag(String delFlag) {
+        this.delFlag = delFlag;
+    }
+
+    public Date getUpdateTime() {
+        return this.updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getUpdateUser() {
+        return this.updateUser;
+    }
+
+    public void setUpdateUser(String updateUser) {
+        this.updateUser = updateUser;
+    }
+
+    public Date getCreateTime() {
+        return this.createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getCreateUser() {
+        return this.createUser;
+    }
+
+    public void setCreateUser(String createUser) {
+        this.createUser = createUser;
+    }
+
+    public Integer getGameId() {
+        return this.gameId;
+    }
+
+    public void setGameId(Integer gameId) {
+        this.gameId = gameId;
+    }
+
+    public Integer getUserId() {
+        return this.userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public String getNickName() {
+        return this.nickName;
+    }
+
+    public void setNickName(String nickName) {
+        this.nickName = nickName;
+    }
+
+    public String getRemark() {
+        return this.remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getUseFlag() {
+        return this.useFlag;
+    }
+
+    public void setUseFlag(String useFlag) {
+        this.useFlag = useFlag;
+    }
+
+    public String getSearchKey() {
+        return searchKey;
+    }
+
+    public void setSearchKey(String searchKey) {
+        this.searchKey = searchKey;
+    }
+
+    public String getAdvancedQuery() {
+        return advancedQuery;
+    }
+
+    public void setAdvancedQuery(String advancedQuery) {
+        this.advancedQuery = advancedQuery;
+    }
+
+    public String getOrderByStr() {
+        return orderByStr;
+    }
+
+    public void setOrderByStr(String orderByStr) {
+        this.orderByStr = orderByStr;
+    }
+
+    public String getIdStr() {
+        return idStr;
+    }
+
+    public void setIdStr(String idStr) {
+        this.idStr = idStr;
+    }
+
+    public GameInfo getGameInfo() {
+        return gameInfo;
+    }
+
+    public void setGameInfo(GameInfo gameInfo) {
+        this.gameInfo = gameInfo;
+    }
+
+    public UserInfo getUserInfo() {
+        return userInfo;
+    }
+
+    public void setUserInfo(UserInfo userInfo) {
+        this.userInfo = userInfo;
+    }
+}
+

+ 27 - 0
src/main/java/com/izouma/awesomeadmin/service/BindGameService.java

@@ -0,0 +1,27 @@
+package com.izouma.awesomeadmin.service;
+
+import java.util.*;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.BindGame;
+
+
+/**
+*  service接口类
+*/
+public interface BindGameService{
+
+    List<BindGame> getBindGameList(BindGame record);
+
+    List<BindGame> getBindGameByPage(Page page, BindGame record);
+
+    BindGame getBindGameById(String id);
+
+    BindGame getBindGame(BindGame record);
+
+    boolean createBindGame(BindGame record);
+
+    boolean deleteBindGame(BindGame record);
+
+    boolean updateBindGame(BindGame record);
+}
+

+ 2 - 0
src/main/java/com/izouma/awesomeadmin/service/HouseInfoService.java

@@ -36,5 +36,7 @@ public interface HouseInfoService {
     Result autoEnd(HouseInfo record);
 
     Result autoNoStartPlay(HouseInfo record);
+
+    boolean settlementHouse(HouseInfo houseInfo);
 }
 

+ 8 - 3
src/main/java/com/izouma/awesomeadmin/service/PlayerInfoService.java

@@ -1,15 +1,16 @@
 package com.izouma.awesomeadmin.service;
 
 import java.util.*;
+
 import com.izouma.awesomeadmin.dto.Page;
 import com.izouma.awesomeadmin.model.HouseInfo;
 import com.izouma.awesomeadmin.model.PlayerInfo;
 
 
 /**
-*  service接口类
-*/
-public interface PlayerInfoService{
+ * service接口类
+ */
+public interface PlayerInfoService {
 
     List<PlayerInfo> getPlayerInfoList(PlayerInfo record);
 
@@ -30,5 +31,9 @@ public interface PlayerInfoService{
     int userRank(PlayerInfo record);
 
     List<PlayerInfo> getNoStartPlayer(HouseInfo record);
+
+    boolean overTimePlayer(PlayerInfo playerInfo);
+
+    List<PlayerInfo> getSettlementPlayer(PlayerInfo record);
 }
 

+ 137 - 0
src/main/java/com/izouma/awesomeadmin/service/impl/BindGameServiceImpl.java

@@ -0,0 +1,137 @@
+package com.izouma.awesomeadmin.service.impl;
+
+import java.util.*;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.BindGame;
+import com.izouma.awesomeadmin.service.BindGameService;
+import com.izouma.awesomeadmin.dao.BindGameMapper;
+
+/**
+*  service接口实现类
+*/
+@Service
+public class BindGameServiceImpl implements BindGameService{
+
+    private static Logger logger = Logger.getLogger(BindGameServiceImpl.class);
+
+    @Autowired
+    private BindGameMapper bindGameMapper;
+
+    @Override
+    public List<BindGame> getBindGameList(BindGame record) {
+
+        logger.info("getBindGameList");
+        try {
+
+        return bindGameMapper.queryAllBindGame(record);
+        } catch (Exception e) {
+        logger.error("getBindGameList", e);
+        }
+
+        return null;
+    }
+    @Override
+    public List<BindGame> getBindGameByPage(Page page, BindGame record) {
+
+        logger.info("getBindGameByPage");
+        try {
+
+        Map<String, Object> parameter = new HashMap<String, Object>();
+        parameter.put("record", record);
+        parameter.put(AppConstant.PAGE, page);
+
+        return bindGameMapper.queryBindGameByPage(parameter);
+        } catch (Exception e) {
+        logger.error("getBindGameByPage", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public BindGame getBindGameById(String id) {
+
+        logger.info("getBindGameyId");
+        try {
+
+            return bindGameMapper.selectByPrimaryKey(Integer.valueOf(id));
+        } catch (Exception e) {
+        logger.error("getBindGameById", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public BindGame getBindGame(BindGame record) {
+
+        logger.info("getBindGame");
+        try {
+
+            return bindGameMapper.queryBindGame(record);
+        } catch (Exception e) {
+        logger.error("getBindGame", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public boolean createBindGame(BindGame record) {
+
+        logger.info("createBindGame");
+        try {
+
+            int updates = bindGameMapper.insertSelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+            logger.error("createBindGame", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean deleteBindGame(BindGame record) {
+
+        logger.info("deleteBindGame");
+        try {
+
+             int updates = bindGameMapper.delete(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("deleteBindGame", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean updateBindGame(BindGame record) {
+
+        logger.info("updateBindGame");
+        try {
+
+            int updates = bindGameMapper.updateByPrimaryKeySelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("updateBindGame", e);
+        }
+
+        return false;
+    }
+}
+

+ 65 - 2
src/main/java/com/izouma/awesomeadmin/service/impl/HouseInfoServiceImpl.java

@@ -7,6 +7,7 @@ import com.izouma.awesomeadmin.dto.Result;
 import com.izouma.awesomeadmin.model.*;
 import com.izouma.awesomeadmin.service.*;
 import com.izouma.awesomeadmin.util.MbappUtil;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -166,6 +167,60 @@ public class HouseInfoServiceImpl implements HouseInfoService {
         return false;
     }
 
+    /**
+     * 房间比赛结果结算。
+     *
+     * @param record
+     * @return
+     */
+    @Override
+    public boolean settlementHouse(HouseInfo record) {
+
+        logger.info("settlementHouse");
+
+
+        try {
+
+            HouseInfo houseInfo = new HouseInfo();
+            houseInfo.setId(record.getId());
+            houseInfo = houseInfoMapper.queryHouseInfo(houseInfo);
+
+            if (houseInfo != null) {
+
+                HouseLevel houseLevel = houseInfo.getHouseLevelInfo();
+
+                BigDecimal firstRatio = houseLevel.getFirstRatio();
+                BigDecimal secondRatio = houseLevel.getSecondRatio();
+                BigDecimal thirdRatio = houseLevel.getThirdRatio();
+                BigDecimal feeRatio = houseLevel.getFeeRatio();
+                BigDecimal poolRatio = houseLevel.getPoolRatio();
+
+
+                PlayerInfo param = new PlayerInfo();
+                param.setHouseId(record.getId());
+                List<PlayerInfo> playerInfoList = playerInfoService.getSettlementPlayer(param);
+
+                if (CollectionUtils.isNotEmpty(playerInfoList)) {
+                    for (int i = 0; i < playerInfoList.size(); i++) {
+
+                    }
+                }
+
+                int updates = houseInfoMapper.updateByPrimaryKeySelective(record);
+
+                if (updates > 0) {
+                    return true;
+                }
+            }
+
+
+        } catch (Exception e) {
+            logger.error("settlementHouse", e);
+        }
+
+        return false;
+    }
+
     @Override
     public Result joinHouseInfo(PlayerInfo record) {
 
@@ -309,9 +364,16 @@ public class HouseInfoServiceImpl implements HouseInfoService {
 
             for (HouseInfo houseInfo : houseInfoList) {
 
-                houseInfo.setStatusFlag(AppConstant.HouseStatus.START);
-                houseInfo.setBeginTime(new Date());
+                houseInfo.setStatusFlag(AppConstant.HouseStatus.END);
+                houseInfo.setEndTime(new Date());
                 houseInfoMapper.updateByPrimaryKeySelective(houseInfo);
+
+                //更新比赛超时的
+                PlayerInfo playerInfo = new PlayerInfo();
+                playerInfo.setHouseId(houseInfo.getId());
+                playerInfoService.overTimePlayer(playerInfo);
+
+                settlementHouse(houseInfo);//比赛结果结算。
             }
 
             return new Result(true, "结束成功");
@@ -324,6 +386,7 @@ public class HouseInfoServiceImpl implements HouseInfoService {
         return new Result(false, "开始失败");
     }
 
+
     @Override
     public Result autoNoStartPlay(HouseInfo record) {
 

+ 64 - 26
src/main/java/com/izouma/awesomeadmin/service/impl/PlayerInfoServiceImpl.java

@@ -13,10 +13,10 @@ import com.izouma.awesomeadmin.service.PlayerInfoService;
 import com.izouma.awesomeadmin.dao.PlayerInfoMapper;
 
 /**
-*  service接口实现类
-*/
+ * service接口实现类
+ */
 @Service
-public class PlayerInfoServiceImpl implements PlayerInfoService{
+public class PlayerInfoServiceImpl implements PlayerInfoService {
 
     private static Logger logger = Logger.getLogger(PlayerInfoServiceImpl.class);
 
@@ -29,9 +29,9 @@ public class PlayerInfoServiceImpl implements PlayerInfoService{
         logger.info("getPlayerInfoList");
         try {
 
-        return playerInfoMapper.queryAllPlayerInfo(record);
+            return playerInfoMapper.queryAllPlayerInfo(record);
         } catch (Exception e) {
-        logger.error("getPlayerInfoList", e);
+            logger.error("getPlayerInfoList", e);
         }
 
         return null;
@@ -43,9 +43,23 @@ public class PlayerInfoServiceImpl implements PlayerInfoService{
         logger.info("getNoStartPlayer");
         try {
 
-        return playerInfoMapper.queryNoStartPlayer(record);
+            return playerInfoMapper.queryNoStartPlayer(record);
         } catch (Exception e) {
-        logger.error("getNoStartPlayer", e);
+            logger.error("getNoStartPlayer", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public List<PlayerInfo> getSettlementPlayer(PlayerInfo record) {
+
+        logger.info("getSettlementPlayer");
+        try {
+
+            return playerInfoMapper.querySettlementPlayer(record);
+        } catch (Exception e) {
+            logger.error("getSettlementPlayer", e);
         }
 
         return null;
@@ -57,13 +71,13 @@ public class PlayerInfoServiceImpl implements PlayerInfoService{
         logger.info("getPlayerInfoByPage");
         try {
 
-        Map<String, Object> parameter = new HashMap<String, Object>();
-        parameter.put("record", record);
-        parameter.put(AppConstant.PAGE, page);
+            Map<String, Object> parameter = new HashMap<String, Object>();
+            parameter.put("record", record);
+            parameter.put(AppConstant.PAGE, page);
 
-        return playerInfoMapper.queryPlayerInfoByPage(parameter);
+            return playerInfoMapper.queryPlayerInfoByPage(parameter);
         } catch (Exception e) {
-        logger.error("getPlayerInfoByPage", e);
+            logger.error("getPlayerInfoByPage", e);
         }
 
         return null;
@@ -75,13 +89,13 @@ public class PlayerInfoServiceImpl implements PlayerInfoService{
         logger.info("queryPlayerInfoRankByPage");
         try {
 
-        Map<String, Object> parameter = new HashMap<String, Object>();
-        parameter.put("record", record);
-        parameter.put(AppConstant.PAGE, page);
+            Map<String, Object> parameter = new HashMap<String, Object>();
+            parameter.put("record", record);
+            parameter.put(AppConstant.PAGE, page);
 
-        return playerInfoMapper.queryPlayerInfoRankByPage(parameter);
+            return playerInfoMapper.queryPlayerInfoRankByPage(parameter);
         } catch (Exception e) {
-        logger.error("queryPlayerInfoRankByPage", e);
+            logger.error("queryPlayerInfoRankByPage", e);
         }
 
         return null;
@@ -95,7 +109,7 @@ public class PlayerInfoServiceImpl implements PlayerInfoService{
 
             return playerInfoMapper.selectByPrimaryKey(Integer.valueOf(id));
         } catch (Exception e) {
-        logger.error("getPlayerInfoById", e);
+            logger.error("getPlayerInfoById", e);
         }
 
         return null;
@@ -109,7 +123,7 @@ public class PlayerInfoServiceImpl implements PlayerInfoService{
 
             return playerInfoMapper.queryPlayerInfo(record);
         } catch (Exception e) {
-        logger.error("getPlayerInfo", e);
+            logger.error("getPlayerInfo", e);
         }
 
         return null;
@@ -124,7 +138,7 @@ public class PlayerInfoServiceImpl implements PlayerInfoService{
             return playerInfoMapper.userRank(record);
 
         } catch (Exception e) {
-        logger.error("getPlayerInfo", e);
+            logger.error("getPlayerInfo", e);
         }
 
         return 0;
@@ -139,7 +153,7 @@ public class PlayerInfoServiceImpl implements PlayerInfoService{
             int updates = playerInfoMapper.insertSelective(record);
 
             if (updates > 0) {
-                 return true;
+                return true;
             }
         } catch (Exception e) {
             logger.error("createPlayerInfo", e);
@@ -154,13 +168,13 @@ public class PlayerInfoServiceImpl implements PlayerInfoService{
         logger.info("deletePlayerInfo");
         try {
 
-             int updates = playerInfoMapper.delete(record);
+            int updates = playerInfoMapper.delete(record);
 
             if (updates > 0) {
-                 return true;
+                return true;
             }
         } catch (Exception e) {
-             logger.error("deletePlayerInfo", e);
+            logger.error("deletePlayerInfo", e);
         }
 
         return false;
@@ -175,10 +189,34 @@ public class PlayerInfoServiceImpl implements PlayerInfoService{
             int updates = playerInfoMapper.updateByPrimaryKeySelective(record);
 
             if (updates > 0) {
-                 return true;
+                return true;
+            }
+        } catch (Exception e) {
+            logger.error("updatePlayerInfo", e);
+        }
+
+        return false;
+    }
+
+    /**
+     * 比赛超时
+     *
+     * @param record
+     * @return
+     */
+    @Override
+    public boolean overTimePlayer(PlayerInfo record) {
+
+        logger.info("overTimePlayer");
+        try {
+
+            int updates = playerInfoMapper.overTimePlayer(record);
+
+            if (updates > 0) {
+                return true;
             }
         } catch (Exception e) {
-             logger.error("updatePlayerInfo", e);
+            logger.error("overTimePlayer", e);
         }
 
         return false;

+ 162 - 0
src/main/java/com/izouma/awesomeadmin/web/BindGameController.java

@@ -0,0 +1,162 @@
+package com.izouma.awesomeadmin.web;
+
+import java.util.*;
+
+import com.izouma.awesomeadmin.util.ExportExcelUtil;
+import org.apache.commons.lang.StringUtils;
+import org.apache.shiro.authz.annotation.RequiresAuthentication;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.dto.Result;
+import com.izouma.awesomeadmin.model.BindGame;
+import com.izouma.awesomeadmin.service.BindGameService;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+*  controller类
+*/
+@Controller
+@RequestMapping("/bindGame")
+public class BindGameController {
+
+    @Autowired
+    private BindGameService bindGameService;
+
+    /**
+    * <p>获取全部记录。</p>
+    */
+    @RequiresAuthentication
+    @RequestMapping(value = "/all", method = RequestMethod.GET)
+    @ResponseBody
+    public Result all(BindGame record) {
+        List<BindGame> pp = bindGameService.getBindGameList(record);
+        return new Result(true, pp);
+    }
+
+    /**
+    * <p>根据Id。</p>
+    */
+    @RequestMapping(value = "/getBindGame", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getBindGame(@RequestParam(required = false, value = "id") String id) {
+        BindGame data = bindGameService.getBindGameById(id);
+        return new Result(true, data);
+    }
+
+    /**
+    * <p>根据条件获取。</p>
+    */
+    @RequestMapping(value = "/getOne", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getOne(BindGame record) {
+        BindGame data = bindGameService.getBindGame(record);
+        return new Result(true, data);
+    }
+
+
+    /**
+    * <p>分页查询。</p>
+    */
+    @RequestMapping(value = "/page", method = RequestMethod.GET)
+    @ResponseBody
+    public Result page(Page page, BindGame record) {
+        Map<String, Object> result = new HashMap<>();
+
+        List<BindGame> pp =bindGameService.getBindGameByPage(page, record);
+
+        result.put(AppConstant.PAGE, page);
+        result.put("pp", pp);
+        return new Result(true, result);
+    }
+
+
+    /**
+    * <p>保存。</p>
+    */
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ResponseBody
+    public Result save(BindGame record) {
+        boolean num = bindGameService.createBindGame(record);
+        if (num) {
+        return new Result(true, record.getId());
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>更新信息。</p>
+    */
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    @ResponseBody
+    public Result updateBindGame(BindGame record) {
+        boolean num = bindGameService.updateBindGame(record);
+        if (num) {
+        return new Result(true, "保存成功");
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>删除。</p>
+    */
+    @RequestMapping(value = "/del", method = RequestMethod.POST)
+    @ResponseBody
+    public Result deleteBindGame(BindGame record) {
+
+        boolean num = bindGameService.deleteBindGame(record);
+        if (num) {
+        return new Result(true, "删除成功");
+        }
+        return new Result(false, "删除异常");
+    }
+
+    /**
+    * 导出Excel
+    * @param request
+    * @param response
+    * @param record
+    * @throws Exception
+    */
+    @RequestMapping(value = "/exportExcel", method = RequestMethod.GET)
+    @ResponseBody
+    public void exportExcel(HttpServletRequest request, HttpServletResponse response, BindGame record) throws Exception {
+
+    List<BindGame> bindGames = bindGameService.getBindGameList(record);
+
+
+        String sheetName = "bind_game";
+        String titleName = "绑定游戏数据表";
+        String fileName = "绑定游戏表";
+        int columnNumber = 11;
+        int[] columnWidth = { 20,  20,  20,  20,  20,  20,  20,  20,  20,  20,  20 };
+        String[] columnName = {  "ID" ,   "删除标识" ,   "更新时间" ,   "更新人" ,   "创建时间" ,   "创建人" ,   "游戏ID" ,   "用户" ,   "游戏昵称" ,   "备注" ,   "使用"  };
+        String[][] dataList = new String[bindGames.size()][11];
+
+        for (int i = 0; i < bindGames.size(); i++) {
+
+                        dataList[i][0] = String.valueOf(bindGames.get(i).getId());
+                        dataList[i][1] = String.valueOf(bindGames.get(i).getDelFlag());
+                        dataList[i][2] = String.valueOf(bindGames.get(i).getUpdateTime());
+                        dataList[i][3] = String.valueOf(bindGames.get(i).getUpdateUser());
+                        dataList[i][4] = String.valueOf(bindGames.get(i).getCreateTime());
+                        dataList[i][5] = String.valueOf(bindGames.get(i).getCreateUser());
+                        dataList[i][6] = String.valueOf(bindGames.get(i).getGameId());
+                        dataList[i][7] = String.valueOf(bindGames.get(i).getUserId());
+                        dataList[i][8] = String.valueOf(bindGames.get(i).getNickName());
+                        dataList[i][9] = String.valueOf(bindGames.get(i).getRemark());
+                        dataList[i][10] = String.valueOf(bindGames.get(i).getUseFlag());
+                    }
+
+
+        ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,
+        columnNumber, columnWidth, columnName, dataList, response);
+
+
+        }
+    }
+

+ 117 - 0
src/main/vue/src/pages/BindGame.vue

@@ -0,0 +1,117 @@
+<template>
+    <div>
+        <el-form :model="formData" :rules="rules" ref="form" label-width="80px" label-position="right" size="small"
+                 style="max-width: 500px;">
+                                                                                                                                                                                                                                    <el-form-item prop="gameId" label="游戏ID">
+                <el-input v-model="formData.gameId" :disabled="'gameId'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="userId" label="用户">
+                <el-input v-model="formData.userId" :disabled="'userId'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="nickName" label="游戏昵称">
+                <el-input v-model="formData.nickName" :disabled="'nickName'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="remark" label="备注">
+                <el-input v-model="formData.remark" :disabled="'remark'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                                            <el-form-item prop="useFlag" label="使用">
+                <el-input v-model="formData.useFlag" :disabled="'useFlag'==subColumn"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                        <el-form-item>
+                <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
+                <el-button @click="onDelete" v-if="formData.id" type="danger">删除</el-button>
+                <el-button @click="$router.go(-1)">取消</el-button>
+            </el-form-item>
+        </el-form>
+    </div>
+</template>
+<script>
+    import formValidator from '../formValidator'
+
+    export default {
+        created() {
+            if (this.$route.query.column) {
+                this.subColumn = this.$route.query.column.split(',')[1];
+                this.subValue = this.$route.query.column.split(',')[0];
+            }
+
+            if (this.$route.query.id) {
+                this.$http.get({
+                    url: '/bindGame/getOne',
+                    data: {
+                        id: this.$route.query.id
+                    }
+                }).then(res => {
+                    if (res.success) {
+
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
+                        this.formData = res.data;
+
+                    if (this.$route.query.column) {
+                        this.formData[this.subColumn] = this.subValue;
+                    }
+                    }
+                })
+            }else {
+                if (this.$route.query.column) {
+                    this.formData[this.subColumn] = this.subValue;
+                }
+            }
+
+                                                                                                                                                                                                                                                                                                                                        },
+        data() {
+            return {
+                saving: false,
+                formData: {},
+                rules: {
+                                                                                                                                                                                                                                                                                                                                        },
+                                                                                                    subColumn: '',
+            subValue: '',
+        }
+        },
+        methods: {
+            onSave() {
+                this.$refs.form.validate((valid) => {
+                    if (valid) {
+                        this.submit();
+                    } else {
+                        return false;
+                    }
+                });
+            },
+            submit() {
+                var data = JSON.parse(JSON.stringify(this.formData));
+                this.$http.post({
+                    url: this.formData.id ? '/bindGame/update' : '/bindGame/save',
+                    data: data
+                }).then(res => {
+                    if (res.success) {
+                        this.$message.success('成功');
+                        this.$router.go(-1);
+                    } else {
+                        this.$message.warning('失败')
+                    }
+                });
+            },
+            onDelete() {
+                this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                    return this.$http.post({
+                    url: '/bindGame/del',
+                    data: { id: this.formData.id }
+                    })
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.$router.go(-1);
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
+        }
+    }
+</script>
+<style lang="less" scoped>
+</style>

+ 471 - 0
src/main/vue/src/pages/BindGames.vue

@@ -0,0 +1,471 @@
+<template>
+    <div>
+        <div class="filters-container">
+        
+            <el-input placeholder="关键字" size="small" v-model="filter1" clearable class="filter-item"></el-input>
+            <el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
+            </el-button>
+            <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small"
+                       icon="el-icon-search" class="filter-item">高级查询
+            </el-button>
+            <el-button @click="showTableSortDialog = !showTableSortDialog" type="primary" size="small"
+                       icon="el-icon-sort" class="filter-item">排序
+            </el-button>
+            <el-button @click="$router.push({path:'/bindGame',query:{column:$route.query.column}})" type="primary"
+                       size="small" icon="el-icon-edit"
+                       class="filter-item">添加
+            </el-button>
+            <el-button @click="exportExcel" type="primary" size="small" icon="el-icon-share" class="filter-item">导出EXCEL
+            </el-button>
+            <el-dropdown trigger="click" size="medium" class="table-column-filter">
+                <span>
+                  筛选数据<i class="el-icon-arrow-down el-icon--right"></i>
+                </span>
+                <el-dropdown-menu slot="dropdown" class="table-column-filter-wrapper">
+                    <el-checkbox v-for="item in tableColumns" :key="item.value" v-model="item.show">{{item.label}}
+                    </el-checkbox>
+                </el-dropdown-menu>
+            </el-dropdown>
+        </div>
+        <el-table
+                :data="tableData"
+                :height="tableHeight"
+                row-key="id"
+                ref="table">
+            <el-table-column
+                    v-if="multipleMode"
+                    align="center"
+                    type="selection"
+                    width="50">
+            </el-table-column>
+            <el-table-column
+                    type="index"
+                    min-width="50"
+                    align="center">
+            </el-table-column>
+                                                                                                                                                                                                    
+                                            <el-table-column
+                                v-if="isColumnShow('gameId')"
+                                prop="gameId"
+                                label="游戏ID"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('userId')"
+                                prop="userId"
+                                label="用户"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('nickName')"
+                                prop="nickName"
+                                label="游戏昵称"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('remark')"
+                                prop="remark"
+                                label="备注"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('useFlag')"
+                                prop="useFlag"
+                                label="使用"
+                                min-width="100">
+                        </el-table-column>
+                                                            <el-table-column
+                    label="操作"
+                    align="center"
+                    fixed="right"
+                    min-width="150"
+            >
+                <template slot-scope="scope">
+                            <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
+                    <el-button @click="deleteRow(scope.row)" type="danger" size="mini" plain>删除</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <div class="multiple-mode-wrapper" v-if="0">
+                <el-button size="small" v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
+                <el-button-group v-else>
+                    <el-button size="small" @click="operation1">批量操作1</el-button>
+                    <el-button size="small" @click="operation2">批量操作2</el-button>
+                    <el-button size="small" @click="toggleMultipleMode(false)">取消</el-button>
+                </el-button-group>
+            </div>
+            <el-pagination
+                    background
+                    @size-change="pageSizeChange"
+                    @current-change="currentPageChange"
+                    :current-page="currentPage"
+                    :page-sizes="[10, 20, 30, 40, 50]"
+                    :page-size="pageSize"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="totalNumber">
+            </el-pagination>
+        </div>
+        <el-dialog title="高级查询" :visible.sync="showAdvancedQueryDialog">
+            <el-button @click="addField" type="text" icon="el-icon-plus">添加</el-button>
+            <el-table :data="advancedQueryFields">
+
+                <el-table-column prop="link" label="链接符" align="center">
+                    <template slot-scope="{row}">
+                        <el-select placeholder="链接" size="small" v-model="row.link" class="filter-item">
+                            <el-option label="AND" value="AND">
+                            </el-option>
+                            <el-option label="OR" value="OR">
+                            </el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="name" label="字段" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.name">
+
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value"
+                                       :key="item.value"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="searchMethod" label="搜索方式" width="150" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.searchMethod">
+                            <el-option v-for="item in searchMethods" :label="item" :value="item"
+                                       :key="item"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="value" label="参数" align="center">
+                    <template slot-scope="{row}">
+                        <el-input v-model="row.value"></el-input>
+                    </template>
+                </el-table-column>
+                <el-table-column width="60" align="center">
+                    <template slot-scope="{ row, column, $index }">
+                        <el-button @click="removeField($index)" size="small" type="text">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+
+            <span slot="footer" class="dialog-footer">
+
+                <el-button @click="advancedQuery" :loading="$store.state.fetchingData">确定</el-button>
+            </span>
+        </el-dialog>
+
+        <el-dialog title="排序" :visible.sync="showTableSortDialog">
+            <el-button @click="addSortField" type="text" icon="el-icon-plus">添加</el-button>
+            <el-table :data="tableSortFields">
+
+                <el-table-column prop="name" label="字段" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.name">
+
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value"
+                                       :key="item.value"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="order" label="排序" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.order">
+                            <el-option label="降序" value="desc">
+                            </el-option>
+                            <el-option label="升序" value="asc">
+                            </el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column width="60" align="center">
+                    <template slot-scope="{ row, column, $index }">
+                        <el-button @click="removeSortField($index)" size="small" type="text">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+
+            <span slot="footer" class="dialog-footer">
+
+                <el-button @click="tableSortQuery" :loading="$store.state.fetchingData">确定</el-button>
+            </span>
+        </el-dialog>
+
+        <el-dialog title="查看图片" :visible.sync="imageDialogVisible" size="small">
+            <img width="100%" :src="imgSrc" alt="">
+        </el-dialog>
+
+    </div>
+</template>
+<script>
+    import {mapState} from 'vuex'
+    import {format} from 'date-fns'
+    import zh from 'date-fns/locale/zh_cn'
+
+    export default {
+        created() {
+            this.getData();
+        },
+        data() {
+            return {
+                totalNumber: 0,
+                totalPage: 10,
+                currentPage: 1,
+                pageSize: 20,
+                tableData: [],
+                filter1: '',
+                filter2: '',
+                tableColumns: [
+                                                                                                                                                                                                                                                                                                                                                {
+                                label: '游戏ID',
+                                value: 'gameId',
+                                show: true
+                            },
+                                                                                                {
+                                label: '用户',
+                                value: 'userId',
+                                show: true
+                            },
+                                                                                                {
+                                label: '游戏昵称',
+                                value: 'nickName',
+                                show: true
+                            },
+                                                                                                {
+                                label: '备注',
+                                value: 'remark',
+                                show: true
+                            },
+                                                                                                {
+                                label: '使用',
+                                value: 'useFlag',
+                                show: true
+                            },
+                                                            ],
+                multipleMode: false,
+                showAdvancedQueryDialog: false,
+                advancedQueryFields: [],
+                showTableSortDialog: false,
+                tableSortFields: [],
+                searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
+                advancedQueryColumns: [
+                                                                                                                                                                                                                                                                                                                                                {
+                                label: '游戏ID',
+                                value: 'game_id'
+                            },
+                                                                                                {
+                                label: '用户',
+                                value: 'user_id'
+                            },
+                                                                                                {
+                                label: '游戏昵称',
+                                value: 'nick_name'
+                            },
+                                                                                                {
+                                label: '备注',
+                                value: 'remark'
+                            },
+                                                                                                {
+                                label: '使用',
+                                value: 'use_flag'
+                            },
+                                                            ],
+                advancedQuerySearchKey: '',
+                orderByStr: '',
+                imgSrc: '',
+                imageDialogVisible: false,
+            }
+        },
+        computed: {
+            ...mapState(['tableHeight']),
+            selection() {
+                return this.$refs.table.selection.map(i => i.id);
+            }
+        },
+        methods: {
+            pageSizeChange(size) {
+                this.currentPage = 1;
+                this.pageSize = size;
+                this.getData();
+            },
+            currentPageChange(page) {
+                this.currentPage = page;
+                this.getData();
+            },
+            getData() {
+
+                var data = {
+                    currentPage: this.currentPage,
+                    pageNumber: this.pageSize,
+                    searchKey: this.filter1,
+                    advancedQuery: this.advancedQuerySearchKey,
+                    orderByStr: this.orderByStr,
+                }
+
+                if (this.$route.query.column) {
+                    var tempColumn = this.$route.query.column;
+                    data[tempColumn.split(',')[1]] = tempColumn.split(',')[0];
+                }
+
+                this.$http.get({
+                    url: '/bindGame/page',
+                    data: data
+                }).then(res => {
+                    if (res.success) {
+                        this.totalNumber = res.data.page.totalNumber;
+                        this.tableData = res.data.pp;
+                    }
+                })
+            },
+            isColumnShow(column) {
+                var row = this.tableColumns.find(i => i.value === column);
+                return row ? row.show : false;
+            },
+            toggleMultipleMode(multipleMode) {
+                this.multipleMode = multipleMode;
+                if (!multipleMode) {
+                    this.$refs.table.clearSelection();
+                }
+            },
+            editRow(row) {
+                this.$router.push({
+                    path: '/bindGame',
+                    query: {
+                        id: row.id,
+                        column: this.$route.query.column,
+                    }
+                })
+            },
+            operation1() {
+                this.$notify({
+                    title: '提示',
+                    message: this.selection
+                });
+            },
+            operation2() {
+                this.$message('操作2');
+            },
+            addField() {
+                this.advancedQueryFields.push({
+                    link: 'AND',
+                    name: '',
+                    searchMethod: '=',
+                    value: '',
+                });
+            },
+            removeField(i) {
+                if (this.advancedQueryFields.length > 0) {
+                    this.advancedQueryFields.splice(i, 1);
+                }
+            },
+            advancedQuery() {
+
+                this.advancedQuerySearchKey = '';
+
+                if (this.advancedQueryFields.length > 0) {
+
+                    var templist = [];
+
+                    this.advancedQueryFields.forEach(item => {
+                        if (item.link && item.name && item.searchMethod && item.value) {
+                            var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
+                            templist.push(tempItem);
+                        }
+                    })
+
+                    if (templist.length > 0) {
+
+                        this.advancedQuerySearchKey = templist.join('_;');
+                    }
+                }
+
+                this.getData();
+                this.showAdvancedQueryDialog = false;
+            },
+            addSortField() {
+                this.tableSortFields.push({
+                    name: '',
+                    order: 'asc',
+                });
+            },
+            removeSortField(i) {
+                if (this.tableSortFields.length > 0) {
+                    this.tableSortFields.splice(i, 1);
+                }
+            },
+            tableSortQuery() {
+
+                this.orderByStr = '';
+
+                if (this.tableSortFields.length > 0) {
+
+                    var templist = [];
+
+                    this.tableSortFields.forEach(item => {
+                        if (item.name && item.order) {
+                            var tempItem = item.name + '_,' + item.order;
+                            templist.push(tempItem);
+                        }
+                    })
+
+                    if (templist.length > 0) {
+
+                        this.orderByStr = templist.join('_;');
+                    }
+                }
+
+                this.getData();
+                this.showTableSortDialog = false;
+            },
+            exportExcel() {
+                window.location.href = this.$baseUrl + "/bindGame/exportExcel?searchKey="
+                        + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey+"&orderByStr=" + this.orderByStr;
+            },
+            searchData() {
+                this.currentPage = 1;
+                this.getData();
+            },
+            deleteRow(row) {
+                this.$alert('删除将无法恢复,确认要删除么?', '警告', {type: 'error'}).then(() => {
+                    return this.$http.post({
+                        url: '/bindGame/del',
+                        data: {id: row.id}
+                    })
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.getData();
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
+            DateTimeFormatter(row, column, cellValue) {
+                if (cellValue) {
+                    return format(cellValue, 'YYYY/MM/DD HH:mm', {locale: zh})
+                }
+
+            },
+            DateFormatter(row, column, cellValue) {
+                if (cellValue) {
+                    return format(cellValue, 'YYYY/MM/DD', {locale: zh})
+                }
+
+            },
+            showImg(img) {
+                this.imgSrc = img;
+                this.imageDialogVisible = true;
+            },
+
+        }
+    }
+</script>
+<style lang="less" scoped>
+
+</style>

+ 11 - 1
src/main/vue/src/router/index.js

@@ -336,6 +336,16 @@ const router = new Router({
                     path: '/videoTest',
                     name: 'VideoTest',
                     component: () => import('../pages/VideoTest')
+                },
+                {
+                    path: '/bindGame',
+                    name: 'BindGame',
+                    component: () => import('../pages/BindGame')
+                },
+                {
+                    path: '/bindGames',
+                    name: 'BindGames',
+                    component: () => import('../pages/BindGames')
                 }
                 /**INSERT_LOCATION**/
             ]
@@ -390,4 +400,4 @@ router.afterEach((to, from) => {
     window.onresize();
 });
 
-export default router;
+export default router;