title: my batis conditional execution of query WHERE clause based on null variable passed in
body: <p>In my batis, I have a query that will be used to query based on date, else it should just get sysdate between a range. There are 2 potentially executable where clauses, but I would only like to execute one of them. </p>
  
  <pre><code>SELECT distinct support_id AS object_id, 2 as app_context_id, 
              0 as domain_cdc_id, 'S' as object_type, 'NEW' as domain_cdc_status, 1 as attribute_group_num, 
              sysdate as created_on FROM fdrdbo.v_facility_support 
              WHERE support_version_valid_from_dt = to_date('${passedInVar}', 'yyyy/mm/dd') 
  </code></pre>
  
  <p>IF ${passedInVar} is null, then I want the following WHERE condition to be used!</p>
  
  <pre><code>WHERE SYSDATE BETWEEN support_version_valid_from_dt AND support_version_valid_to_dt
  </code></pre>
  
  <p>How can I build it like this?</p>