diff --git a/casic-metering-common/src/main/java/com/casic/missiles/config/FileDeleteInterceptor.java b/casic-metering-common/src/main/java/com/casic/missiles/config/FileDeleteInterceptor.java deleted file mode 100644 index 87e173a..0000000 --- a/casic-metering-common/src/main/java/com/casic/missiles/config/FileDeleteInterceptor.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.casic.missiles.config; - -import com.baomidou.mybatisplus.core.toolkit.PluginUtils; -import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor; -import lombok.extern.slf4j.Slf4j; -import org.apache.ibatis.executor.Executor; -import org.apache.ibatis.executor.statement.StatementHandler; -import org.apache.ibatis.mapping.MappedStatement; -import org.apache.ibatis.mapping.SqlCommandType; -import org.springframework.context.annotation.Configuration; - -import java.sql.Connection; -import java.sql.SQLException; - -@Slf4j -@Configuration -public class FileDeleteInterceptor implements InnerInterceptor { - - public void beforeUpdate(Executor executor, MappedStatement ms, Object parameter) throws SQLException { - log.info("---------------------beforeUpdate--------------------------------"); - } - - @Override - public void beforePrepare(StatementHandler sh, Connection connection, Integer transactionTimeout) { - PluginUtils.MPStatementHandler mpSh = PluginUtils.mpStatementHandler(sh); - MappedStatement ms = mpSh.mappedStatement(); - SqlCommandType sct = ms.getSqlCommandType(); - log.info("---------------------beforePrepare--------------------------------"); - //增删改调用 JSqlParser工具修改sql后执行 - if (sct == SqlCommandType.INSERT || sct == SqlCommandType.UPDATE || sct == SqlCommandType.DELETE) { - PluginUtils.MPBoundSql mpBs = mpSh.mPBoundSql(); -// mpBs.sql(parserMulti(mpBs.sql(), null)); - } - } - - - @Override - public boolean willDoUpdate(Executor executor, MappedStatement ms, Object parameter) throws SQLException { - log.info("--------------------willDoUpdate---------------------------------"); - return true; - } -}