select cau_code as causecode,
 cau_desc as causedesc
 from r5causes c 
 where coalesce(cau_notused, '-') = '-' 
 and coalesce(cau_partfailure, '-') = '-'  
 and (coalesce(c.cau_gen,'-') = '+'   
   or exists ( select 1 from r5causeclasses where cau_code = cac_cause and cac_class = <param.objclass> and cac_class_org= <param.objclassorg>))
   order by cau_code ASC

