Added check for empty string in title/label
This commit is contained in:
parent
a1bbd7ad0d
commit
b0b0777d34
@ -193,15 +193,15 @@ COALESCE(CASE WHEN a.originator_type = 0 THEN (select title from tenant where id
|
|||||||
WHEN a.originator_type = 18 THEN (select name from edge where id = a.originator_id) END
|
WHEN a.originator_type = 18 THEN (select name from edge where id = a.originator_id) END
|
||||||
, 'Deleted') originator_name,
|
, 'Deleted') originator_name,
|
||||||
COALESCE(CASE WHEN a.originator_type = 0 THEN (select title from tenant where id = a.originator_id)
|
COALESCE(CASE WHEN a.originator_type = 0 THEN (select title from tenant where id = a.originator_id)
|
||||||
WHEN a.originator_type = 1 THEN (select COALESCE(title, email) from customer where id = a.originator_id)
|
WHEN a.originator_type = 1 THEN (select COALESCE(NULLIF(title, ''), email) from customer where id = a.originator_id)
|
||||||
WHEN a.originator_type = 2 THEN (select email from tb_user where id = a.originator_id)
|
WHEN a.originator_type = 2 THEN (select email from tb_user where id = a.originator_id)
|
||||||
WHEN a.originator_type = 3 THEN (select title from dashboard where id = a.originator_id)
|
WHEN a.originator_type = 3 THEN (select title from dashboard where id = a.originator_id)
|
||||||
WHEN a.originator_type = 4 THEN (select COALESCE(label, name) from asset where id = a.originator_id)
|
WHEN a.originator_type = 4 THEN (select COALESCE(NULLIF(label, ''), name) from asset where id = a.originator_id)
|
||||||
WHEN a.originator_type = 5 THEN (select COALESCE(label, name) from device where id = a.originator_id)
|
WHEN a.originator_type = 5 THEN (select COALESCE(NULLIF(label, ''), name) from device where id = a.originator_id)
|
||||||
WHEN a.originator_type = 9 THEN (select name from entity_view where id = a.originator_id)
|
WHEN a.originator_type = 9 THEN (select name from entity_view where id = a.originator_id)
|
||||||
WHEN a.originator_type = 13 THEN (select name from device_profile where id = a.originator_id)
|
WHEN a.originator_type = 13 THEN (select name from device_profile where id = a.originator_id)
|
||||||
WHEN a.originator_type = 14 THEN (select name from asset_profile where id = a.originator_id)
|
WHEN a.originator_type = 14 THEN (select name from asset_profile where id = a.originator_id)
|
||||||
WHEN a.originator_type = 18 THEN (select COALESCE(label, name) from edge where id = a.originator_id) END
|
WHEN a.originator_type = 18 THEN (select COALESCE(NULLIF(label, ''), name) from edge where id = a.originator_id) END
|
||||||
, 'Deleted') as originator_label,
|
, 'Deleted') as originator_label,
|
||||||
u.first_name as assignee_first_name, u.last_name as assignee_last_name, u.email as assignee_email
|
u.first_name as assignee_first_name, u.last_name as assignee_last_name, u.email as assignee_email
|
||||||
FROM alarm a
|
FROM alarm a
|
||||||
|
|||||||
@ -874,15 +874,15 @@ COALESCE(CASE WHEN a.originator_type = 0 THEN (select title from tenant where id
|
|||||||
WHEN a.originator_type = 18 THEN (select name from edge where id = a.originator_id) END
|
WHEN a.originator_type = 18 THEN (select name from edge where id = a.originator_id) END
|
||||||
, 'Deleted') originator_name,
|
, 'Deleted') originator_name,
|
||||||
COALESCE(CASE WHEN a.originator_type = 0 THEN (select title from tenant where id = a.originator_id)
|
COALESCE(CASE WHEN a.originator_type = 0 THEN (select title from tenant where id = a.originator_id)
|
||||||
WHEN a.originator_type = 1 THEN (select COALESCE(title, email) from customer where id = a.originator_id)
|
WHEN a.originator_type = 1 THEN (select COALESCE(NULLIF(title, ''), email) from customer where id = a.originator_id)
|
||||||
WHEN a.originator_type = 2 THEN (select email from tb_user where id = a.originator_id)
|
WHEN a.originator_type = 2 THEN (select email from tb_user where id = a.originator_id)
|
||||||
WHEN a.originator_type = 3 THEN (select title from dashboard where id = a.originator_id)
|
WHEN a.originator_type = 3 THEN (select title from dashboard where id = a.originator_id)
|
||||||
WHEN a.originator_type = 4 THEN (select COALESCE(label, name) from asset where id = a.originator_id)
|
WHEN a.originator_type = 4 THEN (select COALESCE(NULLIF(label, ''), name) from asset where id = a.originator_id)
|
||||||
WHEN a.originator_type = 5 THEN (select COALESCE(label, name) from device where id = a.originator_id)
|
WHEN a.originator_type = 5 THEN (select COALESCE(NULLIF(label, ''), name) from device where id = a.originator_id)
|
||||||
WHEN a.originator_type = 9 THEN (select name from entity_view where id = a.originator_id)
|
WHEN a.originator_type = 9 THEN (select name from entity_view where id = a.originator_id)
|
||||||
WHEN a.originator_type = 13 THEN (select name from device_profile where id = a.originator_id)
|
WHEN a.originator_type = 13 THEN (select name from device_profile where id = a.originator_id)
|
||||||
WHEN a.originator_type = 14 THEN (select name from asset_profile where id = a.originator_id)
|
WHEN a.originator_type = 14 THEN (select name from asset_profile where id = a.originator_id)
|
||||||
WHEN a.originator_type = 18 THEN (select COALESCE(label, name) from edge where id = a.originator_id) END
|
WHEN a.originator_type = 18 THEN (select COALESCE(NULLIF(label, ''), name) from edge where id = a.originator_id) END
|
||||||
, 'Deleted') as originator_label,
|
, 'Deleted') as originator_label,
|
||||||
u.first_name as assignee_first_name, u.last_name as assignee_last_name, u.email as assignee_email
|
u.first_name as assignee_first_name, u.last_name as assignee_last_name, u.email as assignee_email
|
||||||
FROM alarm a
|
FROM alarm a
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user