SELECT sym_code as symptom,sym_desc as description
 FROM r5symptoms s
 WHERE COALESCE(sym_notused, '-') = '-'
 AND COALESCE(sym_enableworkorders, '-') = '+'
 AND (COALESCE(s.sym_gen,'-') = '+')
 AND (COALESCE(s.sym_gen,'-') = '+'
 OR EXISTS
 (SELECT NULL FROM r5symptomclasses a
 WHERE a.syc_symptom = description
 AND a.syc_class = <param.objclass>
 AND a.syc_class_org= <param.objclassorg>))