INSERT INTO integration.dict_360_to_lkk_notification_types (
type_code,
type_name
)
SELECT
12,
'Упрощённый налоговый вычет'
WHERE NOT EXISTS (
SELECT 1
FROM integration.dict_360_to_lkk_notification_types
WHERE type_code = 12
)
RETURNING id, type_code, type_name;
SELECT
id,
type_code,
title,
body,
delay,
link,
duration_days
FROM integration.dict_360_to_lkk_notification_patterns
WHERE id NOT IN (13, 14)
ORDER BY id
LIMIT 5;