From fe33646ee6e2d1e57f2b51812e94983a0e9efb04 Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期日, 14 十二月 2025 16:51:28 +0800
Subject: [PATCH] feat: 修复统计

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

diff --git a/ruoyi-system/src/main/resources/mapper/system/VehicleMileageStatsMapper.xml b/ruoyi-system/src/main/resources/mapper/system/VehicleMileageStatsMapper.xml
index aee4324..1a2218f 100644
--- a/ruoyi-system/src/main/resources/mapper/system/VehicleMileageStatsMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/VehicleMileageStatsMapper.xml
@@ -88,16 +88,15 @@
     </select>
 
     <select id="selectTaskTimeIntervals" resultMap="TaskTimeIntervalResult">
-        select tv.task_id, t.create_time as start_time, 
+        select tv.task_id, t.actual_start_time as start_time,
                IFNULL(t.actual_end_time, NOW()) as end_time
         from sys_task_vehicle tv
         inner join sys_task t on tv.task_id = t.task_id
         where tv.vehicle_id = #{vehicleId}
           and t.del_flag = '0'
-          and t.actual_end_time is not null
-          and t.create_time &lt; #{endTime}
-          and t.actual_end_time &gt; #{startTime}
-        order by t.create_time
+          and (t.actual_start_time &lt;= #{endTime} and (t.actual_end_time is null or t.actual_end_time &gt;= #{startTime}))
+
+        order by t.actual_start_time
     </select>
         
     <insert id="insertVehicleMileageStats" parameterType="VehicleMileageStats" useGeneratedKeys="true" keyProperty="statsId">

--
Gitblit v1.9.1