Commit 1410e43f1b3d43d425aab9cc151d3b6da3f47490

Authored by liquanyu
1 parent 89f3996239

update

Showing 2 changed files with 17 additions and 28 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/inteceptor/MybatisSqlInterceptor.java View file @ 1410e43
... ... @@ -75,12 +75,10 @@
75 75 Object[] args = invocation.getArgs();
76 76 Object returnValue = null;
77 77 System.out.println("args length = "+args.length);
78   - System.out.println("time1=========" + (System.currentTimeMillis()-start));
79 78 try
80 79 {
81 80 if (args != null && args.length == 2)
82 81 {
83   - System.out.println("time2=========" + (System.currentTimeMillis()-start));
84 82 MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0];
85 83 Object parameter = null;
86 84 if (invocation.getArgs().length > 1) {
87 85  
88 86  
89 87  
90 88  
... ... @@ -90,40 +88,34 @@
90 88 BoundSql boundSql = mappedStatement.getBoundSql(parameter);
91 89 Configuration configuration = mappedStatement.getConfiguration();
92 90 sqlCommandType = mappedStatement.getSqlCommandType().name();
93   -
94   - System.out.println("time3=========" + (System.currentTimeMillis()-start));
95   - System.out.println("sqlCommandType = "+sqlCommandType);
96   - if ("update".equals(sqlCommandType.toLowerCase()) || "delete".equals(sqlCommandType.toLowerCase()))
  91 +// if ("update".equals(sqlCommandType.toLowerCase()) || "delete".equals(sqlCommandType.toLowerCase()))
  92 +// {
  93 +// sql = getSql(configuration, boundSql, sqlId);
  94 +// System.out.println("sql = "+sql);
  95 +// if (isSyncTable(sql))
  96 +// {
  97 +//
  98 +// System.out.println("delete or update sync sql = " + sql);
  99 +// //发送要同步的sql
  100 +// SendMysqlSyncDatUtil.addSqlToQueue(sql, sqlId);
  101 +// sql = null;
  102 +// System.out.println("time4=========" + (System.currentTimeMillis()-start));
  103 +// }
  104 +// }
  105 +// else
  106 + if ("insert".equals(sqlCommandType.toLowerCase()) )
97 107 {
98   - sql = getSql(configuration, boundSql, sqlId);
99   - System.out.println("sql = "+sql);
100   - if (isSyncTable(sql))
101   - {
102   -
103   - System.out.println("delete or update sync sql = " + sql);
104   - //发送要同步的sql
105   - SendMysqlSyncDatUtil.addSqlToQueue(sql, sqlId);
106   - sql = null;
107   - System.out.println("time4=========" + (System.currentTimeMillis()-start));
108   - }
109   - }
110   - else if ("insert".equals(sqlCommandType.toLowerCase()) )
111   - {
112   - System.out.println("time5=========" + (System.currentTimeMillis()-start));
113 108 String tempSql = getSql(configuration, boundSql, sqlId);
114 109 if (isSyncTable(tempSql))
115 110 {
116 111 sql = tempSql;
117   - System.out.println("sql = "+sql);
118   - System.out.println("time6=========" + (System.currentTimeMillis()-start));
119 112 }
120 113 }
121 114 returnValue = invocation.proceed();
122   - System.out.println("time7=========" + (System.currentTimeMillis()-start));
  115 +
123 116 }
124 117 else
125 118 {
126   - System.out.println("time8=========" + (System.currentTimeMillis()-start));
127 119 returnValue = invocation.proceed();
128 120 if (StringUtils.isNotEmpty(sql) && sqlCommandType != null && "insert".equals(sqlCommandType.toLowerCase()))
129 121 {
130 122  
... ... @@ -138,12 +130,10 @@
138 130 //发送要同步的sql
139 131 SendMysqlSyncDatUtil.addSqlToQueue(sql, sqlId);
140 132 sql = null;
141   - System.out.println("time9=========" + (System.currentTimeMillis()-start));
142 133 }
143 134 }
144 135 }
145 136 }
146   - System.out.println("time10=========" + (System.currentTimeMillis()-start));
147 137 }catch (Exception e)
148 138 {
149 139 ExceptionUtils.catchException(e," Mybatis Sql Interceptor exception");
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/SendMysqlSyncDatUtil.java View file @ 1410e43
... ... @@ -76,7 +76,6 @@
76 76 SqlRequest request = null;
77 77 while (true) {
78 78 try {
79   - System.out.println("get resuest = " + request+" size = "+syncSqlQueue.size());
80 79 request = syncSqlQueue.poll(1, TimeUnit.MINUTES);
81 80 String json = JsonUtil.obj2Str(request);
82 81 if (CollectionUtils.isNotEmpty(urls))