因为 MyBatis-Plus 自带的更新方法,会对对象空值进行判空。只有不为空的字段才会进行数据更新。
在实体类对应的字段上加注解**@TableField(strategy=FieldStrategy.IGNORED)**,忽略null值的判断,例如:
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String company;
因为 MyBatis-Plus 自带的更新方法,会对对象空值进行判空。只有不为空的字段才会进行数据更新。
在实体类对应的字段上加注解**@TableField(strategy=FieldStrategy.IGNORED)**,忽略null值的判断,例如:
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String company;