
                select
                    EPS.EvnPS_NumCard as "EvnPS_NumCard",
                    EPS.EvnPS_id as "EvnPS_id",
                    to_char(EPS.EvnPS_setDate, 'DD.MM.YYYY') as "EvnPS_setDate",
                    EPS.LpuSection_id as "LpuSection_id",
                    LS.LpuSection_FullName as "LpuSection_FullName",
                    PA.Person_Fio as "Person_Fio",
                    ES.EvnSection_id as "EvnSection_id"
                from
                    v_EvnPS EPS
                    inner join v_EvnSection ES on ES.EvnSection_id = EPS.EvnSection_lastid
                        and ES.EvnSection_pid = EPS.EvnPS_id
                    inner join dbo.v_LpuSection LS on LS.LpuSection_id  = ES.LpuSection_id
                    inner join v_Person_all PA on PA.Server_id = EPS.Server_id
                        and PA.PersonEvn_id = EPS.PersonEvn_id
                where EPS.Lpu_id = '13101147'
                    and EPS.Person_id = '4015233'
                    and EPS.EvnPS_setDate <= localtimestamp
                    and EPS.EvnPS_disDate is null
                order by EPS.EvnPS_setDate desc
            
