Commit 45cf9740 authored by liming's avatar liming

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

parent b54631c3
......@@ -25,7 +25,13 @@ public class SeriesController {
@GetMapping("list")
@ApiOperation(value = "1.查询系列赛列表")
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}")
......
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;
public interface SeriesBusinessMapper {
List<SeriesListVO> getSeriesList();
List<SeriesListVO> getSeriesList(@Param("name") String name);
List<SeriesNoticeVO> getSeriesNotice(@Param("seriesId") Long seriesId);
......
......@@ -62,8 +62,9 @@ public class SeriesService {
@Resource
private SportUserTrainingLogService sportUserTrainingLogService;
public List<SeriesListVO> getSeriesList() {
return seriesBusinessMapper.getSeriesList();
public List<SeriesListVO> getSeriesList(SeriesListQueryDTO dto) {
String name = dto == null ? null : dto.getName();
return seriesBusinessMapper.getSeriesList(name);
}
public SeriesDetailsVO getSeriesDetails(Long id, Long sportUserId) {
......
......@@ -9,6 +9,9 @@
id,name,img_url,apply_start_time,apply_end_time,apply_num
from series
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
</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