mybatis查询指定时间段查询

select * from tableName

where 

load_date>=concat(#{startDate},' 00:00:00')

and

load_date<=concat(#{endDate},' 23:59:59')

ps:数据库时间字段用的datetime类型,具有时分秒。此处传入的时间参数应为"yyyy-MM-dd"的字符串。

发布了25 篇原创文章 · 获赞 4 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/qq_41570691/article/details/80883965