Give me an example of Mybatis plus queryupdate wrapper
时间: 2023-06-09 16:08:28 浏览: 135
Mybatis实例
5星 · 资源好评率100%
Sure, here is an example of Mybatis plus query update wrapper:
```
UpdateWrapper<User> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("name", "John")
.set("age", 30)
.set("email", "john@example.com");
userMapper.update(null, updateWrapper);
```
In this example, we create an instance of `UpdateWrapper` for the `User` entity. We then call the `eq()` method to set a condition that the user's name must be "John". We then call the `set()` method to update the user's age to 30 and email to "john@example.com". Finally, we call the `update()` method to execute the update operation.
阅读全文