|
|
|
@ -39,8 +39,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
bt.tyre_brand as tyreBrand,
|
|
|
|
bt.tyre_brand as tyreBrand,
|
|
|
|
bt.tyre_model as tyreModel,
|
|
|
|
bt.tyre_model as tyreModel,
|
|
|
|
bt.wheel_postion as wheelPostion,
|
|
|
|
bt.wheel_postion as wheelPostion,
|
|
|
|
bt.pattern_depth as patternDepth
|
|
|
|
maint.pattern_depth as patternDepth
|
|
|
|
from base_tyre bt
|
|
|
|
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}
|
|
|
|
where bt.car_no = #{carNo}
|
|
|
|
order by bt.wheel_postion, bt.tyre_id
|
|
|
|
order by bt.wheel_postion, bt.tyre_id
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|