|
@@ -1,5 +1,6 @@
|
|
|
package edu.travel.datasource;
|
|
|
|
|
|
+import cn.hutool.core.util.ReflectUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.PluginUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor;
|
|
@@ -89,9 +90,10 @@ public void beforeUpdate(Executor executor, MappedStatement ms, Object parameter
|
|
|
update.setTable(delete.getTable());
|
|
|
update.setWhere(delete.getWhere());
|
|
|
update.addUpdateSet(new Column("delete_flag"), new LongValue(1));
|
|
|
- PluginUtils.MPBoundSql mpBoundSql = PluginUtils.mpBoundSql(boundSql);
|
|
|
- System.out.println(update.toString());
|
|
|
- mpBoundSql.sql(update.toString());
|
|
|
+ Field sqlField = ReflectUtil.getField(BoundSql.class, "sql");
|
|
|
+ ReflectUtil.setFieldValue(boundSql, sqlField, update.toString());
|
|
|
+ System.out.println("转换后的 SQL: " + update.toString()); // 打印验证
|
|
|
+
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
throw new SQLException("SQL转换失败", e);
|