stillbox/sql/postgres/queries/talkgroups.sql

16 lines
378 B
MySQL
Raw Normal View History

2024-07-17 19:30:16 -04:00
-- name: GetTalkgroupsWithAnyTags :many
2024-07-28 23:07:04 -04:00
SELECT * FROM talkgroups
2024-07-17 19:30:16 -04:00
WHERE tags @> ARRAY[$1];
-- name: GetTalkgroupsWithAllTags :many
2024-07-28 23:07:04 -04:00
SELECT * FROM talkgroups
2024-07-17 19:30:16 -04:00
WHERE tags && ARRAY[$1];
-- name: GetTalkgroupTags :one
2024-07-28 23:07:04 -04:00
SELECT tags FROM talkgroups
WHERE system_id = $1 AND tgid = $2;
2024-07-17 19:30:16 -04:00
-- name: SetTalkgroupTags :exec
2024-07-28 23:07:04 -04:00
UPDATE talkgroups SET tags = $1
WHERE system_id = $1 AND tgid = $2;