From c953df4c6e7974156d0ea6afb563002852616ec2 Mon Sep 17 00:00:00 2001 From: liquanyu Date: Thu, 4 May 2017 09:13:50 +0800 Subject: [PATCH] update --- .../operate/web/inteceptor/MybatisSqlInterceptor.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 dc8ed53..2cb33c8 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 @@ -44,13 +44,17 @@ public class MybatisSqlInterceptor implements Interceptor { public Object intercept(Invocation invocation) throws Throwable { + long start = System.currentTimeMillis(); + Object[] args = invocation.getArgs(); Object returnValue = null; System.out.println("args length = "+args.length); + System.out.println("time1=========" + (System.currentTimeMillis()-start)); try { if (args != null && args.length == 2) { + System.out.println("time2=========" + (System.currentTimeMillis()-start)); MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0]; Object parameter = null; if (invocation.getArgs().length > 1) { @@ -61,6 +65,7 @@ public class MybatisSqlInterceptor implements Interceptor { Configuration configuration = mappedStatement.getConfiguration(); sqlCommandType = mappedStatement.getSqlCommandType().name(); + System.out.println("time3=========" + (System.currentTimeMillis()-start)); System.out.println("sqlCommandType = "+sqlCommandType); if ("update".equals(sqlCommandType.toLowerCase()) || "delete".equals(sqlCommandType.toLowerCase())) { @@ -73,21 +78,25 @@ public class MybatisSqlInterceptor implements Interceptor { //发送要同步的sql SendMysqlSyncDatUtil.addSqlToQueue(sql, sqlId); sql = null; + System.out.println("time4=========" + (System.currentTimeMillis()-start)); } } else if ("insert".equals(sqlCommandType.toLowerCase()) ) { + System.out.println("time5=========" + (System.currentTimeMillis()-start)); String tempSql = getSql(configuration, boundSql, sqlId); if (!(tempSql.toUpperCase().contains("LIS_REPORT_TBL") || tempSql.toUpperCase().contains("RIS_REPORT_TBL"))) { sql = tempSql; System.out.println("sql = "+sql); + System.out.println("time6=========" + (System.currentTimeMillis()-start)); } } returnValue = invocation.proceed(); } else { + System.out.println("time7=========" + (System.currentTimeMillis()-start)); returnValue = invocation.proceed(); if (StringUtils.isNotEmpty(sql) && sqlCommandType != null && "insert".equals(sqlCommandType.toLowerCase())) { @@ -102,10 +111,12 @@ public class MybatisSqlInterceptor implements Interceptor { //发送要同步的sql SendMysqlSyncDatUtil.addSqlToQueue(sql, sqlId); sql = null; + System.out.println("time8=========" + (System.currentTimeMillis()-start)); } } } } + System.out.println("time9=========" + (System.currentTimeMillis()-start)); }catch (Exception e) { ExceptionUtils.catchException(e," Mybatis Sql Interceptor exception"); -- 1.8.3.1