/**
|
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
|
* <p>
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
* you may not use this file except in compliance with the License.
|
* You may obtain a copy of the License at
|
* <p>
|
* http://www.apache.org/licenses/LICENSE-2.0
|
* <p>
|
* Unless required by applicable law or agreed to in writing, software
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* See the License for the specific language governing permissions and
|
* limitations under the License.
|
*/
|
package org.springblade.modules.Stbprp.controller;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.AllArgsConstructor;
|
import org.springblade.core.boot.ctrl.BladeController;
|
import org.springblade.core.log.annotation.ApiLog;
|
import org.springblade.core.mp.support.Condition;
|
import org.springblade.core.mp.support.Query;
|
import org.springblade.core.tool.api.R;
|
import org.springblade.modules.Stbprp.entity.StbprpB;
|
import org.springblade.modules.Stbprp.service.IStbprpBService;
|
import org.springblade.modules.Stbprp.vo.StbprpBVO;
|
import org.springblade.modules.Stbprp.wrapper.StbprpBWrapper;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.validation.Valid;
|
|
/**
|
* 控制器
|
*
|
* @author Blade
|
* @since 2019-11-07
|
*/
|
@RestController
|
@AllArgsConstructor
|
@RequestMapping("/stbprpb")
|
@Api(value = "", tags = "接口")
|
public class StbprpBController extends BladeController {
|
|
private IStbprpBService stbprpBService;
|
|
/**
|
* 详情
|
*/
|
@ApiLog("详情")
|
@GetMapping("/detail")
|
@ApiOperationSupport(order = 1)
|
@ApiOperation(value = "详情", notes = "传入stbprpB")
|
public R<StbprpBVO> detail(StbprpB stbprpB) {
|
StbprpB detail = stbprpBService.getOne(Condition.getQueryWrapper(stbprpB));
|
return R.data(StbprpBWrapper.build().entityVO(detail));
|
}
|
|
/**
|
* 分页
|
*/
|
@ApiLog("分页")
|
@PostMapping("/list")
|
@ApiOperationSupport(order = 2)
|
@ApiOperation(value = "站点列表分页", notes = "传入stbprpB")
|
public R<IPage<StbprpBVO>> list(StbprpB stbprpB, Query query) {
|
IPage<StbprpB> pages = stbprpBService.page(Condition.getPage(query), Condition.getQueryWrapper(stbprpB));
|
return R.data(StbprpBWrapper.build().pageVO(pages));
|
}
|
|
|
/**
|
* 新增
|
*/
|
@ApiLog("新增")
|
@PostMapping("/save")
|
@ApiOperationSupport(order = 4)
|
@ApiOperation(value = "新增", notes = "传入stbprpB")
|
public R save(@Valid @RequestBody StbprpB stbprpB) {
|
return R.status(stbprpBService.save(stbprpB));
|
}
|
|
/**
|
* 修改
|
*/
|
@ApiLog("修改")
|
@PostMapping("/update")
|
@ApiOperationSupport(order = 5)
|
@ApiOperation(value = "修改", notes = "传入stbprpB")
|
public R update(@Valid @RequestBody StbprpB stbprpB) {
|
return R.status(stbprpBService.updateById(stbprpB));
|
}
|
|
/**
|
* 新增或修改
|
*/
|
@PostMapping("/submit")
|
@ApiOperationSupport(order = 6)
|
@ApiOperation(value = "新增或修改", notes = "传入stbprpB")
|
public R submit(@Valid @RequestBody StbprpB stbprpB) {
|
return R.status(stbprpBService.saveOrUpdate(stbprpB));
|
}
|
|
|
|
|
/**
|
* 站点列表
|
*//*
|
@PostMapping("/selectStbprpBPage")
|
@ApiOperationSupport(order = 3)
|
@ApiOperation(value = "站点列表分页", notes = "")
|
public R selectSitePage(int startIndex,int pageSize) {
|
return R.data(stbprpBService.selectStbprpBPage(startIndex,pageSize));
|
}*/
|
|
/**
|
* 模糊查询
|
*/
|
@PostMapping("/selectList")
|
@ApiOperationSupport(order = 7)
|
@ApiOperation(value = "模糊查询", notes = "")
|
public R selectList(String addvcd, String name) {
|
return R.data(stbprpBService.selectList(addvcd,name));
|
}
|
|
/**
|
* 全部查询
|
*/
|
@PostMapping("/selectAllList")
|
@ApiOperationSupport(order = 8)
|
@ApiOperation(value = "全部查询", notes = "")
|
public R selectAllList() {
|
return R.data(stbprpBService.selectAllList());
|
}
|
|
/**
|
* 站点详情
|
*/
|
@ApiLog("站点详情")
|
@PostMapping("/selectInfo")
|
@ApiOperationSupport(order = 9)
|
@ApiOperation(value = "站点详情", notes = "code")
|
public R selectInfo(String code) {
|
return R.data(stbprpBService.selectInfo(code));
|
}
|
|
|
|
|
/**
|
* 河道站
|
*/
|
@ApiLog("河道站")
|
@PostMapping("/selectRiverCode")
|
@ApiOperationSupport(order = 10)
|
@ApiOperation(value = "河道站", notes = "code")
|
public R selectRiverCode() {
|
return R.data(stbprpBService.selectRiverCode());
|
}
|
|
|
/**
|
* 河道模糊查询
|
*/
|
@ApiLog("河道模糊查询")
|
@PostMapping("/selectInfoCode")
|
@ApiOperationSupport(order = 11)
|
@ApiOperation(value = "站点详情", notes = "code")
|
public R selectInfoCode(String addvcd, String name, String sttp) {
|
return R.data(stbprpBService.selectInfoCode(addvcd,name,sttp));
|
}
|
|
|
/**
|
* 降水站
|
*/
|
@ApiLog("降水站")
|
@PostMapping("/selectPptnCode")
|
@ApiOperationSupport(order = 12)
|
@ApiOperation(value = "降水站", notes = "code")
|
public R selectPptnCode() {
|
return R.data(stbprpBService.selectPptnCode());
|
}
|
|
|
|
/**
|
* 水库站
|
*/
|
@ApiLog("水库站")
|
@PostMapping("/selectRsvrCode")
|
@ApiOperationSupport(order = 13)
|
@ApiOperation(value = "水库站", notes = "code")
|
public R selectRsvrCode() {
|
return R.data(stbprpBService.selectRsvrCode());
|
}
|
|
|
@PostMapping("/selectInfos")
|
@ApiOperationSupport(order = 14)
|
@ApiOperation(value = "站点详情", notes = "code")
|
public R selectInfos(String code) {
|
return R.data(stbprpBService.selectInfos(code));
|
}
|
|
|
/**
|
* 东江源数据查询
|
* @param code 为空查询全部,不为空查询详情
|
* @return
|
*/
|
@PostMapping("/selectDjList")
|
@ApiOperationSupport(order = 15)
|
@ApiOperation(value = "东江源数据查询", notes = "code")
|
public R selectDjList(String code) {
|
return R.data(stbprpBService.selectDjList(code));
|
}
|
|
|
@GetMapping("/selectSname")
|
@ApiOperationSupport(order = 16)
|
@ApiOperation(value = "", notes = "")
|
public R selectSname() {
|
return R.data(stbprpBService.selectSname());
|
}
|
|
@GetMapping("/selectSnames")
|
@ApiOperationSupport(order = 16)
|
@ApiOperation(value = "", notes = "")
|
public R selectSnames() {
|
return R.data(stbprpBService.selectSnames());
|
}
|
|
/**
|
* 通过站名查询详情
|
* @return
|
*/
|
@GetMapping("/selectSnameInfo")
|
@ApiOperationSupport(order = 17)
|
@ApiOperation(value = "", notes = "")
|
public R selectSnameInfo(String STNM) {
|
return R.data(stbprpBService.selectSnameInfo(STNM));
|
}
|
}
|