Commit 78c4197b authored by liming's avatar liming

系列赛淘汰赛主页数据

parent 8ab81607
This diff is collapsed.
......@@ -32,6 +32,11 @@ public class SeriesMatchFinalists implements Serializable {
*/
private Long matchId;
/**
* 轮次id
*/
private Long roundId;
/**
* 入围玩家id
*/
......
......@@ -76,5 +76,13 @@ public class SeriesController {
return success();
}
@ApiOperation("8.获取淘汰赛首页收据")
@PostMapping("knockout/match/{roundId}/{sportUserId}")
public ResponseEntity<Result<SeriesKnockoutMatchHomeVO>> getSeriesKnockoutMatchHomeData(
@PathVariable("roundId") Long roundId,
@PathVariable("sportUserId") Long sportUserId) {
return success(seriesService.getSeriesKnockoutMatchHomeData(roundId, sportUserId));
}
}
......@@ -42,5 +42,11 @@ public interface SeriesBusinessMapper {
@Param("createTime") LocalDateTime createTime);
IPage<SeriesQualifyingMatchRankVO> getSeriesQualifyingMatchRank(IPage<SeriesQualifyingMatchRankVO> page,
@Param("param") SeriesQualifyingMatchRankDTO param);
@Param("param") SeriesQualifyingMatchRankDTO param);
SeriesKnockoutMatchListVO getUserSeriesKnockoutMatch(@Param("roundId") Long roundId,
@Param("sportUserId") Long sportUserId);
List<SeriesKnockoutMatchListVO> getOtherSeriesKnockoutMatchList(@Param("roundId") Long roundId,
@Param("sportUserId") Long sportUserId);
}
......@@ -262,4 +262,19 @@ public class SeriesService {
});
}
/**
* 加载淘汰赛主页数据
*
* @param roundId
* @param sportUserId
* @return
*/
public SeriesKnockoutMatchHomeVO getSeriesKnockoutMatchHomeData(Long roundId, Long sportUserId) {
SeriesKnockoutMatchHomeVO result = new SeriesKnockoutMatchHomeVO();
result.setMyMatch(seriesBusinessMapper.getUserSeriesKnockoutMatch(roundId, sportUserId));
result.setMatchList(seriesBusinessMapper.getOtherSeriesKnockoutMatchList(roundId, sportUserId));
return result;
}
}
package com.antai.sport.http.server.server.api.business.series.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
@ApiModel("淘汰赛比赛数据")
@Data
public class SeriesKnockoutMatchDetailVO {
@ApiModelProperty("比赛id")
public Long id;
@ApiModelProperty("比赛名称")
public String name;
@ApiModelProperty("logo")
private String logo;
@ApiModelProperty("地图")
private String map;
@ApiModelProperty("赛道")
private String path;
@ApiModelProperty("允许进入时间 yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime entryTime;
@ApiModelProperty("开始比赛时间 yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime startTime;
@ApiModelProperty("比赛结束时间 yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime endTime;
@ApiModelProperty("长度")
private BigDecimal distance;
@ApiModelProperty("爬坡高度")
private BigDecimal climbDistance;
@ApiModelProperty("选手数量")
private Integer userNum;
@ApiModelProperty("赛事描述")
private String description;
}
package com.antai.sport.http.server.server.api.business.series.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@ApiModel("淘汰赛比赛列表VO")
@Data
public class SeriesKnockoutMatchListVO {
@ApiModelProperty("比赛id")
public Long id;
@ApiModelProperty("比赛名称")
public String name;
@ApiModelProperty("地图")
private String map;
@ApiModelProperty("赛道")
private String path;
@ApiModelProperty("允许进入时间 yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime entryTime;
@ApiModelProperty("开始比赛时间 yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime startTime;
@ApiModelProperty("比赛结束时间 yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private LocalDateTime endTime;
@ApiModelProperty("长度")
private BigDecimal distance;
@ApiModelProperty("爬坡高度")
private BigDecimal climbDistance;
@ApiModelProperty("入围人员数量")
private Integer userNum;
@ApiModelProperty("赛事描述")
private String description;
}
......@@ -98,4 +98,37 @@
left join sport_user_training_log t4 on t4.game_mode = 30 and t1.record_id = t4.record_id
where t1.round_id = #{param.roundId} and t1.area_id = #{param.areaId}
</select>
<select id="getUserSeriesKnockoutMatch" resultType="com.antai.sport.http.server.server.api.business.series.vo.SeriesKnockoutMatchListVO">
select t1.*,
(select count(1) from series_match_finalists s1 where s1.match_id = t1.id) as userNum
from series_match t1
where t1.deleted = 0 and t1.status = 20
and t1.id in (
select w1.match_id
from series_match_finalists w1
where w1.round_id = #{roundId} and w1.sport_user_id = #{sportUserId}
)
limit 1
</select>
<select id="getOtherSeriesKnockoutMatchList"
resultType="com.antai.sport.http.server.server.api.business.series.vo.SeriesKnockoutMatchListVO">
select t1.*,ifnull(t2.userNum,0) as userNum
from series_match t1
left join (
select match_id,count(1) as userNum
from series_match_finalists j1
where j1.round_id = #{roundId}
group by match_id
) t2 on t1.id = t2.match_id
where t1.deleted = 0 and t1.status = 20 and t1.round_id = #{roundId}
and t1.id not in (
select w1.match_id
from series_match_finalists w1
where w1.round_id = #{roundId} and w1.sport_user_id = #{sportUserId}
)
order by t1.start_time
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment