From 91b4d899403587e6982c6f76674307cd5612b17b Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期日, 26 十月 2025 18:53:07 +0800
Subject: [PATCH] feat: 任务状态
---
ruoyi-system/src/main/resources/mapper/system/VehicleGpsMapper.xml | 31 ++++++++++++++++++++++---------
1 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/ruoyi-system/src/main/resources/mapper/system/VehicleGpsMapper.xml b/ruoyi-system/src/main/resources/mapper/system/VehicleGpsMapper.xml
index a1c00c3..9e01aae 100644
--- a/ruoyi-system/src/main/resources/mapper/system/VehicleGpsMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/VehicleGpsMapper.xml
@@ -30,16 +30,20 @@
<select id="selectVehicleGpsList" parameterType="VehicleGps" resultMap="VehicleGpsResult">
<include refid="selectVehicleGpsVo"/>
<where>
- <if test="vehicleId != null "> and g.vehicle_id = #{vehicleId}</if>
- <if test="vehicleNo != null and vehicleNo != ''"> and v.vehicle_no like concat('%', #{vehicleNo}, '%')</if>
- <if test="longitude != null "> and g.longitude = #{longitude}</if>
- <if test="latitude != null "> and g.latitude = #{latitude}</if>
- <if test="altitude != null "> and g.altitude = #{altitude}</if>
- <if test="speed != null "> and g.speed = #{speed}</if>
- <if test="direction != null "> and g.direction = #{direction}</if>
- <if test="beginTime != null and beginTime != ''"> and g.collect_time >= #{beginTime}</if>
- <if test="endTime != null and endTime != ''"> and g.collect_time <= #{endTime}</if>
+ <if test="vehicleNo != null and vehicleNo != ''"> and vehicle_no = #{vehicleNo}</if>
+ <if test="longitude != null "> and longitude = #{longitude}</if>
+ <if test="latitude != null "> and latitude = #{latitude}</if>
+ <if test="speed != null "> and speed = #{speed}</if>
+ <if test="direction != null "> and direction = #{direction}</if>
+ <if test="collectTime != null "> and collect_time = #{collectTime}</if>
+ <if test="beginTime != null and beginTime != ''"><!-- 寮�濮嬫椂闂存绱� -->
+ AND date_format(collect_time,'%y%m%d') >= date_format(#{beginTime},'%y%m%d')
+ </if>
+ <if test="endTime != null and endTime != ''"><!-- 缁撴潫鏃堕棿妫�绱� -->
+ AND date_format(collect_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d')
+ </if>
</where>
+ order by collect_time desc
</select>
<select id="selectVehicleGpsById" parameterType="Long" resultMap="VehicleGpsResult">
@@ -106,4 +110,13 @@
<select id="getVehicleIdByNo" parameterType="String" resultType="Long">
select vehicle_id from tb_vehicle_info where vehicle_no = #{vehicleNo}
</select>
+
+ <delete id="deleteVehicleGpsBeforeDate">
+ delete g from tb_vehicle_gps g
+ where g.collect_time < (
+ select date_sub(max(collect_time), interval 2 day)
+ from tb_vehicle_gps g2
+ where g2.vehicle_id = g.vehicle_id
+ )
+ </delete>
</mapper>
\ No newline at end of file
--
Gitblit v1.9.1