Browse Source

新增 获取河流列表 接口

tags/V1.6.0^2
wanghaoran 1 year ago
parent
commit
44c1887699
3 changed files with 24 additions and 0 deletions
  1. +10
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/controller/StreamController.java
  2. +1
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/IStreamService.java
  3. +13
    -0
      tuoheng-api/src/main/java/com/tuoheng/api/service/impl/StreamServiceImpl.java

+ 10
- 0
tuoheng-api/src/main/java/com/tuoheng/api/controller/StreamController.java View File

@@ -31,6 +31,16 @@ public class StreamController {
return streamService.queryPage(streamQuery);
}

/**
* 获取河流列表
*
* @param streamQuery 查询条件
* @return
*/
@GetMapping("/indexAll")
public JsonResult indexAll(StreamQuery streamQuery) {
return streamService.indexAll(streamQuery);
}


}

+ 1
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/IStreamService.java View File

@@ -23,4 +23,5 @@ public interface IStreamService extends IBaseService<Stream> {
*/
JsonResult queryPage(StreamQuery query);

JsonResult indexAll(StreamQuery streamQuery);
}

+ 13
- 0
tuoheng-api/src/main/java/com/tuoheng/api/service/impl/StreamServiceImpl.java View File

@@ -20,6 +20,8 @@ import com.tuoheng.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
* 河道表 服务实现类
@@ -91,4 +93,15 @@ public class StreamServiceImpl extends BaseServiceImpl<StreamMapper, Stream> imp
return JsonResult.success(pageData);
}

@Override
public JsonResult indexAll(StreamQuery query) {
List<Stream> streamList = streamMapper.selectList(new LambdaQueryWrapper<Stream>()
.eq(Stream::getMark, 1)
.eq(StringUtils.isNotEmpty(query.getProvinceCode()), Stream::getProvinceCode, query.getProvinceCode())
.eq(StringUtils.isNotEmpty(query.getCityCode()), Stream::getCityCode, query.getCityCode())
.eq(StringUtils.isNotEmpty(query.getDistrictCode()), Stream::getDistrictCode, query.getDistrictCode())
.orderByDesc(Stream::getCreateTime));
return JsonResult.success(streamList);
}

}

Loading…
Cancel
Save