Commit 72ab5beadc9c98704fdfaf767a683a6a90a148a5
1 parent
15d2991e7a
Exists in
master
and in
6 other branches
update
Showing 1 changed file with 16 additions and 7 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/inteceptor/MybatisSqlInterceptor.java
View file @
72ab5be
... | ... | @@ -55,16 +55,20 @@ |
55 | 55 | parameter = invocation.getArgs()[1]; |
56 | 56 | } |
57 | 57 | |
58 | - sqlId = mappedStatement.getId(); | |
59 | - BoundSql boundSql = mappedStatement.getBoundSql(parameter); | |
60 | - Configuration configuration = mappedStatement.getConfiguration(); | |
61 | - sqlCommandType = mappedStatement.getSqlCommandType().name(); | |
58 | + try | |
59 | + { | |
60 | + sqlId = mappedStatement.getId(); | |
61 | + System.out.println("sqlId"+sqlId); | |
62 | + BoundSql boundSql = mappedStatement.getBoundSql(parameter); | |
63 | + Configuration configuration = mappedStatement.getConfiguration(); | |
64 | + sqlCommandType = mappedStatement.getSqlCommandType().name(); | |
62 | 65 | |
63 | - | |
66 | + System.out.println("1111"+sqlCommandType); | |
64 | 67 | if ("update".equals(sqlCommandType.toLowerCase()) || "delete".equals(sqlCommandType.toLowerCase())) |
65 | 68 | { |
66 | 69 | if (!(sql.toUpperCase().contains("LIS_REPORT_TBL") || sql.toUpperCase().contains("RIS_REPORT_TBL"))) { |
67 | 70 | |
71 | + System.out.println("update delete"+sqlCommandType); | |
68 | 72 | sql = getSql(configuration, boundSql, sqlId); |
69 | 73 | System.out.println("delete and update sync sql = " + sql); |
70 | 74 | //发送要同步的sql |
... | ... | @@ -77,8 +81,13 @@ |
77 | 81 | sql = getSql(configuration, boundSql, sqlId); |
78 | 82 | } |
79 | 83 | |
80 | - System.out.println("sqlCommandType = "+sqlCommandType+":mysql sql =" + sql); | |
81 | - returnValue = invocation.proceed(); | |
84 | + System.out.println("sqlCommandType = "+sqlCommandType+":mysql sql =" + sql); | |
85 | + returnValue = invocation.proceed(); | |
86 | + }catch (Exception e) | |
87 | + { | |
88 | + System.out.println(e); | |
89 | + } | |
90 | + | |
82 | 91 | } |
83 | 92 | else |
84 | 93 | { |