实现一个自定义的mybatis拦截器
@Intercepts({@Signature(type = StatementHandler.class, method = "query", args = {Statement.class, ResultHandler.class}), @Signature(type = StatementHandler.class, method = "update", args = {Statement.class}), @Signature(type = StatementHandler.class, method = "batch", args = { Statement.class })}) @Component @Configuration public class SqlExecuteTimeCountInterceptor implements Interceptor { private static Logger logger = LoggerFactory.getLogger(SqlExecuteTimeCountInterceptor.class); /**正则匹配 insert、delete、update操作*/ private static final String REGEX = ".*insert.*into.*sys_err_log.*||.*insert.*into.*sys_oper_log.*"; /** * 打印的参数字符串的最大长度 */ private final static int MAX_PARAM_LENGTH = 50; /** * 记录的最大SQL长度 */ private final static int MAX_SQL_