MybatisPlus like模糊查找
时间: 2024-01-02 16:04:42 浏览: 110
mybatis模糊查询
5星 · 资源好评率100%
Sure, MybatisPlus provides a convenient way to do like fuzzy search. You can use the "like" method provided by MybatisPlus to perform a fuzzy search on a specific field. For example, if you want to search for records that contain the keyword "hello" in the "name" field, you can use the following code:
QueryWrapper<User> wrapper = new QueryWrapper<>();
wrapper.like("name", "hello");
This will generate a SQL statement similar to "SELECT * FROM user WHERE name LIKE '%hello%'", which will return all records that contain the keyword "hello" in the "name" field.
阅读全文