Mybatis-Plus修改指定字段&Mybatis-Plus修改部分字段&Mybatis-Plus更新部分字段

彭维盛

关注

阅读 79

2022-03-30

通过UpdateWrapper修改指定的列

update 时传入null 是关键

重点语句:updateWrapper.set(“SESSION_KEY”, “abc”);

         this.mapper.update(null, wrapperUpdate);

使用版本:3.0.4

使用场景:

UpdateWrapper updateWrapper = new UpdateWrapper();

updateWrapper.eq(“ID”, 0);

updateWrapper.set(“SESSION_KEY”, “abc”);

baseMapper.update(null, updateWrapper);
————————————————

https://blog.csdn.net/Mr_ZhangAdd/article/details/84257225

https://www.jianshu.com/p/5eaf651a0e08

精彩评论(0)

0 0 举报