mybatis的时间比较 xml 及不解析<=的写法
程序员文章站
2022-03-09 11:16:24
<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')