As shown in the figure, when selecting the associated template, cancel it, and
when updating, it will prompt that the operation is successful, but refresh the page again and find that the data is still there:
The solution first: add the comment of mp above the field:
@TableField(updateStrategy = FieldStrategy.IGNORED)
The reason for the failure is: when using updateById to update, if the field is empty, no update will be performed. The function of this annotation is to ignore the update strategy of mp. If it is not empty, just leave it empty: mp provides the following strategies
Reference link: Mybatis-Plus global Update update strategy, and insert query strategy