From c411d1879966f6f721b036449fde5db1aa684152 Mon Sep 17 00:00:00 2001 From: Manuel Carrer Date: Mon, 10 Jun 2024 09:17:39 +0200 Subject: [PATCH] Fix sql query --- ingestion/src/kldata.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ingestion/src/kldata.rs b/ingestion/src/kldata.rs index 51b34cd9..50e25e66 100644 --- a/ingestion/src/kldata.rs +++ b/ingestion/src/kldata.rs @@ -188,8 +188,8 @@ pub async fn filter_and_label_kldata( WHERE nationalnummer = $1 \ AND type_id = $2 \ AND param_code = $3 \ - AND (lvl IS NULL OR lvl = $4) \ - AND (sensor IS NULL OR sensor = $5)", + AND (($4 IS NULL AND lvl IS NULL) OR (lvl = $4)) \ + AND (($5 IS NULL AND sensor IS NULL) OR (sensor = $5))", ) .await?;