mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-16 18:56:22 +00:00
removed array
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
WITH params AS (
|
||||
SELECT
|
||||
TO_DATE(NULLIF($2, ''), 'YYYY-MM') AS month,
|
||||
string_to_array(NULLIF($4, ''), ',') AS device_ids
|
||||
$4::text AS device_id
|
||||
),
|
||||
|
||||
device_logs AS (
|
||||
@ -30,7 +30,7 @@ device_logs AS (
|
||||
JOIN params P ON TRUE
|
||||
WHERE product.cat_name = 'hps'
|
||||
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)
|
||||
),
|
||||
|
||||
|
Reference in New Issue
Block a user