update 优化 增加mybatis-plus一键开启/关闭逻辑删除功能
This commit is contained in:
parent
a65baf5d67
commit
da1cd55c1d
@ -18,7 +18,10 @@ public class PlusPostInitTableInfoHandler implements PostInitTableInfoHandler {
|
||||
@Override
|
||||
public void postTableInfo(TableInfo tableInfo, Configuration configuration) {
|
||||
String flag = SpringUtils.getProperty("mybatis-plus.enableLogicDelete", "true");
|
||||
ReflectUtils.setFieldValue(tableInfo, "withLogicDelete", Convert.toBool(flag));
|
||||
// 只有关闭时 统一设置false 为true时mp自动判断不处理
|
||||
if (!Convert.toBool(flag)) {
|
||||
ReflectUtils.setFieldValue(tableInfo, "withLogicDelete", false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user