Fix calls tags

This commit is contained in:
Daniel Ponte 2024-12-27 14:16:38 -05:00
parent dac1f5fa4e
commit 5c4bfa4650
2 changed files with 8 additions and 8 deletions

View file

@ -201,9 +201,9 @@ CASE WHEN $1::TIMESTAMPTZ IS NOT NULL THEN
CASE WHEN $2::TIMESTAMPTZ IS NOT NULL THEN CASE WHEN $2::TIMESTAMPTZ IS NOT NULL THEN
c.call_date <= $2 ELSE TRUE END AND c.call_date <= $2 ELSE TRUE END AND
CASE WHEN $3::TEXT[] IS NOT NULL THEN CASE WHEN $3::TEXT[] IS NOT NULL THEN
tgs.tags @> ARRAY[$3] ELSE TRUE END AND tgs.tags && ARRAY[$3] ELSE TRUE END AND
CASE WHEN $4::TEXT[] IS NOT NULL THEN CASE WHEN $4::TEXT[] IS NOT NULL THEN
(NOT (tgs.tags @> ARRAY[$4])) ELSE TRUE END AND (NOT (tgs.tags && ARRAY[$4])) ELSE TRUE END AND
(CASE WHEN $5::TEXT IS NOT NULL THEN ( (CASE WHEN $5::TEXT IS NOT NULL THEN (
tgs.tg_group ILIKE '%' || $5 || '%' OR tgs.tg_group ILIKE '%' || $5 || '%' OR
tgs.name ILIKE '%' || $5 || '%' OR tgs.name ILIKE '%' || $5 || '%' OR
@ -255,9 +255,9 @@ CASE WHEN $1::TIMESTAMPTZ IS NOT NULL THEN
CASE WHEN $2::TIMESTAMPTZ IS NOT NULL THEN CASE WHEN $2::TIMESTAMPTZ IS NOT NULL THEN
c.call_date <= $2 ELSE TRUE END AND c.call_date <= $2 ELSE TRUE END AND
CASE WHEN $3::TEXT[] IS NOT NULL THEN CASE WHEN $3::TEXT[] IS NOT NULL THEN
tgs.tags @> ARRAY[$3] ELSE TRUE END AND tgs.tags && ARRAY[$3] ELSE TRUE END AND
CASE WHEN $4::TEXT[] IS NOT NULL THEN CASE WHEN $4::TEXT[] IS NOT NULL THEN
(NOT (tgs.tags @> ARRAY[$4])) ELSE TRUE END AND (NOT (tgs.tags && ARRAY[$4])) ELSE TRUE END AND
(CASE WHEN $5::TEXT IS NOT NULL THEN ( (CASE WHEN $5::TEXT IS NOT NULL THEN (
tgs.tg_group ILIKE '%' || $5 || '%' OR tgs.tg_group ILIKE '%' || $5 || '%' OR
tgs.name ILIKE '%' || $5 || '%' OR tgs.name ILIKE '%' || $5 || '%' OR

View file

@ -99,9 +99,9 @@ CASE WHEN sqlc.narg('start')::TIMESTAMPTZ IS NOT NULL THEN
CASE WHEN sqlc.narg('end')::TIMESTAMPTZ IS NOT NULL THEN CASE WHEN sqlc.narg('end')::TIMESTAMPTZ IS NOT NULL THEN
c.call_date <= sqlc.narg('end') ELSE TRUE END AND c.call_date <= sqlc.narg('end') ELSE TRUE END AND
CASE WHEN sqlc.narg('tags_any')::TEXT[] IS NOT NULL THEN CASE WHEN sqlc.narg('tags_any')::TEXT[] IS NOT NULL THEN
tgs.tags @> ARRAY[@tags_any] ELSE TRUE END AND tgs.tags && ARRAY[@tags_any] ELSE TRUE END AND
CASE WHEN sqlc.narg('tags_not')::TEXT[] IS NOT NULL THEN CASE WHEN sqlc.narg('tags_not')::TEXT[] IS NOT NULL THEN
(NOT (tgs.tags @> ARRAY[@tags_not])) ELSE TRUE END AND (NOT (tgs.tags && ARRAY[@tags_not])) ELSE TRUE END AND
(CASE WHEN sqlc.narg('tg_filter')::TEXT IS NOT NULL THEN ( (CASE WHEN sqlc.narg('tg_filter')::TEXT IS NOT NULL THEN (
tgs.tg_group ILIKE '%' || @tg_filter || '%' OR tgs.tg_group ILIKE '%' || @tg_filter || '%' OR
tgs.name ILIKE '%' || @tg_filter || '%' OR tgs.name ILIKE '%' || @tg_filter || '%' OR
@ -128,9 +128,9 @@ CASE WHEN sqlc.narg('start')::TIMESTAMPTZ IS NOT NULL THEN
CASE WHEN sqlc.narg('end')::TIMESTAMPTZ IS NOT NULL THEN CASE WHEN sqlc.narg('end')::TIMESTAMPTZ IS NOT NULL THEN
c.call_date <= sqlc.narg('end') ELSE TRUE END AND c.call_date <= sqlc.narg('end') ELSE TRUE END AND
CASE WHEN sqlc.narg('tags_any')::TEXT[] IS NOT NULL THEN CASE WHEN sqlc.narg('tags_any')::TEXT[] IS NOT NULL THEN
tgs.tags @> ARRAY[@tags_any] ELSE TRUE END AND tgs.tags && ARRAY[@tags_any] ELSE TRUE END AND
CASE WHEN sqlc.narg('tags_not')::TEXT[] IS NOT NULL THEN CASE WHEN sqlc.narg('tags_not')::TEXT[] IS NOT NULL THEN
(NOT (tgs.tags @> ARRAY[@tags_not])) ELSE TRUE END AND (NOT (tgs.tags && ARRAY[@tags_not])) ELSE TRUE END AND
(CASE WHEN sqlc.narg('tg_filter')::TEXT IS NOT NULL THEN ( (CASE WHEN sqlc.narg('tg_filter')::TEXT IS NOT NULL THEN (
tgs.tg_group ILIKE '%' || @tg_filter || '%' OR tgs.tg_group ILIKE '%' || @tg_filter || '%' OR
tgs.name ILIKE '%' || @tg_filter || '%' OR tgs.name ILIKE '%' || @tg_filter || '%' OR