import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Properties;
@Configuration
public class BatisPlusConfig {
@Bean
public String myInterceptor(SqlSessionFactory sqlSessionFactory) {
ExamplePlugin sqlInterceptor = new ExamplePlugin();
Properties properties = new Properties();
properties.setProperty("prop1","value1");
sqlInterceptor.setProperties(properties);
sqlSessionFactory.getConfiguration().addInterceptor(sqlInterceptor);
return "interceptor";
}
}
----------------------------------------------------------------------------
package com.comleader.goip.utils;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.cache.CacheKey;
import org.apache.ibatis.executor.Executor;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org