refactor(BaseCarLifecycleMapper): 优化轮胎深度查询逻辑

- 修改CarMaintenanceLifecycleDTO中的注释,移除冗余的字典值说明
- 优化BaseCarLifecycleMapper.xml中的轮胎深度查询,改为从保养记录中获取最新值
master
zch 11 hours ago
parent 1940761386
commit d4c884c36b

@ -27,10 +27,10 @@ public class CarMaintenanceLifecycleDTO implements Serializable
/** 车牌号,工单中直接记录的车牌号,用于与车辆主档确认关联。 */
private String plateNumber;
/** 维保类型编码,字典值,例如:一级保养、二级保养、小修、大修。 */
/** 维保类型编码 */
private String typeCode;
/** 工单状态编码,字典值,例如:待派工、维修中、已完成、已结算。 */
/** 工单状态编码 */
private String status;
/** 录入里程,本次维保/保养时车辆的总行驶里程(数值型)。 */

@ -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
</select>

Loading…
Cancel
Save