diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/inteceptor/MybatisSqlInterceptor.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/inteceptor/MybatisSqlInterceptor.java index d388f8f..c70d0a4 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/inteceptor/MybatisSqlInterceptor.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/inteceptor/MybatisSqlInterceptor.java @@ -55,16 +55,20 @@ public class MybatisSqlInterceptor implements Interceptor { parameter = invocation.getArgs()[1]; } - sqlId = mappedStatement.getId(); - BoundSql boundSql = mappedStatement.getBoundSql(parameter); - Configuration configuration = mappedStatement.getConfiguration(); - sqlCommandType = mappedStatement.getSqlCommandType().name(); - + try + { + sqlId = mappedStatement.getId(); + System.out.println("sqlId"+sqlId); + BoundSql boundSql = mappedStatement.getBoundSql(parameter); + Configuration configuration = mappedStatement.getConfiguration(); + sqlCommandType = mappedStatement.getSqlCommandType().name(); + System.out.println("1111"+sqlCommandType); if ("update".equals(sqlCommandType.toLowerCase()) || "delete".equals(sqlCommandType.toLowerCase())) { if (!(sql.toUpperCase().contains("LIS_REPORT_TBL") || sql.toUpperCase().contains("RIS_REPORT_TBL"))) { + System.out.println("update delete"+sqlCommandType); sql = getSql(configuration, boundSql, sqlId); System.out.println("delete and update sync sql = " + sql); //发送要同步的sql @@ -77,8 +81,13 @@ public class MybatisSqlInterceptor implements Interceptor { sql = getSql(configuration, boundSql, sqlId); } - System.out.println("sqlCommandType = "+sqlCommandType+":mysql sql =" + sql); - returnValue = invocation.proceed(); + System.out.println("sqlCommandType = "+sqlCommandType+":mysql sql =" + sql); + returnValue = invocation.proceed(); + }catch (Exception e) + { + System.out.println(e); + } + } else {