Merge remote-tracking branch 'origin/master'
commit
1428e5d7c3
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -95,13 +95,6 @@ public class StStbprpB implements Serializable {
|
|||
@Size(max = 500,message = "站址最大长度要小于 500")
|
||||
private String stlc;
|
||||
|
||||
/**
|
||||
* 弃用,使用adcd,行政区划码
|
||||
*/
|
||||
@TableField(value="addvcd")
|
||||
@Schema(description="弃用,使用adcd,行政区划码")
|
||||
@Size(max = 15,message = "弃用,使用adcd,行政区划码最大长度要小于 15")
|
||||
private String addvcd;
|
||||
|
||||
/**
|
||||
* alt
|
||||
|
|
@ -529,6 +522,20 @@ public class StStbprpB implements Serializable {
|
|||
@TableField(value="agreement")
|
||||
private String agreement;
|
||||
|
||||
/**
|
||||
* SIM卡
|
||||
*/
|
||||
@Schema(description="SIM卡")
|
||||
@TableField(value="sim_card")
|
||||
private String simCard;
|
||||
|
||||
/**
|
||||
* 北斗卡号
|
||||
*/
|
||||
@Schema(description="北斗卡号")
|
||||
@TableField(value="bd_card")
|
||||
private String bdCard;
|
||||
|
||||
public static final String COL_STCD = "stcd";
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue