更新0905
This commit is contained in:
parent
d459f840d8
commit
3b5e96f08c
@ -74,7 +74,8 @@ public class InspectionBusinessChannelController {
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.joining(","));
|
||||
channel.setUserIds(userIds);
|
||||
|
||||
}else if (ObjectUtil.isEmpty(channel.getUserIds())) {
|
||||
channel.setUserIds("");
|
||||
}
|
||||
return CommonResult.success(inspectionBusinessChannelService.updateById(channel));
|
||||
}
|
||||
|
@ -777,7 +777,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
<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
|
||||
,IFNULL(SUM(CASE WHEN NOT (ins.status = '1' AND ins.is_pass = '0') THEN oi.goods_price ELSE 0 END), 0) goodsPric eSum
|
||||
,IFNULL(SUM(CASE WHEN NOT (ins.status = '1' AND ins.is_pass = '0') THEN oi.goods_price ELSE 0 END), 0) goodsPriceSum
|
||||
from inspection_info ins
|
||||
left join order_info oi on oi.id = ins.inspection_order_id
|
||||
left join system_users su on su.id = ins.user_id
|
||||
|
@ -60,4 +60,9 @@ public class QueryBusinessResp {
|
||||
* 车牌号
|
||||
*/
|
||||
private String carNum;
|
||||
|
||||
/**
|
||||
* 经办人
|
||||
*/
|
||||
private String handleName;
|
||||
}
|
||||
|
@ -491,6 +491,19 @@ public class DlRepairTicketsController {
|
||||
return success(dlRepairTicketsService.getBossNum(startDate, endDate));
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author 许
|
||||
* @Description 统计详情-细分工单类型
|
||||
* @Date 14:14 2025/9/3
|
||||
* @Param [startDate, endDate]
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||
**/
|
||||
@GetMapping("/getBossNumStatistics")
|
||||
public CommonResult<?> getBossNumStatistics(@RequestParam(value = "dateRange[0]", required = false) String startDate,
|
||||
@RequestParam(value = "dateRange[1]", required = false) String endDate) {
|
||||
return success(dlRepairTicketsService.getBossNumStatistics(startDate, endDate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取日期范围
|
||||
* @author vinjor-M
|
||||
|
@ -35,7 +35,7 @@ public class DlRepairTickets extends TenantBaseDO {
|
||||
/**
|
||||
* 业务类型(repair_type)
|
||||
*/
|
||||
private String repairType;
|
||||
private String repairType;
|
||||
|
||||
/**
|
||||
* 用户ID(system_users表的ID)
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.tickets.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.tickets.entity.DlRepairTickets;
|
||||
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsReqVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -57,6 +58,16 @@ public interface DlRepairTicketsMapper extends BaseMapper<DlRepairTickets> {
|
||||
**/
|
||||
List<String> selectTicketIdByParams(@Param("nowDate")String dayDate, @Param("recordCode")String recordCode, @Param("startTime")String startTime, @Param("endTime")String endTime);
|
||||
|
||||
|
||||
/**
|
||||
* @Author 许
|
||||
* @Description 根据条件查询统计
|
||||
* @Date 11:32 2025/9/4
|
||||
* @Param [queryWrapper]
|
||||
* @return java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
|
||||
**/
|
||||
List<Map<String, Object>> selectTicketIdByParamsNew(@Param("ew") QueryWrapper<DlRepairTickets> queryWrapper);
|
||||
|
||||
/**
|
||||
* @Author 许
|
||||
* @Description 统计工单
|
||||
@ -66,6 +77,9 @@ public interface DlRepairTicketsMapper extends BaseMapper<DlRepairTickets> {
|
||||
**/
|
||||
|
||||
Map<String, Object> getStatistics(@Param("map") DlRepairTicketsReqVO repairTicketsReqVO);
|
||||
|
||||
// 通用金额求和查询
|
||||
List<Map<String, Object>> selectSumAmount(@Param("ew") QueryWrapper<DlRepairTickets> receivableWrapper);
|
||||
}
|
||||
|
||||
|
||||
|
@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -327,4 +328,13 @@ public interface DlRepairTicketsService extends IService<DlRepairTickets> {
|
||||
**/
|
||||
|
||||
TicketsSettlementVO getSettlement(DlRepairTicketsReqVO repairTicketsReqVO);
|
||||
|
||||
/**
|
||||
* @Author 许
|
||||
* @Description 统计详情-细分工单类型
|
||||
* @Date 14:15 2025/9/3
|
||||
* @Param [startDate, endDate]
|
||||
* @return java.util.List<java.util.Map>
|
||||
**/
|
||||
Map<String, Object> getBossNumStatistics(String startDate, String endDate);
|
||||
}
|
||||
|
@ -66,8 +66,10 @@ import cn.iocoder.yudao.module.tickets.vo.*;
|
||||
import cn.iocoder.yudao.util.CreateQRCodeUtil;
|
||||
import cn.iocoder.yudao.util.SendSmsUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
@ -750,44 +752,44 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
// // 线上支付需要在回调中去更新状态工单状态和订单状态
|
||||
//
|
||||
// } else {
|
||||
// 线下支付和签单、挂账等其他支付方式才是直接结束工单和订单
|
||||
DlRepairTickets repairTickets = this.getById(repairTicketsRespVO.getId());
|
||||
//设置工单支付状态
|
||||
repairTicketsRespVO.setPayStatus("03");
|
||||
if ("1".equals(repairTickets.getIsHandover())) {
|
||||
//已交车,已结算。那么工单状态改为 已完成
|
||||
repairTicketsRespVO.setTicketsStatus(TicketsStatusEnum.OVER.getCode());
|
||||
//工单结束
|
||||
repairTicketsRespVO.setIsFinish("1");
|
||||
}
|
||||
// 线下支付和签单、挂账等其他支付方式才是直接结束工单和订单
|
||||
DlRepairTickets repairTickets = this.getById(repairTicketsRespVO.getId());
|
||||
//设置工单支付状态
|
||||
repairTicketsRespVO.setPayStatus("03");
|
||||
if ("1".equals(repairTickets.getIsHandover())) {
|
||||
//已交车,已结算。那么工单状态改为 已完成
|
||||
repairTicketsRespVO.setTicketsStatus(TicketsStatusEnum.OVER.getCode());
|
||||
//工单结束
|
||||
repairTicketsRespVO.setIsFinish("1");
|
||||
}
|
||||
|
||||
// 根据工单id 查询工单记录中的审批记录
|
||||
RepairRecords record = repairRecordsService.getOne(Wrappers.<RepairRecords>lambdaQuery()
|
||||
.eq(RepairRecords::getTicketId, repairTicketsRespVO.getId())
|
||||
.eq(RepairRecords::getType, RecordTypeEnum.JSSP)
|
||||
.orderByDesc(RepairRecords::getCreateTime)
|
||||
.last("limit 1"));
|
||||
// 根据工单id 查询工单记录中的审批记录
|
||||
RepairRecords record = repairRecordsService.getOne(Wrappers.<RepairRecords>lambdaQuery()
|
||||
.eq(RepairRecords::getTicketId, repairTicketsRespVO.getId())
|
||||
.eq(RepairRecords::getType, RecordTypeEnum.JSSP)
|
||||
.orderByDesc(RepairRecords::getCreateTime)
|
||||
.last("limit 1"));
|
||||
|
||||
// 提取冗余字段
|
||||
String otherData = record.getOtherData();
|
||||
// 将json 转为对象
|
||||
TicketsSettlementVO approvalVO = JSON.parseObject(otherData, TicketsSettlementVO.class);
|
||||
// 提取冗余字段
|
||||
String otherData = record.getOtherData();
|
||||
// 将json 转为对象
|
||||
TicketsSettlementVO approvalVO = JSON.parseObject(otherData, TicketsSettlementVO.class);
|
||||
|
||||
// 设置订单金额信息
|
||||
repairOrderInfo.setPayMoney(approvalVO.getActualMoney());
|
||||
repairOrderInfo.setGoodsPrice(approvalVO.getMoney());
|
||||
// 设置订单金额信息
|
||||
repairOrderInfo.setPayMoney(approvalVO.getActualMoney());
|
||||
repairOrderInfo.setGoodsPrice(approvalVO.getMoney());
|
||||
|
||||
//判断优惠类型
|
||||
if (approvalVO.getDiscountType().equals("1")) {
|
||||
repairOrderInfo.setReduceMoney(BigDecimal.valueOf(approvalVO.getDiscount()));
|
||||
} else if (approvalVO.getDiscountType().equals("2")) {
|
||||
// 折扣计算
|
||||
repairOrderInfo.setReduceMoney(repairOrderInfo.getGoodsPrice().multiply(BigDecimal.valueOf(approvalVO.getDiscount() / 10)));
|
||||
}
|
||||
//判断优惠类型
|
||||
if (approvalVO.getDiscountType().equals("1")) {
|
||||
repairOrderInfo.setReduceMoney(BigDecimal.valueOf(approvalVO.getDiscount()));
|
||||
} else if (approvalVO.getDiscountType().equals("2")) {
|
||||
// 折扣计算
|
||||
repairOrderInfo.setReduceMoney(repairOrderInfo.getGoodsPrice().multiply(BigDecimal.valueOf(approvalVO.getDiscount() / 10)));
|
||||
}
|
||||
|
||||
// 设置订单支付时间和支付结果
|
||||
repairOrderInfo.setPayTime(LocalDateTime.now());
|
||||
repairOrderInfo.setOrderStatus("1");
|
||||
// 设置订单支付时间和支付结果
|
||||
repairOrderInfo.setPayTime(LocalDateTime.now());
|
||||
repairOrderInfo.setOrderStatus("1");
|
||||
// }
|
||||
// 更新工单
|
||||
baseMapper.updateById(repairTicketsRespVO);
|
||||
@ -885,6 +887,223 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
return approvalVO;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return java.util.List<java.util.Map>
|
||||
* @Author 许
|
||||
* @Description 统计详情-细分工单类型
|
||||
* @Date 14:15 2025/9/3
|
||||
* @Param [startDate, endDate]
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> getBossNumStatistics(String startDate, String endDate) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
List<Map<String, Object>> statsList = new ArrayList<>();
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<DlRepairTickets> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
if (startDate != null && endDate != null) {
|
||||
// 如果有时间范围,添加时间条件
|
||||
queryWrapper.between("create_time",
|
||||
startDate + " 00:00:00",
|
||||
endDate + " 23:59:59");
|
||||
}
|
||||
|
||||
// 根据条件查询工单
|
||||
List<DlRepairTickets> ticketsInRange = this.list(queryWrapper);
|
||||
|
||||
// 维修中(按 repairType 分组)
|
||||
Map<String, Long> workingStats = ticketsInRange.stream()
|
||||
.filter(item -> TicketsStatusEnum.WORKING.getCode().equals(item.getTicketsStatus()))
|
||||
.collect(Collectors.groupingBy(DlRepairTickets::getRepairType, Collectors.counting()));
|
||||
statsList.add(createStatsNode("workingNum", "维修中", workingStats));
|
||||
|
||||
// 在厂(未交车且不是已完成状态 03)
|
||||
Map<String, Long> inCompanyStats = ticketsInRange.stream()
|
||||
.filter(item -> "0".equals(item.getIsHandover()))
|
||||
.filter(item -> !"03".equals(item.getTicketsStatus()))
|
||||
.collect(Collectors.groupingBy(DlRepairTickets::getRepairType, Collectors.counting()));
|
||||
statsList.add(createStatsNode("inCompanyNum", "在厂", inCompanyStats));
|
||||
|
||||
// 未结算
|
||||
List<String> noPayCodeList = Arrays.asList("04", "05", "07", "01");
|
||||
Map<String, Long> noPayStats = ticketsInRange.stream()
|
||||
.filter(item -> noPayCodeList.contains(item.getTicketsStatus()))
|
||||
.collect(Collectors.groupingBy(DlRepairTickets::getRepairType, Collectors.counting()));
|
||||
statsList.add(createStatsNode("noPayNum", "未结算", noPayStats));
|
||||
|
||||
// 进厂数(所有在范围内创建的)
|
||||
Map<String, Long> newOrderStats = ticketsInRange.stream()
|
||||
.collect(Collectors.groupingBy(DlRepairTickets::getRepairType, Collectors.counting()));
|
||||
statsList.add(createStatsNode("newOrderNum", "进厂数", newOrderStats));
|
||||
|
||||
// 已完成(通过 mapper 查询并按 repairType 分组)
|
||||
Map<String, Long> overStats = getOverStatsByRepairType(startDate, endDate);
|
||||
statsList.add(createStatsNode("overNum", "已完成", overStats));
|
||||
|
||||
// 已交车(通过 mapper 查询并按 repairType 分组)
|
||||
Map<String, Long> giveCusStats = getGiveCusStatsByRepairType(startDate, endDate);
|
||||
statsList.add(createStatsNode("giveCusNum", "已交车", giveCusStats));
|
||||
|
||||
// 添加到结果map
|
||||
resultMap.put("stats", statsList);
|
||||
|
||||
// 统计金额信息
|
||||
Map<String, Object> amountStats = calculateAmountStats(startDate, endDate);
|
||||
resultMap.putAll(amountStats);
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
// 获取已完成工单按维修类型分组的统计(优化版本)
|
||||
private Map<String, Long> getOverStatsByRepairType(String startDate, String endDate) {
|
||||
// 直接使用 mapper 查询已完成工单并按 repairType 分组
|
||||
QueryWrapper<DlRepairTickets> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.ne("drt.tickets_status", "03"); // 已完成状态
|
||||
|
||||
if (startDate != null && endDate != null) {
|
||||
queryWrapper.between("drt.create_time",
|
||||
startDate + " 00:00:00",
|
||||
endDate + " 23:59:59");
|
||||
}
|
||||
queryWrapper.eq("drr.type", RecordTypeEnum.ZJ.getCode());
|
||||
|
||||
// // 使用 group by 直接在数据库层面分组统计
|
||||
// List<Map<String, Object>> result = repairTicketsMapper.selectMaps(
|
||||
// queryWrapper.select("repair_type", "count(*) as count")
|
||||
// .groupBy("repair_type")
|
||||
// queryWrapper.getSqlSelect()
|
||||
// );
|
||||
|
||||
// 使用 group by 直接在数据库层面分组统计
|
||||
List<Map<String, Object>> result = repairTicketsMapper.selectTicketIdByParamsNew(
|
||||
queryWrapper.select("repair_type", "count(*) as count")
|
||||
.groupBy("repair_type")
|
||||
);
|
||||
|
||||
return convertGroupResult(result);
|
||||
}
|
||||
|
||||
// 获取已交车工单按维修类型分组的统计(优化版本)
|
||||
private Map<String, Long> getGiveCusStatsByRepairType(String startDate, String endDate) {
|
||||
// 直接使用 mapper 查询已交车工单并按 repairType 分组
|
||||
QueryWrapper<DlRepairTickets> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("is_handover", "1"); // 已交车
|
||||
|
||||
if (startDate != null && endDate != null) {
|
||||
queryWrapper.between("create_time",
|
||||
startDate + " 00:00:00",
|
||||
endDate + " 23:59:59");
|
||||
}
|
||||
|
||||
// 使用 group by 直接在数据库层面分组统计
|
||||
List<Map<String, Object>> result = repairTicketsMapper.selectMaps(
|
||||
queryWrapper.select("repair_type", "count(*) as count")
|
||||
.groupBy("repair_type")
|
||||
);
|
||||
|
||||
return convertGroupResult(result);
|
||||
}
|
||||
|
||||
// 转换分组查询结果
|
||||
private Map<String, Long> convertGroupResult(List<Map<String, Object>> result) {
|
||||
Map<String, Long> stats = new HashMap<>();
|
||||
if (result != null) {
|
||||
for (Map<String, Object> map : result) {
|
||||
String repairType = (String) map.get("repair_type");
|
||||
Long count = (Long) map.get("count");
|
||||
if (repairType != null && count != null) {
|
||||
stats.put(repairType, count);
|
||||
}
|
||||
}
|
||||
}
|
||||
return stats;
|
||||
}
|
||||
|
||||
// 创建统计节点的辅助方法
|
||||
private Map<String, Object> createStatsNode(String code, String name, Map<String, Long> stats) {
|
||||
Map<String, Object> node = new HashMap<>();
|
||||
node.put("code", code);
|
||||
node.put("name", name);
|
||||
|
||||
List<Map<String, Object>> children = stats.entrySet().stream()
|
||||
.map(entry -> {
|
||||
Map<String, Object> child = new HashMap<>();
|
||||
child.put("repairType", entry.getKey());
|
||||
child.put("count", entry.getValue());
|
||||
return child;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
node.put("children", children);
|
||||
|
||||
// 计算该统计项的总数
|
||||
long total = stats.values().stream().mapToLong(Long::longValue).sum();
|
||||
node.put("total", total);
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
// 计算金额统计
|
||||
private Map<String, Object> calculateAmountStats(String startDate, String endDate) {
|
||||
Map<String, Object> amountMap = new HashMap<>();
|
||||
|
||||
// 应收款:竣工已结算的单子的总金额
|
||||
QueryWrapper<DlRepairTickets> receivableWrapper = new QueryWrapper<>();
|
||||
// receivableWrapper.eq("tickets_status", "03");
|
||||
|
||||
if (startDate != null && endDate != null) {
|
||||
receivableWrapper.between("drt.create_time",
|
||||
startDate + " 00:00:00",
|
||||
endDate + " 23:59:59");
|
||||
}
|
||||
|
||||
List<Map<String, Object>> receivables = repairTicketsMapper.selectSumAmount(receivableWrapper);
|
||||
BigDecimal receivableAmount = BigDecimal.ZERO;
|
||||
Integer receivableCount = 0;
|
||||
BigDecimal receivedAmount = BigDecimal.ZERO;
|
||||
Integer receivedCount = 0;
|
||||
for (Map<String, Object> receivable : receivables) {
|
||||
// 转换为TicketsSettlementVO
|
||||
Object otherData = receivable.get("otherData");
|
||||
TicketsSettlementVO settlement = JSONObject.parseObject(
|
||||
otherData.toString(), TicketsSettlementVO.class
|
||||
);
|
||||
|
||||
//计算实付金额的总和
|
||||
BigDecimal actualMoney = settlement.getActualMoney();
|
||||
receivableAmount = receivableAmount.add(actualMoney);
|
||||
|
||||
receivableCount++;
|
||||
|
||||
//判断是否是已经确认收款的
|
||||
Object payType = receivable.get("payType");
|
||||
if (payType != null && "03".equals(payType.toString())) {
|
||||
// 计算已收款金额
|
||||
BigDecimal isConfirmedReceive = settlement.getActualMoney();
|
||||
receivedAmount = receivedAmount.add(isConfirmedReceive);
|
||||
|
||||
receivedCount++;
|
||||
}
|
||||
}
|
||||
amountMap.put("receivableAmount", receivableAmount != null ? receivableAmount : BigDecimal.ZERO);
|
||||
amountMap.put("receivableCount", receivableCount);
|
||||
|
||||
// 已收款:应收款里面出纳确认收款的金额
|
||||
amountMap.put("receivedAmount", receivedAmount != null ? receivedAmount : BigDecimal.ZERO);
|
||||
amountMap.put("receivedCount", receivedCount);
|
||||
|
||||
// 待收款:应收 - 已收
|
||||
BigDecimal receivable = (BigDecimal) amountMap.get("receivableAmount");
|
||||
BigDecimal received = (BigDecimal) amountMap.get("receivedAmount");
|
||||
BigDecimal pendingAmount = receivable.subtract(received);
|
||||
amountMap.put("pendingAmount", pendingAmount);
|
||||
amountMap.put("pendingCount", receivableCount - receivedCount);
|
||||
|
||||
return amountMap;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 客户信息和车辆信息 新增、修改
|
||||
* @param customerAndCarVO 用户信息和车辆信息
|
||||
@ -2014,14 +2233,13 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
|
||||
|
||||
/**
|
||||
* @Author 许
|
||||
* @Description 数据统计
|
||||
* @Description 数据统计
|
||||
* @Date 10:51 2025/9/1
|
||||
* @Param [startDate, endDate]
|
||||
* @return java.util.Map<java.lang.String,java.lang.Object>
|
||||
* @return java.util.Map<java.lang.String, java.lang.Object>
|
||||
**/
|
||||
@Override
|
||||
// ... existing code ...
|
||||
public Map<String, Object> getBossNum(String startDate, String endDate) {
|
||||
public Map<String, Object> getBossNum(String startDate, String endDate) {
|
||||
Map<String, Object> rtnMap = new HashMap<>();
|
||||
long workingNum = 0;
|
||||
long inCompanyNum = 0;
|
||||
@ -2109,8 +2327,6 @@ public Map<String, Object> getBossNum(String startDate, String endDate) {
|
||||
rtnMap.put("noPayIdList", noPayIdList);
|
||||
return rtnMap;
|
||||
}
|
||||
// ... existing code ...
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -135,6 +135,7 @@
|
||||
r.ticket_no AS bizNo,
|
||||
r.repair_type AS bizType,
|
||||
r.in_time AS bizTime,
|
||||
r.handle_name AS handleName,
|
||||
'repair' AS source,
|
||||
'维修' AS sourceStr,
|
||||
ROW_NUMBER() OVER (PARTITION BY c.id ORDER BY r.in_time DESC) AS rn
|
||||
|
@ -647,4 +647,23 @@
|
||||
</if>
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectSumAmount">
|
||||
select drr.other_data as otherData, drt.pay_status as payType
|
||||
FROM dl_repair_tickets drt
|
||||
JOIN dl_repair_records drr ON drt.id = drr.ticket_id
|
||||
<where>drt.deleted = 0 and drr.deleted = 0 and drr.type = 'jssp'
|
||||
<if test="ew != null and ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="selectTicketIdByParamsNew" resultType="java.util.Map">
|
||||
SELECT ${ew.sqlSelect}
|
||||
FROM dl_repair_tickets drt
|
||||
LEFT JOIN dl_repair_records drr ON drt.id = drr.ticket_id
|
||||
where 1=1
|
||||
<if test="ew != null and ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||
AND ${ew.sqlSegment}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user