From d4c884c36bc1ff0b6b212f457675f2df1c9484db Mon Sep 17 00:00:00 2001 From: zch Date: Thu, 30 Apr 2026 10:16:44 +0800 Subject: [PATCH] =?UTF-8?q?refactor(BaseCarLifecycleMapper):=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E8=BD=AE=E8=83=8E=E6=B7=B1=E5=BA=A6=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改CarMaintenanceLifecycleDTO中的注释,移除冗余的字典值说明 - 优化BaseCarLifecycleMapper.xml中的轮胎深度查询,改为从保养记录中获取最新值 --- .../system/domain/CarMaintenanceLifecycleDTO.java | 4 ++-- .../mapper/tyre/BaseCarLifecycleMapper.xml | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/CarMaintenanceLifecycleDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/CarMaintenanceLifecycleDTO.java index d446035b..978dd2f6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/CarMaintenanceLifecycleDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/CarMaintenanceLifecycleDTO.java @@ -27,10 +27,10 @@ public class CarMaintenanceLifecycleDTO implements Serializable /** 车牌号,工单中直接记录的车牌号,用于与车辆主档确认关联。 */ private String plateNumber; - /** 维保类型编码,字典值,例如:一级保养、二级保养、小修、大修。 */ + /** 维保类型编码 */ private String typeCode; - /** 工单状态编码,字典值,例如:待派工、维修中、已完成、已结算。 */ + /** 工单状态编码 */ private String status; /** 录入里程,本次维保/保养时车辆的总行驶里程(数值型)。 */ diff --git a/ruoyi-system/src/main/resources/mapper/tyre/BaseCarLifecycleMapper.xml b/ruoyi-system/src/main/resources/mapper/tyre/BaseCarLifecycleMapper.xml index d8b34251..aec02c9d 100644 --- a/ruoyi-system/src/main/resources/mapper/tyre/BaseCarLifecycleMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/tyre/BaseCarLifecycleMapper.xml @@ -39,8 +39,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" bt.tyre_brand as tyreBrand, bt.tyre_model as tyreModel, bt.wheel_postion as wheelPostion, - bt.pattern_depth as patternDepth + maint.pattern_depth as patternDepth from base_tyre bt + left join ( + select tyre_rfid, pattern_depth + from ( + select tyre_rfid, pattern_depth, + row_number() over (partition by tyre_rfid order by create_time desc, id desc) as rn + from record_tyre_mileage + where record_type = '保养' + and pattern_depth is not null + and pattern_depth <> '' + ) ranked + where rn = 1 + ) maint on maint.tyre_rfid = bt.tyre_epc where bt.car_no = #{carNo} order by bt.wheel_postion, bt.tyre_id