From 40a8157440e3b906da8f52e07d939d78c3f4c313 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期日, 12 四月 2026 16:14:06 +0800
Subject: [PATCH] feat: 任务增加统计、同步增加通知

---
 ruoyi-system/src/main/resources/mapper/system/VehicleGpsSegmentMileageMapper.xml |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/ruoyi-system/src/main/resources/mapper/system/VehicleGpsSegmentMileageMapper.xml b/ruoyi-system/src/main/resources/mapper/system/VehicleGpsSegmentMileageMapper.xml
index 73671e3..8b6f6c8 100644
--- a/ruoyi-system/src/main/resources/mapper/system/VehicleGpsSegmentMileageMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/VehicleGpsSegmentMileageMapper.xml
@@ -79,7 +79,7 @@
                segment_distance, gps_point_count, gps_ids, task_id, task_code, calculate_method
         FROM tb_vehicle_gps_segment_mileage
         WHERE vehicle_id = #{vehicleId}
-          AND segment_start_time &lt;= #{endTime}
+          AND segment_start_time between #{startDate} and #{endDate}
           AND segment_end_time &gt;= #{startTime}
           AND segment_distance &gt; 0
         ORDER BY segment_start_time
@@ -99,6 +99,7 @@
         WHERE task_id = #{taskId}
     </select>
         
+    <!-- 鎻掑叆鎴栨洿鏂板垎娈甸噷绋嬭褰曪紙閬垮厤閲嶅鎻掑叆锛� -->
     <insert id="insertVehicleGpsSegmentMileage" parameterType="VehicleGpsSegmentMileage">
         INSERT INTO tb_vehicle_gps_segment_mileage
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -133,6 +134,20 @@
             <if test="taskCode != null">#{taskCode},</if>
             <if test="calculateMethod != null">#{calculateMethod},</if>
         </trim>
+        ON DUPLICATE KEY UPDATE
+        vehicle_no = VALUES(vehicle_no),
+        segment_end_time = VALUES(segment_end_time),
+        start_longitude = VALUES(start_longitude),
+        start_latitude = VALUES(start_latitude),
+        end_longitude = VALUES(end_longitude),
+        end_latitude = VALUES(end_latitude),
+        segment_distance = VALUES(segment_distance),
+        gps_point_count = VALUES(gps_point_count),
+        gps_ids = VALUES(gps_ids),
+        task_id = VALUES(task_id),
+        task_code = VALUES(task_code),
+        calculate_method = VALUES(calculate_method),
+        update_time = NOW()
     </insert>
 
     <update id="updateVehicleGpsSegmentMileage" parameterType="VehicleGpsSegmentMileage">

--
Gitblit v1.9.1