mybatis中mysql的时间判断

<if test="start_time != null">
			and a.created &gt; str_to_date(#{start_time}, '%Y-%m-%d %H:%i:%s')
		</if>
		<if test="end_time != null">
			and a.created  &lt;= str_to_date(#{end_time}, '%Y-%m-%d %H:%i:%s')
		</if>

猜你喜欢

转载自blog.csdn.net/qq_29072049/article/details/87859564