<if test="timeStatus != null and timeStatus.trim() != ''">
<if test="timeStatus == 1">
<![CDATA[ AND DATE_FORMAT(now(), '%Y-%m-%d %H:%i:%S') < DATE_FORMAT(start_date, '%Y-%m-%d %H:%i:%S') ]]>
</if>
<if test="timeStatus == 2">
<![CDATA[ AND DATE_FORMAT(now(), '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(start_date, '%Y-%m-%d %H:%i:%S') ]]>
<![CDATA[ AND DATE_FORMAT(now(), '%Y-%m-%d %H:%i:%S') <= DATE_FORMAT(end_date, '%Y-%m-%d %H:%i:%S') ]]>
</if>
<if test="timeStatus == 3">
<![CDATA[ AND DATE_FORMAT(now(), '%Y-%m-%d %H:%i:%S') > DATE_FORMAT(end_date, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</if>
标签:检索,-%,DATE,FORMAT,date,plus,mybatis
From: https://www.cnblogs.com/pansidong/p/17823470.html