♻️ Refactoring code. 审计字段填充字段为NULL 不填充

This commit is contained in:
lbw 2023-08-06 10:00:08 +08:00
parent 39ab0b17f5
commit a34a4e670c

View File

@ -51,6 +51,11 @@ public class MybatisPlusMetaObjectHandler implements MetaObjectHandler {
* @param isCover 是否覆盖原有值,避免更新操作手动入参
*/
private static void fillValIfNullByName(String fieldName, Object fieldVal, MetaObject metaObject, boolean isCover) {
// 0. 如果填充值为空
if (fieldVal == null) {
return;
}
// 1. 没有 set 方法
if (!metaObject.hasSetter(fieldName)) {
return;