Optional parameter in where condition
Use CASE?

http://docs.oracle.com/cd/B19306_01/server.102/b14200/expressions004.htm

something like:

lr."dateEnd" &gt;= to_date(?, 'dd.mm.yyyy') and lr."dateEnd" &lt;= (case when parameter2 is null then
sysdate
  else
to_date(parameter2, 'dd.mm.yyyy')