ibatis dynamic SQL using for 如何通过 IBATIS dynamic Sql 在两个日期之间实现

ibatis dynamic SQL using for How to implement between two date by IBATIS dynamic Sql

我想在 Ibatis 中做一个像这样的复杂动态 select 语句

select * from emp 
//when dateParam between 2012-03-1 and 2013-03-01 then
union
select * from emp1
//when dateParam between 2014-03-1 and 2015-03-01 then
union
select * from emp2

我是这样做的:

select * from emp  
<isLessEqual  property="dateParam" compareValue="2015-03-01">
  union
  select * from emp1
</isLessEqual>
<isLessEqual  property="dateParam" compareValue="2013-03-01">
  union
  select * from emp1
</isLessEqual>