suochencheng 6 лет назад
Родитель
Сommit
7cd5e9bac3

+ 30 - 17
src/main/java/com/izouma/awesomeadmin/dao/CompetitionSeasonMapper.xml

@@ -17,10 +17,10 @@
         <result column="rank" property="rank" jdbcType="INTEGER"/>
         <result column="status_flag" property="statusFlag" jdbcType="INTEGER"/>
         <result column="game_id" property="gameId" jdbcType="INTEGER"/>
-        <result column="first_ratio" property="firstRatio" jdbcType="DECIMAL" />
-        <result column="second_ratio" property="secondRatio" jdbcType="DECIMAL" />
-        <result column="third_ratio" property="thirdRatio" jdbcType="DECIMAL" />
-        <result column="bonus_paid" property="bonusPaid" jdbcType="DECIMAL" />
+        <result column="first_ratio" property="firstRatio" jdbcType="DECIMAL"/>
+        <result column="second_ratio" property="secondRatio" jdbcType="DECIMAL"/>
+        <result column="third_ratio" property="thirdRatio" jdbcType="DECIMAL"/>
+        <result column="bonus_paid" property="bonusPaid" jdbcType="DECIMAL"/>
     </resultMap>
     <sql id="Base_Column_List">
         <trim suffixOverrides=",">
@@ -123,16 +123,16 @@
             <if test="gameId!= null">
                 game_id,
             </if>
-            <if test="firstRatio!= null" >
+            <if test="firstRatio!= null">
                 first_ratio,
             </if>
-            <if test="secondRatio!= null" >
+            <if test="secondRatio!= null">
                 second_ratio,
             </if>
-            <if test="thirdRatio!= null" >
+            <if test="thirdRatio!= null">
                 third_ratio,
             </if>
-            <if test="bonusPaid!= null" >
+            <if test="bonusPaid!= null">
                 bonus_paid,
             </if>
         </trim>
@@ -182,16 +182,16 @@
             <if test="gameId != null">
                 #{gameId,jdbcType=INTEGER},
             </if>
-            <if test="firstRatio != null" >
+            <if test="firstRatio != null">
                 #{firstRatio,jdbcType=DECIMAL},
             </if>
-            <if test="secondRatio != null" >
+            <if test="secondRatio != null">
                 #{secondRatio,jdbcType=DECIMAL},
             </if>
-            <if test="thirdRatio != null" >
+            <if test="thirdRatio != null">
                 #{thirdRatio,jdbcType=DECIMAL},
             </if>
-            <if test="bonusPaid != null" >
+            <if test="bonusPaid != null">
                 #{bonusPaid,jdbcType=DECIMAL},
             </if>
         </trim>
@@ -244,16 +244,16 @@
             <if test="gameId != null">
                 game_id= #{gameId,jdbcType=INTEGER},
             </if>
-            <if test="firstRatio != null" >
+            <if test="firstRatio != null">
                 first_ratio= #{firstRatio,jdbcType=DECIMAL},
             </if>
-            <if test="secondRatio != null" >
+            <if test="secondRatio != null">
                 second_ratio= #{secondRatio,jdbcType=DECIMAL},
             </if>
-            <if test="thirdRatio != null" >
+            <if test="thirdRatio != null">
                 third_ratio= #{thirdRatio,jdbcType=DECIMAL},
             </if>
-            <if test="bonusPaid != null" >
+            <if test="bonusPaid != null">
                 bonus_paid= #{bonusPaid,jdbcType=DECIMAL},
             </if>
         </set>
@@ -578,9 +578,12 @@
         LIMIT 1
     </select>
     <select id="queryStartCompetitionSeason" parameterType="java.util.Map"
-            resultType="com.izouma.awesomeadmin.model.CompetitionSeason">
+            resultMap="RankCompetitionSeasonResult">
         select
         <include refid="Base_Column_List"/>
+        ,
+        #{userId} as user_id
+
         from competition_season
         <where>
             and del_flag = 'N'
