From 847a7773ef1a8ad418c6934d35b5f205a97c04d0 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期六, 06 十二月 2025 17:03:24 +0800
Subject: [PATCH] fix:在任务状态更新时,需要更新日志到旧系统

---
 ruoyi-system/src/main/resources/mapper/system/VehicleMileageStatsMapper.xml |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/ruoyi-system/src/main/resources/mapper/system/VehicleMileageStatsMapper.xml b/ruoyi-system/src/main/resources/mapper/system/VehicleMileageStatsMapper.xml
index 4179acf..aee4324 100644
--- a/ruoyi-system/src/main/resources/mapper/system/VehicleMileageStatsMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/VehicleMileageStatsMapper.xml
@@ -83,7 +83,7 @@
                s.non_task_mileage, s.task_ratio, s.gps_point_count, s.task_count, s.segment_count, 
                s.data_source, s.create_time, s.update_time
         from tb_vehicle_mileage_stats s
-        where s.vehicle_id = #{vehicleId} and s.stat_date = #{statDate}
+        where s.vehicle_id = #{vehicleId} and DATE(s.stat_date) = DATE(#{statDate})
         limit 1
     </select>
 
@@ -130,6 +130,17 @@
             <if test="dataSource != null">#{dataSource},</if>
             NOW()
          </trim>
+        ON DUPLICATE KEY UPDATE
+            vehicle_no = VALUES(vehicle_no),
+            total_mileage = VALUES(total_mileage),
+            task_mileage = VALUES(task_mileage),
+            non_task_mileage = VALUES(non_task_mileage),
+            task_ratio = VALUES(task_ratio),
+            gps_point_count = VALUES(gps_point_count),
+            task_count = VALUES(task_count),
+            segment_count = VALUES(segment_count),
+            data_source = VALUES(data_source),
+            update_time = NOW()
     </insert>
 
     <update id="updateVehicleMileageStats" parameterType="VehicleMileageStats">

--
Gitblit v1.9.1