SELECT
 (T_SAL.MatriculeSalarie || ' ' || NVL(T_SAL.Nom, ' ') || ' '  || NVL(T_SAL.Prenom, ' ') ) as Col1,
 'Arręt ('|| NVL(T_GHR.IntituleCourt, ' ') || ') jusqu''au ' || TO_CHAR(T_ArretDeTravail.DateDeFin) as Col2 
FROM
  T_PAI,
  T_SAL
  LEFT OUTER JOIN T_ArretDeTravail ON T_ArretDeTravail.NumeroSal=T_SAL.SA_CompteurNumero
  LEFT OUTER JOIN T_GHR ON T_ArretDeTravail.CodeNE =T_GHR.CodeNE
WHERE 
   (  
         (CURRENT_TIMESTAMP >= T_ArretDeTravail.DateDeFin)
		 and (CURRENT_TIMESTAMP <= NVL(%NbJoursApres%,0) + T_ArretDeTravail.DateDeFin)		
		 and (T_ArretDeTravail.CodeNE = NVL(%Nature1%,0) 
               OR T_ArretDeTravail.CodeNE = NVL(%Nature2%,0) 
               OR T_ArretDeTravail.CodeNE = NVL(%Nature3%,0)
               OR T_ArretDeTravail.CodeNE = NVL(%Nature4%,0) 
               OR T_ArretDeTravail.CodeNE = NVL(%Nature5%,0))
	    and (((T_ArretDeTravail.Statut <> 9) and (NVL(%StatutArret%,0) = 1)) OR  (NVL(%StatutArret%,0) = 0)) 
       )
Order by T_ArretDeTravail.DateDeFin

