mybatis的时间比较 xml 及不解析<=的写法

时间:2024-01-04 20:56:26

<if test="type ==1">
and DATE_FORMAT(create_date,'%Y-%m-%d') = DATE_FORMAT(now(),'%Y-%m-%d')
</if>
<if test="type ==2">

<![CDATA[
and DATE_FORMAT(create_date,'%Y-%m-%d') >= DATE_FORMAT(#{minDate},'%Y-%m-%d')
and DATE_FORMAT(create_date,'%Y-%m-%d') <= DATE_FORMAT(#{maxDate},'%Y-%m-%d')
]]>
</if>
<if test="type ==3">
and DATE_FORMAT(create_date,'%Y-%m') = DATE_FORMAT(CURDATE(),'%Y-%m')
</if>

orcal的时间比较

select * from RegulatoryRecord where  regulatorydate < to_date('2018-08-15 15:58:00','yyyy-mm-dd hh24:mi:ss')