更新0903
This commit is contained in:
parent
8691f9e94a
commit
d459f840d8
@ -777,7 +777,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</select>
|
</select>
|
||||||
<select id="workOrderDataNew" resultType="java.util.Map">
|
<select id="workOrderDataNew" resultType="java.util.Map">
|
||||||
select ifnull(sum(case when oi.pay_type != 'sz' then oi.pay_money else 0 end), 0) as payMoneySum
|
select ifnull(sum(case when oi.pay_type != 'sz' then oi.pay_money else 0 end), 0) as payMoneySum
|
||||||
,IFNULL(SUM(CASE WHEN NOT (ins.status = '1' AND ins.is_pass = '0') THEN oi.goods_price ELSE 0 END), 0) goodsPriceSum
|
,IFNULL(SUM(CASE WHEN NOT (ins.status = '1' AND ins.is_pass = '0') THEN oi.goods_price ELSE 0 END), 0) goodsPric eSum
|
||||||
from inspection_info ins
|
from inspection_info ins
|
||||||
left join order_info oi on oi.id = ins.inspection_order_id
|
left join order_info oi on oi.id = ins.inspection_order_id
|
||||||
left join system_users su on su.id = ins.user_id
|
left join system_users su on su.id = ins.user_id
|
||||||
|
@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|||||||
import cn.iocoder.yudao.module.base.service.RepairStatisticsService;
|
import cn.iocoder.yudao.module.base.service.RepairStatisticsService;
|
||||||
import cn.iocoder.yudao.module.base.vo.QueryBusinessReqVO;
|
import cn.iocoder.yudao.module.base.vo.QueryBusinessReqVO;
|
||||||
import cn.iocoder.yudao.module.base.vo.QueryBusinessResp;
|
import cn.iocoder.yudao.module.base.vo.QueryBusinessResp;
|
||||||
|
import cn.iocoder.yudao.module.base.vo.QueryTableResp;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
@ -155,4 +156,19 @@ public class RepairStatisticsController {
|
|||||||
return CommonResult.success(statisticsService.listBusinessByCustomerOrCar(reqVO,page));
|
return CommonResult.success(statisticsService.listBusinessByCustomerOrCar(reqVO,page));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author 许
|
||||||
|
* @Description 根据客户或者车辆查询订单列表
|
||||||
|
* @Date 17:06 2025/9/1
|
||||||
|
* @Param [reqVO, pageNo, pageSize]
|
||||||
|
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||||
|
**/
|
||||||
|
@GetMapping("/pageByCustomerOrCar")
|
||||||
|
public CommonResult<?> pageByCustomerOrCar(QueryBusinessReqVO reqVO,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||||
|
Page<QueryTableResp> page = new Page<>(pageNo, pageSize);
|
||||||
|
return CommonResult.success(statisticsService.pageByCustomerOrCar(reqVO,page));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.base.mapper;
|
package cn.iocoder.yudao.module.base.mapper;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.base.vo.QueryBusinessReqVO;
|
import cn.iocoder.yudao.module.base.vo.*;
|
||||||
import cn.iocoder.yudao.module.base.vo.QueryBusinessResp;
|
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairStatisticsVO;
|
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairTicketStatisticsVO;
|
|
||||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
|
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -118,4 +115,13 @@ public interface RepairStatisticsMapper {
|
|||||||
* @return java.util.List
|
* @return java.util.List
|
||||||
**/
|
**/
|
||||||
IPage<QueryBusinessResp> listBusinessByCar(@Param("reqVO") QueryBusinessReqVO reqVO,@Param("page") Page<QueryBusinessResp> page);
|
IPage<QueryBusinessResp> listBusinessByCar(@Param("reqVO") QueryBusinessReqVO reqVO,@Param("page") Page<QueryBusinessResp> page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author 许
|
||||||
|
* @Description 根据客户或车牌查询订单
|
||||||
|
* @Date 17:13 2025/9/1
|
||||||
|
* @Param [reqVO, page]
|
||||||
|
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.base.vo.QueryTableResp>
|
||||||
|
**/
|
||||||
|
IPage<QueryTableResp> pageByCustomerOrCar(@Param("reqVO") QueryBusinessReqVO reqVO,@Param("page") Page<QueryTableResp> page);
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.base.service;
|
package cn.iocoder.yudao.module.base.service;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.base.vo.QueryBusinessReqVO;
|
import cn.iocoder.yudao.module.base.vo.*;
|
||||||
import cn.iocoder.yudao.module.base.vo.QueryBusinessResp;
|
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairStatisticsVO;
|
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairTicketStatisticsVO;
|
|
||||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
|
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -94,4 +91,13 @@ public interface RepairStatisticsService {
|
|||||||
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.base.vo.QueryBusinessResp>
|
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.base.vo.QueryBusinessResp>
|
||||||
**/
|
**/
|
||||||
IPage<QueryBusinessResp> listBusinessByCustomerOrCar(QueryBusinessReqVO reqVO, Page<QueryBusinessResp> page);
|
IPage<QueryBusinessResp> listBusinessByCustomerOrCar(QueryBusinessReqVO reqVO, Page<QueryBusinessResp> page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author 许
|
||||||
|
* @Description 根据客户或者车辆插叙订单
|
||||||
|
* @Date 17:08 2025/9/1
|
||||||
|
* @Param [reqVO, page]
|
||||||
|
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.base.vo.QueryTableResp>
|
||||||
|
**/
|
||||||
|
IPage<QueryTableResp> pageByCustomerOrCar(QueryBusinessReqVO reqVO, Page<QueryTableResp> page);
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,7 @@ package cn.iocoder.yudao.module.base.service.impl;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.module.base.mapper.RepairStatisticsMapper;
|
import cn.iocoder.yudao.module.base.mapper.RepairStatisticsMapper;
|
||||||
import cn.iocoder.yudao.module.base.service.RepairStatisticsService;
|
import cn.iocoder.yudao.module.base.service.RepairStatisticsService;
|
||||||
import cn.iocoder.yudao.module.base.vo.QueryBusinessReqVO;
|
import cn.iocoder.yudao.module.base.vo.*;
|
||||||
import cn.iocoder.yudao.module.base.vo.QueryBusinessResp;
|
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairStatisticsVO;
|
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairTicketStatisticsVO;
|
|
||||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
|
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -151,4 +148,17 @@ public class RepairStatisticsServiceImpl implements RepairStatisticsService {
|
|||||||
}
|
}
|
||||||
return queryBusinessResps;
|
return queryBusinessResps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.base.vo.QueryTableResp>
|
||||||
|
* @Author 许
|
||||||
|
* @Description 根据客户或者车辆插叙订单
|
||||||
|
* @Date 17:08 2025/9/1
|
||||||
|
* @Param [reqVO, page]
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public IPage<QueryTableResp> pageByCustomerOrCar(QueryBusinessReqVO reqVO, Page<QueryTableResp> page) {
|
||||||
|
IPage<QueryTableResp> queryTableResps = statisticsMapper.pageByCustomerOrCar(reqVO,page);
|
||||||
|
return queryTableResps;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,4 +27,14 @@ public class QueryBusinessReqVO {
|
|||||||
* 搜索
|
* 搜索
|
||||||
*/
|
*/
|
||||||
private String search;
|
private String search;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车牌
|
||||||
|
*/
|
||||||
|
private String carNo;
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,11 @@ public class QueryBusinessResp {
|
|||||||
*/
|
*/
|
||||||
private String source;
|
private String source;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务来源
|
||||||
|
*/
|
||||||
|
private String sourceStr;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车牌号
|
* 车牌号
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
package cn.iocoder.yudao.module.base.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*@BelongsProject: lanan-system
|
||||||
|
*@BelongsPackage: cn.iocoder.yudao.module.base.vo
|
||||||
|
*@Author: 许
|
||||||
|
*@CreateTime: 2025-09-01 17:07
|
||||||
|
*@Description: 查询表单
|
||||||
|
*@Version: 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class QueryTableResp extends DlRepairTickets {
|
||||||
|
/**
|
||||||
|
* 订单ID
|
||||||
|
*/
|
||||||
|
private String orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工单来源
|
||||||
|
*/
|
||||||
|
private String sourceStr;
|
||||||
|
}
|
@ -477,6 +477,20 @@ public class DlRepairTicketsController {
|
|||||||
return success(dlRepairTicketsService.getBossNum(selectType, startDate, endDate));
|
return success(dlRepairTicketsService.getBossNum(selectType, startDate, endDate));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author 许
|
||||||
|
* @Description 数据统计-新版
|
||||||
|
* @Date 10:53 2025/9/1
|
||||||
|
* @Param [startDate, endDate]
|
||||||
|
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||||
|
**/
|
||||||
|
@GetMapping("/getBossNumNew")
|
||||||
|
@Operation(summary = "从总检的角度查进场数、维修中、已完成、已交车、在厂的工单数量")
|
||||||
|
public CommonResult<?> getBossNumNew(@RequestParam(value = "dateRange[0]", required = false) String startDate,
|
||||||
|
@RequestParam(value = "dateRange[1]", required = false) String endDate) {
|
||||||
|
return success(dlRepairTicketsService.getBossNum(startDate, endDate));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取日期范围
|
* 获取日期范围
|
||||||
* @author vinjor-M
|
* @author vinjor-M
|
||||||
|
@ -172,6 +172,15 @@ public interface DlRepairTicketsService extends IService<DlRepairTickets> {
|
|||||||
**/
|
**/
|
||||||
Map<String,Object> getBossNum(String selectType,String startDate,String endDate);
|
Map<String,Object> getBossNum(String selectType,String startDate,String endDate);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author 许
|
||||||
|
* @Description 数据统计
|
||||||
|
* @Date 10:51 2025/9/1
|
||||||
|
* @Param [startDate, endDate]
|
||||||
|
* @return java.util.Map<java.lang.String,java.lang.Object>
|
||||||
|
**/
|
||||||
|
Map<String,Object> getBossNum(String startDate,String endDate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 服务顾问通知客户取车
|
* 服务顾问通知客户取车
|
||||||
*
|
*
|
||||||
|
@ -2012,6 +2012,107 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
|||||||
return rtnMap;
|
return rtnMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author 许
|
||||||
|
* @Description 数据统计
|
||||||
|
* @Date 10:51 2025/9/1
|
||||||
|
* @Param [startDate, endDate]
|
||||||
|
* @return java.util.Map<java.lang.String,java.lang.Object>
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
// ... existing code ...
|
||||||
|
public Map<String, Object> getBossNum(String startDate, String endDate) {
|
||||||
|
Map<String, Object> rtnMap = new HashMap<>();
|
||||||
|
long workingNum = 0;
|
||||||
|
long inCompanyNum = 0;
|
||||||
|
long newOrderNum = 0;
|
||||||
|
long overNum = 0;
|
||||||
|
long giveCusNum = 0;
|
||||||
|
long noPayNum = 0;
|
||||||
|
|
||||||
|
List<String> workingIdList = new ArrayList<>();
|
||||||
|
List<String> inCompanyIdList = new ArrayList<>();
|
||||||
|
List<String> newOrderIdList = new ArrayList<>();
|
||||||
|
List<String> overIdList = new ArrayList<>();
|
||||||
|
List<String> giveCusIdList = new ArrayList<>();
|
||||||
|
List<String> noPayIdList = new ArrayList<>();
|
||||||
|
|
||||||
|
// 查询所有工单
|
||||||
|
List<DlRepairTickets> repairTickets = this.list();
|
||||||
|
if (!repairTickets.isEmpty()) {
|
||||||
|
List<DlRepairTickets> ticketsInRange = repairTickets;
|
||||||
|
|
||||||
|
// 只有当startDate和endDate都不为null时才进行时间过滤
|
||||||
|
if (startDate != null && endDate != null) {
|
||||||
|
// 时间范围
|
||||||
|
LocalDateTime startTime = LocalDateTime.parse(startDate + " 00:00:00", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||||
|
LocalDateTime endTime = LocalDateTime.parse(endDate + " 23:59:59", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
|
||||||
|
|
||||||
|
// 在时间范围内的工单
|
||||||
|
ticketsInRange = repairTickets.stream()
|
||||||
|
.filter(item -> {
|
||||||
|
LocalDateTime createTime = item.getCreateTime();
|
||||||
|
return (createTime.isEqual(startTime) || createTime.isAfter(startTime)) &&
|
||||||
|
(createTime.isEqual(endTime) || createTime.isBefore(endTime));
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
// 维修中
|
||||||
|
workingIdList = ticketsInRange.stream()
|
||||||
|
.filter(item -> TicketsStatusEnum.WORKING.getCode().equals(item.getTicketsStatus()))
|
||||||
|
.map(DlRepairTickets::getId).collect(Collectors.toList());
|
||||||
|
workingNum = workingIdList.size();
|
||||||
|
|
||||||
|
// 在厂(未交车且不是已完成状态 03)
|
||||||
|
inCompanyIdList = ticketsInRange.stream()
|
||||||
|
.filter(item -> "0".equals(item.getIsHandover()))
|
||||||
|
.filter(item -> !"03".equals(item.getTicketsStatus()))
|
||||||
|
.map(DlRepairTickets::getId).collect(Collectors.toList());
|
||||||
|
inCompanyNum = inCompanyIdList.size();
|
||||||
|
|
||||||
|
// 未结算
|
||||||
|
List<String> noPayCodeList = Arrays.asList("04", "05", "07", "01");
|
||||||
|
noPayIdList = ticketsInRange.stream()
|
||||||
|
.filter(item -> noPayCodeList.contains(item.getTicketsStatus()))
|
||||||
|
.map(DlRepairTickets::getId).collect(Collectors.toList());
|
||||||
|
noPayNum = noPayIdList.size();
|
||||||
|
|
||||||
|
// 进厂数(所有在范围内创建的)
|
||||||
|
newOrderIdList = ticketsInRange.stream().map(DlRepairTickets::getId).collect(Collectors.toList());
|
||||||
|
newOrderNum = newOrderIdList.size();
|
||||||
|
|
||||||
|
// 已完成(走 mapper 查记录)
|
||||||
|
overIdList = repairTicketsMapper.selectTicketIdByParams(null, RecordTypeEnum.ZJ.getCode(),
|
||||||
|
startDate != null ? startDate + " 00:00:00" : null,
|
||||||
|
endDate != null ? endDate + " 23:59:59" : null);
|
||||||
|
overNum = overIdList.size();
|
||||||
|
|
||||||
|
// 已交车(走 mapper 查记录)
|
||||||
|
giveCusIdList = repairTicketsMapper.selectTicketIdByParams(null, RecordTypeEnum.JC.getCode(),
|
||||||
|
startDate != null ? startDate + " 00:00:00" : null,
|
||||||
|
endDate != null ? endDate + " 23:59:59" : null);
|
||||||
|
giveCusNum = giveCusIdList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
rtnMap.put("workingNum", workingNum);
|
||||||
|
rtnMap.put("workingIdList", workingIdList);
|
||||||
|
rtnMap.put("inCompanyNum", inCompanyNum);
|
||||||
|
rtnMap.put("inCompanyIdList", inCompanyIdList);
|
||||||
|
rtnMap.put("newOrderNum", newOrderNum);
|
||||||
|
rtnMap.put("newOrderIdList", newOrderIdList);
|
||||||
|
rtnMap.put("overNum", overNum);
|
||||||
|
rtnMap.put("overIdList", overIdList);
|
||||||
|
rtnMap.put("giveCusNum", giveCusNum);
|
||||||
|
rtnMap.put("giveCusIdList", giveCusIdList);
|
||||||
|
rtnMap.put("noPayNum", noPayNum);
|
||||||
|
rtnMap.put("noPayIdList", noPayIdList);
|
||||||
|
return rtnMap;
|
||||||
|
}
|
||||||
|
// ... existing code ...
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 服务顾问通知客户取车
|
* 服务顾问通知客户取车
|
||||||
* @param noticeCusVO 请求对象
|
* @param noticeCusVO 请求对象
|
||||||
|
@ -136,13 +136,14 @@
|
|||||||
r.repair_type AS bizType,
|
r.repair_type AS bizType,
|
||||||
r.in_time AS bizTime,
|
r.in_time AS bizTime,
|
||||||
'repair' AS source,
|
'repair' AS source,
|
||||||
|
'维修' AS sourceStr,
|
||||||
ROW_NUMBER() OVER (PARTITION BY c.id ORDER BY r.in_time DESC) AS rn
|
ROW_NUMBER() OVER (PARTITION BY c.id ORDER BY r.in_time DESC) AS rn
|
||||||
FROM base_customer_main c
|
FROM base_customer_main c
|
||||||
JOIN dl_repair_tickets r ON c.id = r.user_id
|
JOIN dl_repair_tickets r ON c.id = r.user_id
|
||||||
WHERE
|
WHERE
|
||||||
1 = 1 and c.deleted = 0
|
1 = 1 and c.deleted = 0
|
||||||
<if test="reqVO.dateRange != null">
|
<if test="reqVO.dateRange != null">
|
||||||
AND r.in_time BETWEEN #{reqVO.dateRange[0]} AND #{reqVO.dateRange[1]}
|
AND r.in_time BETWEEN CONCAT(#{reqVO.dateRange[0]}, ' 00:00:00') AND CONCAT(#{reqVO.dateRange[1]}, ' 23:59:59')
|
||||||
</if>
|
</if>
|
||||||
<if test="reqVO.search != null and reqVO.search != ''">
|
<if test="reqVO.search != null and reqVO.search != ''">
|
||||||
AND (c.cus_name LIKE CONCAT('%', #{reqVO.search}, '%')
|
AND (c.cus_name LIKE CONCAT('%', #{reqVO.search}, '%')
|
||||||
@ -150,6 +151,7 @@
|
|||||||
OR r.ticket_no LIKE CONCAT('%', #{reqVO.search}, '%')
|
OR r.ticket_no LIKE CONCAT('%', #{reqVO.search}, '%')
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
ORDER BY r.in_time DESC
|
||||||
<!--
|
<!--
|
||||||
UNION ALL
|
UNION ALL
|
||||||
|
|
||||||
@ -194,6 +196,7 @@
|
|||||||
r.repair_type AS bizType,
|
r.repair_type AS bizType,
|
||||||
r.create_time AS bizTime,
|
r.create_time AS bizTime,
|
||||||
'repair' AS source,
|
'repair' AS source,
|
||||||
|
'维修' AS sourceStr,
|
||||||
ROW_NUMBER() OVER (PARTITION BY car.id ORDER BY r.in_time DESC) AS rn
|
ROW_NUMBER() OVER (PARTITION BY car.id ORDER BY r.in_time DESC) AS rn
|
||||||
FROM base_car_main car
|
FROM base_car_main car
|
||||||
JOIN base_customer_car cc ON car.id = cc.car_id
|
JOIN base_customer_car cc ON car.id = cc.car_id
|
||||||
@ -223,7 +226,7 @@
|
|||||||
) t
|
) t
|
||||||
WHERE t.rn = 1
|
WHERE t.rn = 1
|
||||||
<if test="reqVO.dateRange != null">
|
<if test="reqVO.dateRange != null">
|
||||||
AND t.biz_time BETWEEN #{reqVO.dateRange[0]} AND #{reqVO.dateRange[1]}
|
AND t.bizTime BETWEEN CONCAT(#{reqVO.dateRange[0]}, ' 00:00:00') AND CONCAT( #{reqVO.dateRange[1]}, ' 23:59:59')
|
||||||
</if>
|
</if>
|
||||||
<if test="reqVO.search != null and reqVO.search != ''">
|
<if test="reqVO.search != null and reqVO.search != ''">
|
||||||
AND (t.customerName LIKE CONCAT('%', #{reqVO.search}, '%')
|
AND (t.customerName LIKE CONCAT('%', #{reqVO.search}, '%')
|
||||||
@ -231,5 +234,20 @@
|
|||||||
OR t.carNum LIKE CONCAT('%', #{reqVO.search}, '%')
|
OR t.carNum LIKE CONCAT('%', #{reqVO.search}, '%')
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
|
ORDER BY t.bizTime DESC
|
||||||
|
</select>
|
||||||
|
<select id="pageByCustomerOrCar" resultType="cn.iocoder.yudao.module.base.vo.QueryTableResp">
|
||||||
|
SELECT drt.*, '维修' AS sourceStr
|
||||||
|
FROM dl_repair_tickets drt
|
||||||
|
WHERE 1=1
|
||||||
|
<if test="reqVO.dateRange != null">
|
||||||
|
AND DATE(drt.create_time) BETWEEN #{reqVO.dateRange[0]} AND #{reqVO.dateRange[1]}
|
||||||
|
</if>
|
||||||
|
<if test="reqVO.phone != null and reqVO.phone != ''">
|
||||||
|
AND drt.user_mobile LIKE CONCAT('%', #{reqVO.phone}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="reqVO.carNo != null and reqVO.carNo != ''">
|
||||||
|
AND drt.car_no LIKE CONCAT('%', #{reqVO.carNo}, '%')
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user