blob: 41c85184c915c37281d4f3da687fe6d5be1c991a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
select distinct
identity_public_id
, data::text
, i.created_at
, i.updated_at
, i.deleted_at
from secd.identity i
left join secd.address_validation av using (identity_id)
left join secd.address a using (address_id)
where (($1::uuid is null) or (i.identity_public_id = $1))
and (($2::text is null) or (a.value = $2))
and (($3::bool is null) or (($3::bool is true) and (av.validated_at is not null)))
and i.deleted_at is null;
|