From 364adbc9a93a396b74e154f910c2a0a72bfb1a0f Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期六, 29 十一月 2025 22:10:41 +0800
Subject: [PATCH] feat: 更新车辆里程统计
---
ruoyi-system/src/main/resources/mapper/system/VehicleGpsSegmentMileageMapper.xml | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/ruoyi-system/src/main/resources/mapper/system/VehicleGpsSegmentMileageMapper.xml b/ruoyi-system/src/main/resources/mapper/system/VehicleGpsSegmentMileageMapper.xml
index 43b5fb3..53443f9 100644
--- a/ruoyi-system/src/main/resources/mapper/system/VehicleGpsSegmentMileageMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/VehicleGpsSegmentMileageMapper.xml
@@ -154,4 +154,15 @@
<select id="selectGpsCalculatedSegmentId" resultType="Long">
SELECT segment_id FROM tb_vehicle_gps_calculated WHERE gps_id = #{gpsId} LIMIT 1
</select>
+
+ <!-- 鏌ヨ杞﹁締鍦ㄦ寚瀹氭椂闂翠箣鍓嶆渶鍚庝竴涓凡澶勭悊鐨凣PS鍧愭爣ID -->
+ <select id="selectLastCalculatedGpsId" resultType="Long">
+ SELECT c.gps_id
+ FROM tb_vehicle_gps_calculated c
+ INNER JOIN tb_vehicle_gps g ON c.gps_id = g.gps_id
+ WHERE c.vehicle_id = #{vehicleId}
+ AND STR_TO_DATE(g.collect_time, '%Y-%m-%d %H:%i:%s') < #{beforeTime}
+ ORDER BY STR_TO_DATE(g.collect_time, '%Y-%m-%d %H:%i:%s') DESC
+ LIMIT 1
+ </select>
</mapper>
--
Gitblit v1.9.1