@@ -668,5 +671,15 @@
 
     </resultMap>
 
+    <resultMap id="RankCompetitionSeasonResult" type="com.izouma.awesomeadmin.model.CompetitionSeason"
+               extends="BaseResultMap">
+
+        <association property="playerInfo"
+                     javaType="com.izouma.awesomeadmin.model.PlayerInfo"
+                     select="com.izouma.awesomeadmin.dao.PlayerInfoMapper.seasonUserRank"
+                     column="{ gameId = game_id, userId = user_id, seasonId = id }"/>
+
+    </resultMap>
+
 </mapper>
 

+ 3 - 1
src/main/java/com/izouma/awesomeadmin/dao/GameInfoMapper.xml

@@ -424,6 +424,8 @@
             resultMap="SeasonResult">
         select
         <include refid="Base_Column_List"/>
+        ,
+        #{userId}  as user_id
         from game_info
         <where>
             and del_flag = 'N'
@@ -600,7 +602,7 @@
         <association property="competitionSeason"
                      javaType="com.izouma.awesomeadmin.model.CompetitionSeason"
                      select="com.izouma.awesomeadmin.dao.CompetitionSeasonMapper.queryStartCompetitionSeason"
-                     column="{ gameId = id }"/>
+                     column="{ gameId = id , userId = user_id}"/>
 
     </resultMap>
 

+ 20 - 0
src/main/java/com/izouma/awesomeadmin/model/CompetitionSeason.java

