wlzboy
2025-11-11 9529220c815bfe6e43c992fde2f392be823450eb
ruoyi-system/src/main/resources/mapper/system/VehicleGpsMapper.xml
@@ -119,4 +119,21 @@
            where g2.vehicle_id = g.vehicle_id
        )
    </delete>
    <select id="selectGpsDataByTimeRange" resultMap="VehicleGpsResult">
        select gps_id, vehicle_id, device_id, longitude, latitude, altitude, speed, direction,
               collect_time, device_report_time, platform_process_time, create_time
        from tb_vehicle_gps
        where vehicle_id = #{vehicleId}
          and collect_time &gt;= #{startTime}
          and collect_time &lt;= #{endTime}
        order by collect_time
    </select>
    <select id="selectActiveVehicleIds" resultType="Long">
        select distinct vehicle_id
        from tb_vehicle_gps
        where collect_time &gt;= DATE_SUB(NOW(), INTERVAL 7 DAY)
        order by vehicle_id
    </select>
</mapper>