|
@@ -43,13 +43,13 @@ public class SqlStatementInterceptor implements Interceptor {
|
|
MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0];
|
|
MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0];
|
|
// 获取到节点的id,即sql语句的id
|
|
// 获取到节点的id,即sql语句的id
|
|
String sqlId = mappedStatement.getId();
|
|
String sqlId = mappedStatement.getId();
|
|
- log.info("-------------->mybatis方法:" + sqlId);
|
|
|
|
|
|
+// log.info("-------------->mybatis方法:" + sqlId);
|
|
|
|
|
|
Object parameter = null;
|
|
Object parameter = null;
|
|
// 获取参数,if语句成立,表示sql语句有参数,参数格式是map形式
|
|
// 获取参数,if语句成立,表示sql语句有参数,参数格式是map形式
|
|
if (invocation.getArgs().length > 1) {
|
|
if (invocation.getArgs().length > 1) {
|
|
parameter = invocation.getArgs()[1];
|
|
parameter = invocation.getArgs()[1];
|
|
- log.info("-------------->mybatis入参:" + parameter);
|
|
|
|
|
|
+// log.info("-------------->mybatis入参:" + parameter);
|
|
}
|
|
}
|
|
|
|
|
|
// BoundSql就是封装myBatis最终产生的sql类
|
|
// BoundSql就是封装myBatis最终产生的sql类
|
|
@@ -58,7 +58,7 @@ public class SqlStatementInterceptor implements Interceptor {
|
|
Configuration configuration = mappedStatement.getConfiguration();
|
|
Configuration configuration = mappedStatement.getConfiguration();
|
|
// 获取到最终的sql语句
|
|
// 获取到最终的sql语句
|
|
String sql = getSql(configuration, boundSql);
|
|
String sql = getSql(configuration, boundSql);
|
|
- log.info("-------------->mybatis sql:" + sql);
|
|
|
|
|
|
+// log.info("-------------->mybatis sql:" + sql);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("sql log error", e);
|
|
log.error("sql log error", e);
|
|
}
|
|
}
|