|
@@ -30,7 +30,7 @@ public class DruidSqlLogFilter extends FilterEventAdapter {
|
|
|
|
|
|
private static final SQLUtils.FormatOption FORMAT_OPTION = new SQLUtils.FormatOption(false, false);
|
|
|
|
|
|
- private final HnqzMybatisProperties properties;
|
|
|
+ private boolean showSql = true;
|
|
|
|
|
|
@Override
|
|
|
protected void statementExecuteBefore(StatementProxy statement, String sql) {
|
|
@@ -77,7 +77,7 @@ public class DruidSqlLogFilter extends FilterEventAdapter {
|
|
|
// 先调用父类关闭 statement
|
|
|
super.statement_close(chain, statement);
|
|
|
// 支持动态开启
|
|
|
- if (!properties.isShowSql()) {
|
|
|
+ if (!showSql) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -95,17 +95,17 @@ public class DruidSqlLogFilter extends FilterEventAdapter {
|
|
|
|
|
|
String dbType = statement.getConnectionProxy().getDirectDataSource().getDbType();
|
|
|
|
|
|
- // 判断表名是配置了匹配过滤
|
|
|
- if (CollUtil.isNotEmpty(properties.getSkipTable())) {
|
|
|
- List<String> skipTableList = properties.getSkipTable();
|
|
|
-
|
|
|
- List<String> tableNameList = getTablesBydruid(sql, dbType);
|
|
|
- if (tableNameList.stream()
|
|
|
- .anyMatch(tableName -> StrUtil.containsAnyIgnoreCase(tableName,
|
|
|
- ArrayUtil.toArray(skipTableList, String.class)))) {
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
+ // // 判断表名是配置了匹配过滤
|
|
|
+ // if (CollUtil.isNotEmpty(properties.getSkipTable())) {
|
|
|
+ // List<String> skipTableList = properties.getSkipTable();
|
|
|
+ //
|
|
|
+ // List<String> tableNameList = getTablesBydruid(sql, dbType);
|
|
|
+ // if (tableNameList.stream()
|
|
|
+ // .anyMatch(tableName -> StrUtil.containsAnyIgnoreCase(tableName,
|
|
|
+ // ArrayUtil.toArray(skipTableList, String.class)))) {
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
int parametersSize = statement.getParametersSize();
|
|
|
List<Object> parameters = new ArrayList<>(parametersSize);
|