wlzboy
2025-12-04 4f2925f1974844b66225ac70ae35065b8262b315
ruoyi-system/src/main/resources/mapper/system/VehicleGpsMapper.xml
@@ -30,7 +30,7 @@
    <select id="selectVehicleGpsList" parameterType="VehicleGps" resultMap="VehicleGpsResult">
        <include refid="selectVehicleGpsVo"/>
        <where>  
            <if test="vehicleNo != null  and vehicleNo != ''"> and vehicle_no = #{vehicleNo}</if>
            <if test="vehicleNo != null  and vehicleNo != ''"> and v.vehicle_no like concat('%', #{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>
@@ -130,10 +130,11 @@
        order by collect_time
    </select>
    <!-- 查询活跃车辆ID(优化:添加LIMIT限制,避免大表扫描) -->
    <select id="selectActiveVehicleIds" resultType="Long">
        select distinct vehicle_id
        from tb_vehicle_gps
        where collect_time &gt;= DATE_SUB(NOW(), INTERVAL 7 DAY)
        where collect_time &gt;= #{startTime}
        order by vehicle_id
    </select>