Refactor SQL query in DirectorWorker: Removed unnecessary conditions from the query for fetching transport vehicles, simplifying the logic while maintaining functionality. This change enhances query readability and performance.

This commit is contained in:
Torsten Schulz (local)
2025-12-01 10:55:50 +01:00
parent 6f9e13b290
commit d98620ea06

View File

@@ -207,9 +207,7 @@ const QUERY_GET_TRANSPORT_VEHICLES_FOR_ROUTE: &str = r#"
) )
AND (rd.transport_mode = vt.transport_mode OR rd.transport_mode IS NULL) AND (rd.transport_mode = vt.transport_mode OR rd.transport_mode IS NULL)
WHERE v.falukant_user_id = $1 WHERE v.falukant_user_id = $1
AND v.region_id = $2 AND v.region_id = $2;
AND v.condition > 0
AND v.available_from <= NOW();
"#; "#;
// Transport-Eintrag anlegen // Transport-Eintrag anlegen