master
parent
dde0c2c067
commit
608b45c1f1
|
|
@ -21,6 +21,8 @@ public class DriverQueryParam {
|
|||
* 司机姓名(模糊查询)
|
||||
*/
|
||||
private String driverName;
|
||||
|
||||
private String keywords;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -88,14 +88,17 @@ public class DriverServiceImpl extends ServiceImpl<DriverMapper, DriverEntity> i
|
|||
|
||||
@Override
|
||||
public PageResult<DriverResult> paging(PageParam pageParam, DriverQueryParam queryParam) {
|
||||
if (queryParam == null) {
|
||||
queryParam = new DriverQueryParam();
|
||||
}
|
||||
String driverName = queryParam.getDriverName();
|
||||
String keywords = queryParam.getKeywords();
|
||||
|
||||
QueryWrapper<DriverEntity> ew = Wrappers.<DriverEntity>query()
|
||||
.eq("cd.deleted", Boolean.FALSE)
|
||||
.eq(queryParam.getBusy() != null, "cd.busy", queryParam.getBusy())
|
||||
.like(StrUtil.isNotBlank(driverName), "cd.driver_name", driverName);
|
||||
.like(StrUtil.isNotBlank(driverName), "cd.driver_name", driverName)
|
||||
.and(StrUtil.isNotBlank(keywords), it -> it
|
||||
.like("cd.driver_name", keywords)
|
||||
.or().like("cd.phone", keywords)
|
||||
);
|
||||
|
||||
return PageResult.of(baseMapper.paging(pageParam.toPage(), ew));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,12 +12,6 @@ import lombok.Setter;
|
|||
@Setter
|
||||
public class ProjectQueryParam {
|
||||
|
||||
/**
|
||||
* 是否删除; 0-->未删除、1-->已删除
|
||||
* 作为查询条件时,默认按未删除(0)处理
|
||||
*/
|
||||
private Boolean deleted;
|
||||
|
||||
/**
|
||||
* 项目名称(模糊查询)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -74,9 +74,6 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectEntity
|
|||
|
||||
@Override
|
||||
public PageResult<ProjectResult> paging(PageParam pageParam, ProjectQueryParam queryParam) {
|
||||
if (queryParam == null) {
|
||||
queryParam = new ProjectQueryParam();
|
||||
}
|
||||
String projectName = queryParam.getProjectName();
|
||||
|
||||
QueryWrapper<ProjectEntity> ew = Wrappers.<ProjectEntity>query()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.njzscloud.dispose.cst.truck.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njzscloud.common.core.ex.Exceptions;
|
||||
|
|
@ -9,7 +10,6 @@ import com.njzscloud.common.security.util.SecurityUtil;
|
|||
import com.njzscloud.dispose.cst.truck.mapper.TruckMapper;
|
||||
import com.njzscloud.dispose.cst.truck.pojo.entity.TruckEntity;
|
||||
import com.njzscloud.dispose.cst.truck.service.TruckService;
|
||||
import com.njzscloud.dispose.sys.auth.pojo.result.IdentityInfo;
|
||||
import com.njzscloud.dispose.sys.auth.pojo.result.MyResult;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -89,7 +89,10 @@ public class TruckServiceImpl extends ServiceImpl<TruckMapper, TruckEntity> impl
|
|||
|
||||
@Override
|
||||
public PageResult<TruckEntity> paging(PageParam pageParam, TruckEntity truckEntity) {
|
||||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.query(truckEntity)));
|
||||
String licensePlate = truckEntity.getLicensePlate();
|
||||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<TruckEntity>lambdaQuery()
|
||||
.like(StrUtil.isNotBlank(licensePlate), TruckEntity::getLicensePlate, licensePlate)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue