mybatis模糊查询

  今天遇到一个模糊查询的问题,需求是:根据传入的时间查询当天的所有数据,解决办法是使用$或者contact,具体sql模拟如下:

select * from table_name where create_time like concat(#{createTime},'%');
select * from table_name where create_time like concat('%',#{createTime},'%');
select * from table_name where create_time like "%${createTime}%";
select * from table_name where create_time like "${createTime}%";

  

原文地址:https://www.cnblogs.com/daishoucheng/p/10186224.html