mybatis中模糊查询的方式第一种(和打印的sql) @Select("select * from user where name like '%${value}%' ") List<User> queryLikeByName(String data); // select * from user where name like '%李%' mysql中的字符串连接函数 concat(str1,Str2..) 返回的结果连接产生的字符串(如果是数字也会按照字符串拼接处理)) 参数 为null,则返回null select concat("11","22","33")from user; select concat("11",22,33)from user; 记过都是112233 mysql的concat函数在连接字符串的时候,只要其中一个是null, mysql中的字符串连接函数 concat(str1,Str2..) @Select("select * from user where name like concat('%',#{date},'%')") List<User> queryLikeByName(String data); select * from user where name like concat('%',?,'%') 李(String)
mysql模糊查询的字符串拼接
最新推荐文章于 2024-06-26 09:36:19 发布