Bom Dia,
No EJB QL não pode usar condição (if).
???
Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: ( near line 1, column 108 [Select t FROM com.wave.erp.orm.financeiro.contareceber.ContaReceberDuplicata t WHERE t.cdEmpresa = ? and if(t.baixaDuplicata.dataBaixa=null, t.baixaDuplicata.dataBaixa between 11111111 and 11111111, t.dataVencimento between 11111111 and 11111111) order by t.id ASC]
Abraços.