【admin】新增&优化# 1、优化巡检单列表 2、优化查看当前管理员信息增加工厂名和工厂id 3、优化巡检单编辑和编辑详情 4、新增修改派单方式、修改抢单范围、重新派单
parent
7c110a9b8b
commit
31357a6529
|
@ -94,4 +94,45 @@ public class RoutingInspectionOrderController {
|
|||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改派单方式
|
||||
*
|
||||
* @author hcy
|
||||
* @param routingInspectionOrderParam 参数
|
||||
* @return Object
|
||||
*/
|
||||
@Log(title = "修改派单方式")
|
||||
@PostMapping("/alterReceiverType")
|
||||
public Object alterReceiverType(@RequestBody RoutingInspectionOrderParam routingInspectionOrderParam) {
|
||||
iRoutingInspectionOrderService.alterReceiverType(routingInspectionOrderParam);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改抢单范围
|
||||
*
|
||||
* @author hcy
|
||||
* @param routingInspectionOrderParam 参数
|
||||
* @return Object
|
||||
*/
|
||||
@Log(title = "修改抢单范围")
|
||||
@PostMapping("/alterOrderDistance")
|
||||
public Object alterOrderDistance(@RequestBody RoutingInspectionOrderParam routingInspectionOrderParam) {
|
||||
iRoutingInspectionOrderService.alterOrderDistance(routingInspectionOrderParam);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新派工
|
||||
*
|
||||
* @author hcy
|
||||
* @param routingInspectionOrderParam 参数
|
||||
* @return Object
|
||||
*/
|
||||
@Log(title = "重新派工")
|
||||
@PostMapping("/reassignment")
|
||||
public Object reassignment(@RequestBody RoutingInspectionOrderParam routingInspectionOrderParam) {
|
||||
iRoutingInspectionOrderService.reassignment(routingInspectionOrderParam);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,4 +56,21 @@ public interface IRoutingInspectionOrderService {
|
|||
*/
|
||||
void del(Integer id);
|
||||
|
||||
/**
|
||||
* 修改派单方式
|
||||
* @param routingInspectionOrderParam
|
||||
*/
|
||||
void alterReceiverType(RoutingInspectionOrderParam routingInspectionOrderParam);
|
||||
|
||||
/**
|
||||
* 修改抢单范围
|
||||
* @param routingInspectionOrderParam
|
||||
*/
|
||||
void alterOrderDistance(RoutingInspectionOrderParam routingInspectionOrderParam);
|
||||
|
||||
/**
|
||||
* 重新派工
|
||||
* @param routingInspectionOrderParam
|
||||
*/
|
||||
void reassignment(RoutingInspectionOrderParam routingInspectionOrderParam);
|
||||
}
|
||||
|
|
|
@ -11,14 +11,25 @@ import com.hcy.admin.validate.order.RoutingInspectionOrderParam;
|
|||
import com.hcy.admin.vo.order.RoutingInspectionOrderListVo;
|
||||
import com.hcy.admin.vo.order.RoutingInspectionOrderDetailVo;
|
||||
import com.hcy.common.core.PageResult;
|
||||
import com.hcy.common.dto.OrderDto;
|
||||
import com.hcy.common.dto.RoutingInspectionOrderDto;
|
||||
import com.hcy.common.dto.result.OrderPageResultDto;
|
||||
import com.hcy.common.entity.client.Client;
|
||||
import com.hcy.common.entity.client.Equipment;
|
||||
import com.hcy.common.entity.order.Order;
|
||||
import com.hcy.common.entity.order.RoutingInspectionOrder;
|
||||
import com.hcy.common.entity.system.SystemAuthAdmin;
|
||||
import com.hcy.common.entity.warehouse.Warehouse;
|
||||
import com.hcy.common.enums.order.OrderStateEnum;
|
||||
import com.hcy.common.mapper.client.ClientMapper;
|
||||
import com.hcy.common.mapper.client.EquipmentMapper;
|
||||
import com.hcy.common.mapper.order.RoutingInspectionOrderMapper;
|
||||
import com.hcy.common.mapper.system.SystemAuthAdminMapper;
|
||||
import com.hcy.common.utils.ArrayUtil;
|
||||
import com.hcy.common.utils.TimeUtil;
|
||||
import com.hcy.common.utils.UrlUtil;
|
||||
import com.hcy.common.config.GlobalConfig;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
@ -36,6 +47,15 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
|||
@Resource
|
||||
RoutingInspectionOrderMapper routingInspectionOrderMapper;
|
||||
|
||||
@Resource
|
||||
EquipmentMapper equipmentMapper;
|
||||
|
||||
@Resource
|
||||
ClientMapper clientMapper;
|
||||
|
||||
@Resource
|
||||
SystemAuthAdminMapper systemAuthAdminMapper;
|
||||
|
||||
/**
|
||||
* 巡检订单列表
|
||||
*
|
||||
|
@ -46,22 +66,27 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
|||
*/
|
||||
@Override
|
||||
public PageResult<RoutingInspectionOrderListVo> list(PageParam pageParam, Map<String, String> params) {
|
||||
Integer page = pageParam.getPageNo();
|
||||
Integer limit = pageParam.getPageSize();
|
||||
|
||||
QueryWrapper<RoutingInspectionOrder> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_delete", 0);
|
||||
queryWrapper.orderByDesc("id");
|
||||
Page<RoutingInspectionOrderDto> page = new Page<>(pageParam.getPageNo(), pageParam.getPageSize());
|
||||
RoutingInspectionOrderDto inspectionOrderDto = new RoutingInspectionOrderDto();
|
||||
|
||||
inspectionOrderDto.setOrderNo(StringUtils.isEmpty(params.get("orderNo")) ? null : params.get("orderNo"));
|
||||
inspectionOrderDto.setClientName(StringUtils.isEmpty(params.get("clientName")) ? null : params.get("clientName"));
|
||||
inspectionOrderDto.setDeviceName(StringUtils.isEmpty(params.get("deviceName")) ? null : params.get("deviceName"));
|
||||
inspectionOrderDto.setReceiverName(StringUtils.isEmpty(params.get("receiverName")) ? null : params.get("receiverName"));
|
||||
if(StringUtils.isNotEmpty(params.get("orderSource"))){
|
||||
inspectionOrderDto.setOrderSource(Long.valueOf(params.get("orderSource")));
|
||||
}
|
||||
if(StringUtils.isNotEmpty(params.get("inspectionOrderStatus"))){
|
||||
inspectionOrderDto.setInspectionOrderStatus(Long.valueOf(params.get("inspectionOrderStatus")));
|
||||
}
|
||||
|
||||
Page<RoutingInspectionOrderDto> iPage = routingInspectionOrderMapper.pageList(page, inspectionOrderDto);
|
||||
|
||||
routingInspectionOrderMapper.setSearch(queryWrapper, params, new String[]{
|
||||
"=:orderNo@order_no:str",
|
||||
"=:orderSource@order_source:long",
|
||||
});
|
||||
|
||||
IPage<RoutingInspectionOrder> iPage = routingInspectionOrderMapper.selectPage(new Page<>(page, limit), queryWrapper);
|
||||
|
||||
List<RoutingInspectionOrderListVo> list = new LinkedList<>();
|
||||
for(RoutingInspectionOrder item : iPage.getRecords()) {
|
||||
for(RoutingInspectionOrderDto item : iPage.getRecords()) {
|
||||
RoutingInspectionOrderListVo vo = new RoutingInspectionOrderListVo();
|
||||
BeanUtils.copyProperties(item, vo);
|
||||
vo.setCreateTime(String.valueOf(item.getCreateTime()));
|
||||
|
@ -91,6 +116,29 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
|||
|
||||
RoutingInspectionOrderDetailVo vo = new RoutingInspectionOrderDetailVo();
|
||||
BeanUtils.copyProperties(model, vo);
|
||||
//客户名称
|
||||
Client client = clientMapper.selectOne(
|
||||
new QueryWrapper<Client>()
|
||||
.eq("id", model.getClientId())
|
||||
.last("limit 1"));
|
||||
vo.setClientName(client.getClientName());
|
||||
//设备编号、名称、地址
|
||||
Equipment equipment = equipmentMapper.selectOne(
|
||||
new QueryWrapper<Equipment>()
|
||||
.eq("id", model.getDeviceId())
|
||||
.last("limit 1"));
|
||||
vo.setDeviceNumber(equipment.getNumber());
|
||||
vo.setDeviceName(equipment.getName());
|
||||
vo.setDetailedAddress(equipment.getDetailedAddress());
|
||||
//接单人
|
||||
SystemAuthAdmin authAdmin = systemAuthAdminMapper.selectOne(
|
||||
new QueryWrapper<SystemAuthAdmin>()
|
||||
.eq("id", model.getReceiverId())
|
||||
.last("limit 1"));
|
||||
if(authAdmin != null){
|
||||
vo.setReceiverName(authAdmin.getUsername());
|
||||
}
|
||||
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
@ -106,10 +154,10 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
|||
//model.setOrderNo(routingInspectionOrderParam.getOrderNo()); // 订单编号
|
||||
//定时任务创建的巡检单是系统创建,客服的是客服创建
|
||||
model.setOrderSource(OrderStateEnum.CUSTOMERSERVICECREATION.getStatus()); // 订单来源 1-系统创建;4-客服创建
|
||||
model.setRepairWorkOrderFlow(routingInspectionOrderParam.getRepairWorkOrderFlow());
|
||||
// 工单去向(0=工单池,1=检修员) 工单去向是工单池的话,工单状态是待抢单
|
||||
if(routingInspectionOrderParam.getWorkOrderFlow() == OrderStateEnum.WORKORDERTANK.getStatus()){
|
||||
if(routingInspectionOrderParam.getRepairWorkOrderFlow() == OrderStateEnum.WORKORDERTANK.getStatus()){
|
||||
model.setInspectionOrderStatus(OrderStateEnum.WAITINGLIST.getStatus()); // 订单状态 0-待抢单;
|
||||
|
||||
}else{
|
||||
model.setInspectionOrderStatus(OrderStateEnum.PENDINGORDER.getStatus());// 订单状态 1-待接单;
|
||||
}
|
||||
|
@ -144,13 +192,12 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
|||
|
||||
Assert.notNull(model, "数据不存在!");
|
||||
|
||||
model.setClientId(routingInspectionOrderParam.getClientId());
|
||||
model.setDeviceId(routingInspectionOrderParam.getDeviceId());
|
||||
model.setProvinceId(routingInspectionOrderParam.getProvinceId());
|
||||
model.setCityId(routingInspectionOrderParam.getCityId());
|
||||
model.setDistrictId(routingInspectionOrderParam.getDistrictId());
|
||||
model.setReceiverId(routingInspectionOrderParam.getReceiverId());
|
||||
model.setRemark(routingInspectionOrderParam.getRemark());
|
||||
model.setReceiverType(routingInspectionOrderParam.getReceiverType()); // 派单方式 0-区域派单;1-距离派单
|
||||
model.setOrderDistance(routingInspectionOrderParam.getOrderDistance()); //派单距离
|
||||
model.setRemark(routingInspectionOrderParam.getRemark()); //备注
|
||||
if(routingInspectionOrderParam.getReceiverType() == 0){ //派单方式是区域派单的话派单距离清空
|
||||
model.setOrderDistance(null); //派单距离
|
||||
}
|
||||
routingInspectionOrderMapper.updateById(model);
|
||||
}
|
||||
|
||||
|
@ -174,4 +221,67 @@ public class RoutingInspectionOrderServiceImpl implements IRoutingInspectionOrde
|
|||
routingInspectionOrderMapper.updateById(model);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改派单方式
|
||||
*
|
||||
* @param routingInspectionOrderParam
|
||||
*/
|
||||
@Override
|
||||
public void alterReceiverType(RoutingInspectionOrderParam routingInspectionOrderParam) {
|
||||
RoutingInspectionOrder model = routingInspectionOrderMapper.selectOne(
|
||||
new QueryWrapper<RoutingInspectionOrder>()
|
||||
.eq("id", routingInspectionOrderParam.getId())
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
|
||||
Assert.notNull(model, "数据不存在!");
|
||||
|
||||
model.setReceiverType(routingInspectionOrderParam.getReceiverType()); // 派单方式 0-区域派单;1-距离派单
|
||||
model.setOrderDistance(routingInspectionOrderParam.getOrderDistance()); //派单距离
|
||||
if(routingInspectionOrderParam.getReceiverType() == 0){ //派单方式是区域派单的话派单距离清空
|
||||
model.setOrderDistance(null); //派单距离
|
||||
}
|
||||
routingInspectionOrderMapper.updateById(model);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改抢单范围
|
||||
*
|
||||
* @param routingInspectionOrderParam
|
||||
*/
|
||||
@Override
|
||||
public void alterOrderDistance(RoutingInspectionOrderParam routingInspectionOrderParam) {
|
||||
RoutingInspectionOrder model = routingInspectionOrderMapper.selectOne(
|
||||
new QueryWrapper<RoutingInspectionOrder>()
|
||||
.eq("id", routingInspectionOrderParam.getId())
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
|
||||
Assert.notNull(model, "数据不存在!");
|
||||
|
||||
model.setOrderDistance(routingInspectionOrderParam.getOrderDistance()); //派单距离
|
||||
if(model.getReceiverType() == 0){ //派单方式是区域派单的话派单距离清空
|
||||
model.setOrderDistance(null); //派单距离
|
||||
}
|
||||
routingInspectionOrderMapper.updateById(model);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新派工
|
||||
*
|
||||
* @param routingInspectionOrderParam
|
||||
*/
|
||||
@Override
|
||||
public void reassignment(RoutingInspectionOrderParam routingInspectionOrderParam) {
|
||||
RoutingInspectionOrder model = routingInspectionOrderMapper.selectOne(
|
||||
new QueryWrapper<RoutingInspectionOrder>()
|
||||
.eq("id", routingInspectionOrderParam.getId())
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
|
||||
Assert.notNull(model, "数据不存在!");
|
||||
model.setReceiverId(routingInspectionOrderParam.getReceiverId());
|
||||
routingInspectionOrderMapper.updateById(model);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -189,7 +189,15 @@ public class SystemAuthAdminServiceImpl implements ISystemAuthAdminService {
|
|||
systemAuthAdminVo.setUpdateTime(TimeUtil.timestampToDate(sysAdmin.getUpdateTime()));
|
||||
systemAuthAdminVo.setCreateTime(TimeUtil.timestampToDate(sysAdmin.getCreateTime()));
|
||||
systemAuthAdminVo.setLastLoginTime(TimeUtil.timestampToDate(sysAdmin.getLastLoginTime()));
|
||||
|
||||
systemAuthAdminVo.setPlantId(sysAdmin.getPlantId());
|
||||
Plant model = plantMapper.selectOne(
|
||||
new QueryWrapper<Plant>()
|
||||
.eq("id", sysAdmin.getPlantId())
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
if(model != null){
|
||||
systemAuthAdminVo.setPlantName(model.getName()); //工厂名
|
||||
}
|
||||
// 角色权限
|
||||
List<String> auths = new LinkedList<>();
|
||||
if (adminId > 1) {
|
||||
|
|
|
@ -33,11 +33,9 @@ public class RoutingInspectionOrderParam implements Serializable {
|
|||
|
||||
private Integer inspectionOrderStatus;
|
||||
|
||||
@NotNull(message = "clientId参数缺失", groups = {create.class, update.class})
|
||||
@DecimalMin(value = "0", message = "clientId参数值不能少于0", groups = {create.class, update.class})
|
||||
private Long clientId;
|
||||
|
||||
@NotNull(message = "deviceId参数缺失", groups = {create.class, update.class})
|
||||
@DecimalMin(value = "0", message = "deviceId参数值不能少于0", groups = {create.class, update.class})
|
||||
private Long deviceId;
|
||||
|
||||
|
@ -63,6 +61,6 @@ public class RoutingInspectionOrderParam implements Serializable {
|
|||
private Long creatorId;
|
||||
private Integer receiverType; // 接单类型 0-区域派单;1-距离派单
|
||||
private BigDecimal orderDistance; // 订单距离
|
||||
private Integer workOrderFlow; // 工单去向 (0=工单池,1=检修员)
|
||||
private Integer repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
package com.hcy.admin.vo.order;
|
||||
|
||||
import com.hcy.admin.validate.order.RoutingInspectionOrderParam;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.DecimalMin;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
@ -15,16 +20,21 @@ public class RoutingInspectionOrderDetailVo implements Serializable {
|
|||
|
||||
private Long id; // 主键id
|
||||
private String orderNo; // 订单编号
|
||||
private Long orderSource; // 订单来源 1-系统创建;4-客服创建
|
||||
private Long inspectionOrderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
||||
private Integer orderSource; // 订单来源 1-系统创建;4-客服创建
|
||||
private Integer repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
|
||||
private Integer inspectionOrderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
||||
private Long clientId; // 客户id
|
||||
private Long deviceId; // 设备id
|
||||
private Long provinceId; // 省id
|
||||
private Long cityId; // 市id
|
||||
private Long districtId; // 区id
|
||||
private Long receiverId; // 接单人id
|
||||
private Date receiverTime; // 接单时间
|
||||
private String remark; // 备注
|
||||
private Long creatorId; // 创建人id
|
||||
private Integer creatorId; // 创建人id
|
||||
private Integer receiverType; // 接单类型 0-区域派单;1-距离派单
|
||||
private BigDecimal orderDistance; // 订单距离
|
||||
private String clientName; // 客户名称
|
||||
private String deviceNumber; //设备编号
|
||||
private String deviceName; //设备名称
|
||||
private String detailedAddress; // 设备详细地址
|
||||
private String receiverName; // 接单人名称
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ public class RoutingInspectionOrderListVo implements Serializable {
|
|||
private String orderNo; // 订单编号
|
||||
private Long orderSource; // 订单来源 1-系统创建;4-客服创建
|
||||
private Long receiverType; // 接单类型 0-区域派单;1-距离派单
|
||||
private Long repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
|
||||
private Long provinceId; // 省id
|
||||
private Long cityId; // 市id
|
||||
private Long districtId; // 区id
|
||||
|
@ -28,6 +29,7 @@ public class RoutingInspectionOrderListVo implements Serializable {
|
|||
private Long deviceId; // 设备id
|
||||
private String deviceNumber; //设备编号
|
||||
private String deviceName; //设备名称
|
||||
private String detailedAddress; // 设备详细地址
|
||||
private Long creatorId; // 创建人id
|
||||
private String creatorName; //创建人名称
|
||||
private String createTime; // 创建时间
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
package com.hcy.common.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class RoutingInspectionOrderDto implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Long id; // 主键id
|
||||
private String orderNo; // 订单编号
|
||||
private Long orderSource; // 订单来源 1-系统创建;4-客服创建
|
||||
private Long repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
|
||||
private Long receiverType; // 接单类型 0-区域派单;1-距离派单
|
||||
private Long provinceId; // 省id
|
||||
private Long cityId; // 市id
|
||||
private Long districtId; // 区id
|
||||
private String remark; // 备注
|
||||
private Date orderAccomplishTime; // 订单完成时间
|
||||
private Long clientId; // 客户id
|
||||
private String clientName; // 客户名称
|
||||
private Long deviceId; // 设备id
|
||||
private String deviceNumber; //设备编号
|
||||
private String deviceName; //设备名称
|
||||
private String detailedAddress; // 设备详细地址
|
||||
private Long creatorId; // 创建人id
|
||||
private String creatorName; //创建人名称
|
||||
private String createTime; // 创建时间
|
||||
private Long familiarFaultId; // 常见维修结论id
|
||||
private String familiarFaultName; //故障类型
|
||||
private Long inspectionOrderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
||||
private Long receiverId; // 接单人id
|
||||
private String receiverName; // 接单人名称
|
||||
private Date receiverTime; // 接单时间
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
package com.hcy.common.entity.order;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
|
||||
|
@ -20,6 +22,7 @@ public class RoutingInspectionOrder implements Serializable {
|
|||
private Long id; // 主键id
|
||||
private String orderNo; // 订单编号
|
||||
private Integer orderSource; // 订单来源 1-系统创建;4-客服创建
|
||||
private Integer repairWorkOrderFlow; //工单去向 0=工单池 1=检修员
|
||||
private Integer inspectionOrderStatus; // 订单状态 0-待抢单;1-待接单;2-接单超时;3-巡检中;4-已完成;5-已退单;6-待巡检
|
||||
private Long clientId; // 客户id
|
||||
private Long deviceId; // 设备id
|
||||
|
@ -30,6 +33,7 @@ public class RoutingInspectionOrder implements Serializable {
|
|||
private Long provinceId; // 省id
|
||||
private Long cityId; // 市id
|
||||
private Long districtId; // 区id
|
||||
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||
private BigDecimal orderDistance; // 订单距离
|
||||
private BigDecimal totalAmount; // 总金额
|
||||
private BigDecimal actualAmount; // 实际金额
|
||||
|
|
|
@ -1,13 +1,24 @@
|
|||
package com.hcy.common.mapper.order;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.hcy.common.core.basics.IBaseMapper;
|
||||
import com.hcy.common.dto.RoutingInspectionOrderDto;
|
||||
import com.hcy.common.entity.order.RoutingInspectionOrder;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 巡检订单Mapper
|
||||
*/
|
||||
@Mapper
|
||||
public interface RoutingInspectionOrderMapper extends IBaseMapper<RoutingInspectionOrder> {
|
||||
|
||||
/**
|
||||
* 巡检单列表
|
||||
* @param page
|
||||
* @param form
|
||||
* @return
|
||||
*/
|
||||
Page<RoutingInspectionOrderDto> pageList(@Param("page") Page page, @Param("form") RoutingInspectionOrderDto form);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hcy.common.mapper.order.RoutingInspectionOrderMapper">
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.hcy.common.entity.order.RoutingInspectionOrder">
|
||||
</resultMap>
|
||||
|
||||
<select id="pageList" resultType="com.hcy.common.dto.RoutingInspectionOrderDto">
|
||||
SELECT
|
||||
i.*,
|
||||
c.client_name,
|
||||
e.number as deviceNumber,e.name as deviceName,e.detailed_address,
|
||||
a.nickname as creatorName,
|
||||
f.`name` as familiarFaultName,
|
||||
aa.nickname as receiverName
|
||||
FROM
|
||||
la_routing_inspection_order AS i
|
||||
LEFT JOIN la_client AS c ON i.client_id = c.id
|
||||
LEFT JOIN la_equipment AS e ON i.device_id = e.id
|
||||
LEFT JOIN la_system_auth_admin AS a ON i.creator_id = a.id
|
||||
LEFT JOIN la_common_fault AS f ON i.fault_id = f.id
|
||||
LEFT JOIN la_system_auth_admin as aa on i.receiver_id = aa.id
|
||||
WHERE
|
||||
i.is_delete = 0
|
||||
<if test="form.orderNo != null and form.orderNo != ''">
|
||||
and i.order_no like concat('%', #{form.orderNo}, '%')
|
||||
</if>
|
||||
<if test="form.clientName != null and form.clientName != ''">
|
||||
and c.client_name LIKE concat('%', #{form.clientName}, '%')
|
||||
</if>
|
||||
<if test="form.deviceName != null and form.deviceName != ''">
|
||||
and e.`name` LIKE concat('%', #{form.deviceName}, '%')
|
||||
</if>
|
||||
<if test="form.receiverName != null and form.receiverName != ''">
|
||||
and aa.nickname LIKE concat('%', #{form.receiverName}, '%')
|
||||
</if>
|
||||
<if test="form.orderSource != null">
|
||||
and i.order_source = #{form.orderSource}
|
||||
</if>
|
||||
<if test="form.inspectionOrderStatus != null">
|
||||
and i.inspection_order_status = #{form.inspectionOrderStatus}
|
||||
</if>
|
||||
ORDER BY i.id DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hcy.common.mapper.order.RoutingInspectionOrderMapper">
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.hcy.common.entity.order.RoutingInspectionOrder">
|
||||
</resultMap>
|
||||
|
||||
<select id="pageList" resultType="com.hcy.common.dto.RoutingInspectionOrderDto">
|
||||
SELECT
|
||||
i.*,
|
||||
c.client_name,
|
||||
e.number as deviceNumber,e.name as deviceName,e.detailed_address,
|
||||
a.nickname as creatorName,
|
||||
f.`name` as familiarFaultName,
|
||||
aa.nickname as receiverName
|
||||
FROM
|
||||
la_routing_inspection_order AS i
|
||||
LEFT JOIN la_client AS c ON i.client_id = c.id
|
||||
LEFT JOIN la_equipment AS e ON i.device_id = e.id
|
||||
LEFT JOIN la_system_auth_admin AS a ON i.creator_id = a.id
|
||||
LEFT JOIN la_common_fault AS f ON i.fault_id = f.id
|
||||
LEFT JOIN la_system_auth_admin as aa on i.receiver_id = aa.id
|
||||
WHERE
|
||||
i.is_delete = 0
|
||||
<if test="form.orderNo != null and form.orderNo != ''">
|
||||
and i.order_no like concat('%', #{form.orderNo}, '%')
|
||||
</if>
|
||||
<if test="form.clientName != null and form.clientName != ''">
|
||||
and c.client_name LIKE concat('%', #{form.clientName}, '%')
|
||||
</if>
|
||||
<if test="form.deviceName != null and form.deviceName != ''">
|
||||
and e.`name` LIKE concat('%', #{form.deviceName}, '%')
|
||||
</if>
|
||||
<if test="form.receiverName != null and form.receiverName != ''">
|
||||
and aa.nickname LIKE concat('%', #{form.receiverName}, '%')
|
||||
</if>
|
||||
<if test="form.orderSource != null">
|
||||
and i.order_source = #{form.orderSource}
|
||||
</if>
|
||||
<if test="form.inspectionOrderStatus != null">
|
||||
and i.inspection_order_status = #{form.inspectionOrderStatus}
|
||||
</if>
|
||||
ORDER BY i.id DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue