测站基本信息查询修改
parent
75968f74bc
commit
bbcd52d83e
|
|
@ -1,6 +1,8 @@
|
|||
package com.gunshi.project.xyt.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gunshi.core.result.R;
|
||||
|
|
@ -21,6 +23,7 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
|
|
@ -44,6 +47,7 @@ public class StStbprpBController {
|
|||
if (Objects.nonNull(service.getById(dto.getStcd()))){
|
||||
throw new RuntimeException("测站编号已存在");
|
||||
}
|
||||
dto.setModitime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
return R.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -85,7 +89,7 @@ public class StStbprpBController {
|
|||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public R<Page<StStbprpB>> page(@RequestBody @Validated StStbprpBPage page) {
|
||||
LambdaQueryChainWrapper<StStbprpB> query = service.lambdaQuery();
|
||||
LambdaQueryWrapper<StStbprpB> query = Wrappers.lambdaQuery();
|
||||
if (ObjectUtils.isNotNull(page.getCode())) {
|
||||
query.like(StStbprpB::getStcd, page.getCode());
|
||||
}
|
||||
|
|
@ -95,6 +99,7 @@ public class StStbprpBController {
|
|||
if (ObjectUtils.isNotNull(page.getAgreement())) {
|
||||
query.like(StStbprpB::getAgreement, page.getAgreement());
|
||||
}
|
||||
query.orderByDesc(StStbprpB::getModitime);
|
||||
return R.ok(service.page(page.getPageSo().toPage(), query));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue