SELECT acWorker, acRegNo, acSurname, acName, acUCN, acTaxId, acJob, acDept, anQId anQIdGDPRLogP, acPicture, acActive 
FROM vHR_PrsnAutho
WHERE  ((exists (select ltpwg.acWorker from tHR_PrsnWorkerGroup ltpwg  
                 where ltpwg.acWorkerGroup = 'LEADER' 
                 and ltpwg.acWorker = vHR_PrsnAutho.acWorker  
                 and ltpwg.anId = vHR_PrsnAutho.anjobid  
                 and ltpwg.acWorkerDest = @worker))
        or (vHR_PrsnAutho.acWorker = @worker)) 
        and (adDateExit is null or adDateExit >= @date)