From f67945d53b20f6a45ae50b27d74c966eb1355bb4 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期日, 16 十一月 2025 22:53:54 +0800
Subject: [PATCH] feat: 增加分段GPS计算行程距离

---
 ruoyi-system/src/main/java/com/ruoyi/system/mapper/VehicleGpsMapper.java |   40 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 40 insertions(+), 0 deletions(-)

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/VehicleGpsMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/VehicleGpsMapper.java
index fb1310c..4f7ba6b 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/VehicleGpsMapper.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/VehicleGpsMapper.java
@@ -1,6 +1,8 @@
 package com.ruoyi.system.mapper;
 
+import java.util.Date;
 import java.util.List;
+import org.apache.ibatis.annotations.Param;
 import com.ruoyi.system.domain.VehicleGps;
 
 /**
@@ -41,4 +43,42 @@
      * 鏍规嵁杞︾墝鍙疯幏鍙栬溅杈咺D
      */
     public Long getVehicleIdByNo(String vehicleNo);
+
+    /**
+     * 鍒犻櫎鎸囧畾鏃ユ湡涔嬪墠鐨勮溅杈咷PS鏁版嵁
+     * 
+     * @return 鍒犻櫎鐨勮褰曟暟
+     */
+    public int deleteVehicleGpsBeforeDate();
+
+    /**
+     * 鏌ヨ杞﹁締鍦ㄦ寚瀹氭椂闂磋寖鍥村唴鐨凣PS鏁版嵁锛堟寜閲囬泦鏃堕棿鎺掑簭锛�
+     * 
+     * @param vehicleId 杞﹁締ID
+     * @param startTime 寮�濮嬫椂闂�
+     * @param endTime 缁撴潫鏃堕棿
+     * @return GPS鍧愭爣鍒楄〃
+     */
+    public List<VehicleGps> selectGpsDataByTimeRange(@Param("vehicleId") Long vehicleId,
+                                                       @Param("startTime") Date startTime,
+                                                       @Param("endTime") Date endTime);
+
+    /**
+     * 鏌ヨ鎵�鏈夋椿璺冭溅杈咺D鍒楄〃
+     * 
+     * @return 杞﹁締ID鍒楄〃
+     */
+    public List<Long> selectActiveVehicleIds();
+    
+    /**
+     * 鏌ヨ鏈璁$畻鐨凣PS鍧愭爣锛堜笉鍦╰b_vehicle_gps_calculated琛ㄤ腑鐨勮褰曪級
+     * 
+     * @param vehicleId 杞﹁締ID
+     * @param startTime 寮�濮嬫椂闂�
+     * @param endTime 缁撴潫鏃堕棿
+     * @return 鏈璁$畻鐨凣PS鍧愭爣鍒楄〃
+     */
+    public List<VehicleGps> selectUncalculatedGps(@Param("vehicleId") Long vehicleId,
+                                                    @Param("startTime") Date startTime,
+                                                    @Param("endTime") Date endTime);
 } 
\ No newline at end of file

--
Gitblit v1.9.1