|
|
|
@ -12,7 +12,9 @@ import com.xydl.cac.service.ParamBindService;
|
|
|
|
|
import com.xydl.cac.service.ReportService;
|
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.data.domain.Page;
|
|
|
|
|
import org.springframework.data.repository.query.Param;
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
@ -53,12 +55,22 @@ public class NSensorController extends BasicController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("listAll")
|
|
|
|
|
@ApiOperation("查询列表")
|
|
|
|
|
public Response<List<NSensor>> listAll(@Param("zsbid") Integer zsbid) throws Exception {
|
|
|
|
|
@ApiOperation("查询全部")
|
|
|
|
|
public Response<List<NSensor>> listAll(@ApiParam("主设备id") @RequestParam(value = "zsbid", required = false) Integer zsbid) throws Exception {
|
|
|
|
|
List<NSensor> result = service.listAll(zsbid);
|
|
|
|
|
return Response.success(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping("list")
|
|
|
|
|
@ApiOperation("查询列表")
|
|
|
|
|
public Response<Page<NSensor>> list(@ApiParam("页码") @RequestParam(value = "pageNum", required = false) Integer pageNum,
|
|
|
|
|
@ApiParam("每页数量") @RequestParam(value = "pageSize", required = false) Integer pageSize) throws Exception {
|
|
|
|
|
pageNum = this.initPageNum(pageNum);
|
|
|
|
|
pageSize = this.initPageSize(pageSize);
|
|
|
|
|
Page<NSensor> result = service.list(pageNum, pageSize);
|
|
|
|
|
return Response.success(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PostMapping("add")
|
|
|
|
|
@ApiOperation("新增")
|
|
|
|
|
public Response<NSensor> add(@Validated @RequestBody NSensor item) throws Exception {
|
|
|
|
|