@@ -52,6 +52,10 @@ public class CompetitionSeason {
      */
     private String orderByStr;
 
+    private int userId;
+
+    private PlayerInfo playerInfo;
+
     public Integer getId() {
         return this.id;
     }
@@ -243,5 +247,21 @@ public class CompetitionSeason {
     public void setBonusPaid(BigDecimal bonusPaid) {
         this.bonusPaid = bonusPaid;
     }
+
+    public int getUserId() {
+        return userId;
+    }
+
+    public void setUserId(int userId) {
+        this.userId = userId;
+    }
+
+    public PlayerInfo getPlayerInfo() {
+        return playerInfo;
+    }
+
+    public void setPlayerInfo(PlayerInfo playerInfo) {
+        this.playerInfo = playerInfo;
+    }
 }
 

+ 82 - 61
src/main/java/com/izouma/awesomeadmin/model/GameInfo.java

@@ -1,13 +1,14 @@
 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 GameInfo{
+public class GameInfo {
     private Integer id;
     private String delFlag;
     private Date updateTime;
@@ -24,139 +25,152 @@ public class GameInfo{
 
     private String profile;
 
-private String idStr;
+    private String idStr;
+
+    private String searchKey;
 
-private String searchKey;
+    private int userId;
 
-private CompetitionSeason competitionSeason;
+    private CompetitionSeason competitionSeason;
 
 
-/**
-* and,test_name,like,value;or,remark,=,123
-*/
-private String advancedQuery;
+    /**
+     * and,test_name,like,value;or,remark,=,123
+     */
+    private String advancedQuery;
 
-/**
-* column_name_,desc_;column_name_,asc
-*/
-private String orderByStr;
+    /**
+     * column_name_,desc_;column_name_,asc
+     */
+    private String orderByStr;
 
-    public Integer getId(){
+    public Integer getId() {
         return this.id;
     }
 
-    public void setId(Integer id){
+    public void setId(Integer id) {
         this.id = id;
     }
-    public String getDelFlag(){
+
+    public String getDelFlag() {
         return this.delFlag;
     }
 
-    public void setDelFlag(String delFlag){
+    public void setDelFlag(String delFlag) {
         this.delFlag = delFlag;
     }
-    public Date getUpdateTime(){
+
+    public Date getUpdateTime() {
         return this.updateTime;
     }
 
-    public void setUpdateTime(Date updateTime){
+    public void setUpdateTime(Date updateTime) {
         this.updateTime = updateTime;
     }
-    public String getUpdateUser(){
+
+    public String getUpdateUser() {
         return this.updateUser;
     }
 
-    public void setUpdateUser(String updateUser){
+    public void setUpdateUser(String updateUser) {
         this.updateUser = updateUser;
     }
-    public Date getCreateTime(){
+
+    public Date getCreateTime() {
         return this.createTime;
     }
 
-    public void setCreateTime(Date createTime){
+    public void setCreateTime(Date createTime) {
         this.createTime = createTime;
     }
-    public String getCreateUser(){
+
+    public String getCreateUser() {
         return this.createUser;
     }
 
-    public void setCreateUser(String createUser){
+    public void setCreateUser(String createUser) {
         this.createUser = createUser;
     }
-    public String getGameName(){
+
+    public String getGameName() {
         return this.gameName;
     }
 
-    public void setGameName(String gameName){
+    public void setGameName(String gameName) {
         this.gameName = gameName;
     }
-    public Integer getTypeFlag(){
+
+    public Integer getTypeFlag() {
         return this.typeFlag;
     }
 
-    public void setTypeFlag(Integer typeFlag){
+    public void setTypeFlag(Integer typeFlag) {
         this.typeFlag = typeFlag;
     }
-    public String getIcon(){
+
+    public String getIcon() {
         return this.icon;
     }
 
-    public void setIcon(String icon){
+    public void setIcon(String icon) {
         this.icon = icon;
     }
-    public Integer getRank(){
+
+    public Integer getRank() {
         return this.rank;
     }
 
-    public void setRank(Integer rank){
+    public void setRank(Integer rank) {
         this.rank = rank;
     }
-    public String getRemark(){
+
+    public String getRemark() {
         return this.remark;
     }
 
-    public void setRemark(String remark){
+    public void setRemark(String remark) {
         this.remark = remark;
     }
-    public String getUseFlag(){
+
+    public String getUseFlag() {
         return this.useFlag;
     }
 
-    public void setUseFlag(String useFlag){
+    public void setUseFlag(String useFlag) {
         this.useFlag = useFlag;
     }
 
-public String getSearchKey() {
-    return searchKey;
-}
+    public String getSearchKey() {
+        return searchKey;
+    }
 
-public void setSearchKey(String searchKey) {
-    this.searchKey = searchKey;
-}
+    public void setSearchKey(String searchKey) {
+        this.searchKey = searchKey;
+    }
 
-public String getAdvancedQuery() {
-    return advancedQuery;
-}
+    public String getAdvancedQuery() {
+        return advancedQuery;
+    }
 
-public void setAdvancedQuery(String advancedQuery) {
-    this.advancedQuery = advancedQuery;
-}
+    public void setAdvancedQuery(String advancedQuery) {
+        this.advancedQuery = advancedQuery;
+    }
 
-public String getOrderByStr() {
-    return orderByStr;
-}
+    public String getOrderByStr() {
+        return orderByStr;
+    }
 
-public void setOrderByStr(String orderByStr) {
-    this.orderByStr = orderByStr;
-}
+    public void setOrderByStr(String orderByStr) {
+        this.orderByStr = orderByStr;
+    }
 
-public String getIdStr() {
-    return idStr;
-}
+    public String getIdStr() {
+        return idStr;
+    }
 
-public void setIdStr(String idStr) {
-    this.idStr = idStr;
-}
+    public void setIdStr(String idStr) {
+        this.idStr = idStr;
+    }
 
     public String getShortName() {
         return shortName;
@@ -181,5 +195,12 @@ public void setIdStr(String idStr) {
     public void setCompetitionSeason(CompetitionSeason competitionSeason) {
         this.competitionSeason = competitionSeason;
     }
-}
 
+    public int getUserId() {
+        return userId;
+    }
+
+    public void setUserId(int userId) {
+        this.userId = userId;
+    }
+}