我写了一个 mybatis 的 plugin, 可是只能拦截取到 query 和 update 方法的sql语句,而 insert 和 delete 的却没拦到,不知道怎么回事。我尝试过在注解里在加上 @Signature(method = "delete") 和 @Signature(method = "insert") ,可是这样却报错了,难不成只能拦截 query 和 update 的 ?  应该不会吧,可能是我没找到方法, 希望有这方面经验的人,指点迷津!
@Intercepts({ @Signature(type = Executor.class, method = "query", args = { MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class }),
@Signature(type = Executor.class, method = "update", args = { MappedStatement.class, Object.class })
})
public class LogInterceptor implements Interceptor {

private Properties properties;

public Object intercept(Invocation invocation) throws Throwable {
MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0];
Object parameter = invocation.getArgs()[1];
mappedStatement.getSqlSource().getBoundSql(parameter);
BoundSql boundSql = mappedStatement.getBoundSql(parameter); String sql = "";
if (boundSql != null && boundSql.getSql() != null && !"".equals(boundSql.getSql())) {
sql = boundSql.getSql();
}
System.out.println(sql);
return invocation.proceed();
} public Object plugin(Object target) {
return Plugin.wrap(target, this);
} public void setProperties(Properties properties) {
this.properties = properties;
}
}快来人呀!!!