liurunyu
2024-12-13 2e6df1a925b9e1c034753095b2a871e91783eca0
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mybatis/PrintSqlInterceptor.java
@@ -51,16 +51,10 @@
            MappedStatement mappedStatement = (MappedStatement) args[0];
            Object parameter = args[1];
            //BoundSql boundSql = mappedStatement.getBoundSql(parameter);
            //String sql = boundSql.getSql();
            //log.info("\n\nSQL:\n" + sql + "\n");
            String sqlId = mappedStatement.getId();
            BoundSql boundSql = mappedStatement.getBoundSql(parameter);
            Configuration configuration = mappedStatement.getConfiguration();
            log.info("SQL Parameters: {}", boundSql.getParameterObject());
            log.info("SQL Id: {}", sqlId);
            log.info("SQL: {}", PrintSqlHelp.getFullSql(configuration, boundSql));
            log.info("\nSQL Id: " + sqlId + "\nSQL Parameters: " + boundSql.getParameterObject() + "\nSQL: " + PrintSqlHelp.getFullSql(configuration, boundSql) + "\n");
        }
        return invocation.proceed();