From 6b29bd596f8b48485d3506bfba4a1e0ea6c7df99 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期二, 14 四月 2026 22:45:40 +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..aea0bf2 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 <= #{endTime}
+ AND segment_start_time between #{startTime} and #{endTime}
AND segment_end_time >= #{startTime}
AND segment_distance > 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