司机修改
parent
aae95314a9
commit
60d6a56a40
|
|
@ -4,6 +4,8 @@ import com.njzscloud.common.core.utils.R;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity;
|
import com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity;
|
||||||
|
import com.njzscloud.dispose.cst.driver.pojo.param.DriverQueryParam;
|
||||||
|
import com.njzscloud.dispose.cst.driver.pojo.result.DriverDetailResult;
|
||||||
import com.njzscloud.dispose.cst.driver.service.DriverService;
|
import com.njzscloud.dispose.cst.driver.service.DriverService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -54,7 +56,7 @@ public class DriverController {
|
||||||
* 详情
|
* 详情
|
||||||
*/
|
*/
|
||||||
@GetMapping("/detail")
|
@GetMapping("/detail")
|
||||||
public R<DriverEntity> detail(@RequestParam("id") Long id) {
|
public R<DriverDetailResult> detail(@RequestParam("id") Long id) {
|
||||||
return R.success(driverService.detail(id));
|
return R.success(driverService.detail(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -62,8 +64,8 @@ public class DriverController {
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
@GetMapping("/paging")
|
@GetMapping("/paging")
|
||||||
public R<PageResult<DriverEntity>> paging(PageParam pageParam, DriverEntity driverEntity) {
|
public R<PageResult<DriverDetailResult>> paging(PageParam pageParam, DriverQueryParam queryParam) {
|
||||||
return R.success(driverService.paging(pageParam, driverEntity));
|
return R.success(driverService.paging(pageParam, queryParam));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity;
|
import com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity;
|
||||||
|
import com.njzscloud.dispose.cst.driver.pojo.result.DriverDetailResult;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|
@ -15,8 +16,8 @@ import org.apache.ibatis.annotations.Param;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface DriverMapper extends BaseMapper<DriverEntity> {
|
public interface DriverMapper extends BaseMapper<DriverEntity> {
|
||||||
|
|
||||||
Page<DriverEntity> paging(Page<DriverEntity> page, @Param("ew") QueryWrapper<DriverEntity> ew);
|
Page<DriverDetailResult> paging(Page<DriverEntity> page, @Param("ew") QueryWrapper<DriverEntity> ew);
|
||||||
|
|
||||||
DriverEntity getById(Long id);
|
DriverDetailResult getById(Long id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.njzscloud.dispose.cst.driver.pojo.entity;
|
package com.njzscloud.dispose.cst.driver.pojo.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.njzscloud.dispose.common.pojo.entity.BaseEntity;
|
import com.njzscloud.dispose.common.pojo.entity.BaseEntity;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
@ -11,7 +10,7 @@ import lombok.experimental.Accessors;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 司机
|
* 司机实体(仅包含表字段)
|
||||||
* @author ljw
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
|
|
@ -36,9 +35,6 @@ public class DriverEntity extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private Long orgId;
|
private Long orgId;
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String orgName;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 驾驶证编号
|
* 驾驶证编号
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.njzscloud.dispose.cst.driver.pojo.param;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司机分页查询入参
|
||||||
|
*
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class DriverQueryParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除; 0-->未删除、1-->已删除
|
||||||
|
* 作为查询条件时,默认按未删除(0)处理
|
||||||
|
*/
|
||||||
|
private Boolean deleted;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司机姓名(模糊查询)
|
||||||
|
*/
|
||||||
|
private String driverName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,108 @@
|
||||||
|
package com.njzscloud.dispose.cst.driver.pojo.result;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司机详情/列表返回结果
|
||||||
|
*
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class DriverDetailResult {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 归属用户 Id;sys_user.id
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 归属客户 Id;cst_customer.id
|
||||||
|
*/
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 归属公司 Id;cst_org.id
|
||||||
|
*/
|
||||||
|
private Long orgId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 归属公司名称
|
||||||
|
*/
|
||||||
|
private String orgName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驾驶证编号
|
||||||
|
*/
|
||||||
|
private String drivingLicenceNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司机姓名
|
||||||
|
*/
|
||||||
|
private String driverName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驾驶证图片
|
||||||
|
*/
|
||||||
|
private String drivingLicence;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驾驶证有效期开始
|
||||||
|
*/
|
||||||
|
private LocalDate licenceStartTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驾驶证有效期结束
|
||||||
|
*/
|
||||||
|
private LocalDate licenceEndTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 忙碌中
|
||||||
|
*/
|
||||||
|
private Boolean busy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人 Id;sys_user.id
|
||||||
|
*/
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人 Id; sys_user.id
|
||||||
|
*/
|
||||||
|
private Long modifierId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime modifyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除; 0-->未删除、1-->已删除
|
||||||
|
*/
|
||||||
|
private Boolean deleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity;
|
import com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity;
|
||||||
|
import com.njzscloud.dispose.cst.driver.pojo.param.DriverQueryParam;
|
||||||
|
import com.njzscloud.dispose.cst.driver.pojo.result.DriverDetailResult;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -19,9 +21,9 @@ public interface DriverService extends IService<DriverEntity> {
|
||||||
|
|
||||||
void del(List<Long> ids);
|
void del(List<Long> ids);
|
||||||
|
|
||||||
DriverEntity detail(Long id);
|
DriverDetailResult detail(Long id);
|
||||||
|
|
||||||
PageResult<DriverEntity> paging(PageParam pageParam, DriverEntity driverEntity);
|
PageResult<DriverDetailResult> paging(PageParam pageParam, DriverQueryParam queryParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
package com.njzscloud.dispose.cst.driver.service.impl;
|
package com.njzscloud.dispose.cst.driver.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.dispose.cst.driver.mapper.DriverMapper;
|
import com.njzscloud.dispose.cst.driver.mapper.DriverMapper;
|
||||||
import com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity;
|
import com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity;
|
||||||
|
import com.njzscloud.dispose.cst.driver.pojo.param.DriverQueryParam;
|
||||||
|
import com.njzscloud.dispose.cst.driver.pojo.result.DriverDetailResult;
|
||||||
import com.njzscloud.dispose.cst.driver.service.DriverService;
|
import com.njzscloud.dispose.cst.driver.service.DriverService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -41,12 +45,20 @@ public class DriverServiceImpl extends ServiceImpl<DriverMapper, DriverEntity> i
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DriverEntity detail(Long id) {
|
public DriverDetailResult detail(Long id) {
|
||||||
return baseMapper.getById(id);
|
return baseMapper.getById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<DriverEntity> paging(PageParam pageParam, DriverEntity driverEntity) {
|
public PageResult<DriverDetailResult> paging(PageParam pageParam, DriverQueryParam queryParam) {
|
||||||
return PageResult.of(baseMapper.paging(pageParam.toPage(), Wrappers.query(driverEntity)));
|
if (queryParam == null) {
|
||||||
|
queryParam = new DriverQueryParam();
|
||||||
|
}
|
||||||
|
String driverName = queryParam.getDriverName();
|
||||||
|
QueryWrapper<DriverEntity> ew = Wrappers.<DriverEntity>query()
|
||||||
|
.eq("cd.deleted", Boolean.FALSE)
|
||||||
|
.like(StrUtil.isNotBlank(driverName), "cd.driver_name", driverName);
|
||||||
|
|
||||||
|
return PageResult.of(baseMapper.paging(pageParam.toPage(), ew));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.njzscloud.dispose.cst.driver.mapper.DriverMapper">
|
<mapper namespace="com.njzscloud.dispose.cst.driver.mapper.DriverMapper">
|
||||||
|
|
||||||
<resultMap id="DriverResultMap" type="com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity">
|
<resultMap id="DriverResultMap" type="com.njzscloud.dispose.cst.driver.pojo.result.DriverDetailResult">
|
||||||
<id column="id" property="id"/>
|
<id column="id" property="id"/>
|
||||||
<result column="user_id" property="userId"/>
|
<result column="user_id" property="userId"/>
|
||||||
<result column="customer_id" property="customerId"/>
|
<result column="customer_id" property="customerId"/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue