mybatis-plus 通过 updateById 更新部分字段数据时出现所有数据被更新(被设为默认值)

但当执行时发现 type 属性也被更新了,且为 int 默认值 0。
一顿百度,什么也没查到之后发现
需要设置 实体类 user 的 type 为 Integer,因为 int 不能为 null,而 Integer 可以。

 

https://blog.csdn.net/weixin_46376562/article/details/126126216

posted @ 2024-03-11 09:09  裸奔到月球  阅读(61)  评论(0编辑  收藏  举报