mybatis时间类型的比较

<if test="beginTestTime != null and endTestTime != null and beginTestTime != '' and endTestTime != ''">
	AND a.test_time BETWEEN #{beginTestTime} AND #{endTestTime}
</if>
<if test="(beginTestTime == null or beginTestTime == '') and endTestTime != null and endTestTime != ''">
	<![CDATA[ 
	     and a.test_time <= #{endTestTime}
	]]>
</if>
<if test="beginTestTime != null and beginTestTime != '' and (endTestTime == null or endTestTime == '')">
	<![CDATA[ 
	    and a.test_time >= #{beginTestTime}
	]]>
</if>

  

原文地址:https://www.cnblogs.com/person008/p/8193020.html