removed array

This commit is contained in:
Dona Maria Absi
2025-05-07 14:48:31 +03:00
parent 078de317e4
commit 59ffa233ee

View File

@ -2,7 +2,7 @@
WITH params AS ( WITH params AS (
SELECT SELECT
TO_DATE(NULLIF($2, ''), 'YYYY-MM') AS month, TO_DATE(NULLIF($2, ''), 'YYYY-MM') AS month,
string_to_array(NULLIF($4, ''), ',') AS device_ids $4::text AS device_id
), ),
device_logs AS ( device_logs AS (
@ -30,7 +30,7 @@ device_logs AS (
JOIN params P ON TRUE JOIN params P ON TRUE
WHERE product.cat_name = 'hps' WHERE product.cat_name = 'hps'
AND "device-status-log".code = 'presence_state' AND "device-status-log".code = 'presence_state'
AND device.uuid::text = ANY(P.device_ids) AND device.uuid::text = P.device_id
AND (P.month IS NULL OR date_trunc('month', "device-status-log".event_time) = P.month) AND (P.month IS NULL OR date_trunc('month', "device-status-log".event_time) = P.month)
), ),