时间参数应格式化带时分秒
parent
a55137fcaa
commit
7bc6712180
|
|
@ -3,6 +3,7 @@ package com.gunshi.project.xyt.controller;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.gunshi.core.result.R;
|
import com.gunshi.core.result.R;
|
||||||
import com.gunshi.project.xyt.entity.so.CommonDataPageSo;
|
import com.gunshi.project.xyt.entity.so.CommonDataPageSo;
|
||||||
|
import com.gunshi.project.xyt.entity.so.CommonDataPageSo2;
|
||||||
import com.gunshi.project.xyt.model.SafetyAccidentReg;
|
import com.gunshi.project.xyt.model.SafetyAccidentReg;
|
||||||
import com.gunshi.project.xyt.service.SafetyAccidentRegService;
|
import com.gunshi.project.xyt.service.SafetyAccidentRegService;
|
||||||
import com.gunshi.project.xyt.validate.markers.Insert;
|
import com.gunshi.project.xyt.validate.markers.Insert;
|
||||||
|
|
@ -51,7 +52,7 @@ public class SafetyAccidentRegController extends AbstractCommonFileController {
|
||||||
|
|
||||||
@Operation(summary = "分页")
|
@Operation(summary = "分页")
|
||||||
@PostMapping("/page")
|
@PostMapping("/page")
|
||||||
public R<Page<SafetyAccidentReg>> page(@RequestBody CommonDataPageSo page) {
|
public R<Page<SafetyAccidentReg>> page(@RequestBody CommonDataPageSo2 page) {
|
||||||
return R.ok(service.pageQuery(page));
|
return R.ok(service.pageQuery(page));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.gunshi.project.xyt.entity.so;
|
||||||
|
|
||||||
|
import com.gunshi.db.dto.DateRangeSo;
|
||||||
|
import com.gunshi.db.dto.DateTimeRangeSo;
|
||||||
|
import com.gunshi.db.dto.PageSo;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Created by wanyan on 2024/3/19
|
||||||
|
*
|
||||||
|
* @author wanyan
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description = "分页查询对象")
|
||||||
|
public class CommonDataPageSo2 {
|
||||||
|
|
||||||
|
@NotNull(message = "分页参数不能为空")
|
||||||
|
@Schema(description = "分页参数")
|
||||||
|
private PageSo pageSo;
|
||||||
|
|
||||||
|
@Schema(description="名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "时间范围")
|
||||||
|
private DateTimeRangeSo dateSo;
|
||||||
|
|
||||||
|
@Schema(description = "类型(1大事记 2调度记录 3维修养护 4安全鉴定 5除险加固 6白蚁普查)")
|
||||||
|
private List<Integer> types;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.gunshi.project.xyt.entity.so.CommonDataPageSo;
|
import com.gunshi.project.xyt.entity.so.CommonDataPageSo;
|
||||||
|
import com.gunshi.project.xyt.entity.so.CommonDataPageSo2;
|
||||||
import com.gunshi.project.xyt.mapper.SafetyAccidentRegMapper;
|
import com.gunshi.project.xyt.mapper.SafetyAccidentRegMapper;
|
||||||
import com.gunshi.project.xyt.model.SafetyAccidentReg;
|
import com.gunshi.project.xyt.model.SafetyAccidentReg;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -31,7 +32,7 @@ public class SafetyAccidentRegService extends ServiceImpl<SafetyAccidentRegMappe
|
||||||
@Autowired
|
@Autowired
|
||||||
private FileAssociationsService fileService;
|
private FileAssociationsService fileService;
|
||||||
|
|
||||||
public Page<SafetyAccidentReg> pageQuery(CommonDataPageSo page) {
|
public Page<SafetyAccidentReg> pageQuery(CommonDataPageSo2 page) {
|
||||||
LambdaQueryWrapper<SafetyAccidentReg> query = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<SafetyAccidentReg> query = Wrappers.lambdaQuery();
|
||||||
if (ObjectUtils.isNotNull(page.getName())) {
|
if (ObjectUtils.isNotNull(page.getName())) {
|
||||||
query.like(SafetyAccidentReg::getName, page.getName());
|
query.like(SafetyAccidentReg::getName, page.getName());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue