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 de9347b..093eb92 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 @@ -60,21 +60,20 @@ public class MybatisSqlInterceptor implements Interceptor { Configuration configuration = mappedStatement.getConfiguration(); sqlCommandType = mappedStatement.getSqlCommandType().name(); - if (!(sql == null || sql.toUpperCase().contains("LIS_REPORT_TBL") || sql.toUpperCase().contains("RIS_REPORT_TBL"))) + if (!(sql.toUpperCase().contains("LIS_REPORT_TBL") || sql.toUpperCase().contains("RIS_REPORT_TBL"))) { - if ("insert".equals(sqlCommandType.toLowerCase())) + + if ("update".equals(sqlCommandType.toLowerCase()) || "delete".equals(sqlCommandType.toLowerCase())) { sql = getSql(configuration, boundSql, sqlId); + System.out.println("delete and update sync sql = "+sql); + //发送要同步的sql + SendMysqlSyncDatUtil.sendSql(sql, sqlId); + sql = null; } - else + else if ("insert".equals(sqlCommandType.toLowerCase()) ) { - if ("update".equals(sqlCommandType.toLowerCase()) || "delete".equals(sqlCommandType.toLowerCase())) - { - System.out.println("delete and update sync sql = "+sql); - //发送要同步的sql - SendMysqlSyncDatUtil.sendSql(sql, sqlId); - sql = null; - } + sql = getSql(configuration, boundSql, sqlId); } }