Commit 45cf9740 authored by liming's avatar liming

增加按名称查询系列赛列表接口

parent b54631c3
...@@ -25,7 +25,13 @@ public class SeriesController { ...@@ -25,7 +25,13 @@ public class SeriesController {
@GetMapping("list") @GetMapping("list")
@ApiOperation(value = "1.查询系列赛列表") @ApiOperation(value = "1.查询系列赛列表")
public ResponseEntity<Result<List<SeriesListVO>>> getSeriesList() { public ResponseEntity<Result<List<SeriesListVO>>> getSeriesList() {
return success(seriesService.getSeriesList()); return success(seriesService.getSeriesList(null));
}
@PostMapping("list")
@ApiOperation(value = "1.查询系列赛列表带名称搜索")
public ResponseEntity<Result<List<SeriesListVO>>> getSeriesList(@RequestBody SeriesListQueryDTO dto) {
return success(seriesService.getSeriesList(dto));
} }
@GetMapping("{id}/{sportUserId}") @GetMapping("{id}/{sportUserId}")
......
package com.antai.sport.http.server.server.api.business.series.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel("系列赛列表查询VO")
@Data
public class SeriesListQueryDTO {
@ApiModelProperty("系列赛名称")
private String name;
}
...@@ -12,7 +12,7 @@ import java.util.List; ...@@ -12,7 +12,7 @@ import java.util.List;
public interface SeriesBusinessMapper { public interface SeriesBusinessMapper {
List<SeriesListVO> getSeriesList(); List<SeriesListVO> getSeriesList(@Param("name") String name);
List<SeriesNoticeVO> getSeriesNotice(@Param("seriesId") Long seriesId); List<SeriesNoticeVO> getSeriesNotice(@Param("seriesId") Long seriesId);
......
...@@ -62,8 +62,9 @@ public class SeriesService { ...@@ -62,8 +62,9 @@ public class SeriesService {
@Resource @Resource
private SportUserTrainingLogService sportUserTrainingLogService; private SportUserTrainingLogService sportUserTrainingLogService;
public List<SeriesListVO> getSeriesList() { public List<SeriesListVO> getSeriesList(SeriesListQueryDTO dto) {
return seriesBusinessMapper.getSeriesList(); String name = dto == null ? null : dto.getName();
return seriesBusinessMapper.getSeriesList(name);
} }
public SeriesDetailsVO getSeriesDetails(Long id, Long sportUserId) { public SeriesDetailsVO getSeriesDetails(Long id, Long sportUserId) {
......
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
id,name,img_url,apply_start_time,apply_end_time,apply_num id,name,img_url,apply_start_time,apply_end_time,apply_num
from series from series
where deleted = 0 and status = 20 where deleted = 0 and status = 20
<if test="name != null and name != ''">
and name like concat('%',#{name},'%')
</if>
) t1 order by t1.status,t1.id desc ) t1 order by t1.status,t1.id desc
</select> </select>
......
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