select ps.person_id,
coalesce(ps.Person_SurName, '') || ' ' || coalesce(ps.Person_FirName, '') || ' ' || coalesce(ps.Person_SecName, '') as person_fio,
to_char(ps.Person_Birthday, 'DD.MM.YYYY') as person_birthday
from v_PersonState ps
where 1=1
and (ps.person_id=cast($1 as bigint) or cast($2 as bigint) is null)
