baomidou / mybatis-plus

An powerful enhanced toolkit of MyBatis for simplify development
https://baomidou.com
Apache License 2.0
16.47k stars 4.31k forks source link

[错误报告]: 描述@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)在执行removeById方法是自动填充数据失效 #6617

Open H-Knight opened 1 day ago

H-Knight commented 1 day ago

确认

当前程序版本

3.5.7

问题描述

我的update_time字段是定义在父类中,类型是Date,通过removeById进行逻辑删除操作时我的update_time会被设置成null,MyMetaObjectHandler和@TableField都试过,都自动填充值失败了

详细堆栈日志

2024-11-29 16:01:02.029 DEBUG 91029 --- [io-8174-exec-10] c.d.b.user.mapper.UserMapper.deleteById  : ==>  Preparing: UPDATE tbl_user SET update_time=?, deleted=1 WHERE pkid=? AND deleted=0
2024-11-29 16:01:02.035 DEBUG 91029 --- [io-8174-exec-10] c.d.b.user.mapper.UserMapper.deleteById  : ==> Parameters: null, e9b9f99f4f4a6e0171593ab376a20b81(String)
2024-11-29 16:01:02.042 DEBUG 91029 --- [io-8174-exec-10] c.d.b.user.mapper.UserMapper.deleteById  : <==    Updates: 1
miemieYaho commented 1 day ago

git形式给出复现demo