select
r.form_date,
to_char(
to_date(r.m_y_report, 'MM.YYYY')
+ interval '1 month - 1 day',
'DD.MM.YYYY'
) as endDate,
(
select concat_ws(
' ', a.last_name, a.first_name, a.middle_name
)
from ourpension.agent a
where a.id = cast(
nullif(btrim($P{executorAgentIdPU}), '')
as integer
)
) as executor_fio_pu,
(
select concat_ws(
' ', a.last_name, a.first_name, a.middle_name
)
from ourpension.agent a
where a.id = cast(
nullif(btrim($P{executorAgentIdBU}), '')
as integer
)
) as executor_fio_bu
from back_office.report_conformity_pu_bu r
where r.id = $P{id}