Commit 61f960e 1 parent 45f297a commit 61f960e Copy full SHA for 61f960e
File tree 2 files changed +4
-2
lines changed
spring-boot-student-mybatis/src/main/java/com/xiaolyuh/mybatis
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 21
21
nbbuild /
22
22
dist /
23
23
nbdist /
24
- .nb-gradle /
24
+ .nb-gradle /
25
+ * .log
Original file line number Diff line number Diff line change 1
1
package com .xiaolyuh .mybatis ;
2
2
3
+ import com .alibaba .fastjson .JSON ;
3
4
import org .apache .ibatis .executor .Executor ;
4
5
import org .apache .ibatis .mapping .MappedStatement ;
5
6
import org .apache .ibatis .plugin .Interceptor ;
@@ -29,7 +30,7 @@ public Object intercept(Invocation invocation) throws Throwable {
29
30
Object [] args = invocation .getArgs ();
30
31
MappedStatement statement = (MappedStatement ) args [0 ];
31
32
String sql = statement .getBoundSql (args [1 ]).getSql ();
32
- System .out .println ("--------intercept method: " + statement .getId () + "-----sql: " + sql );
33
+ System .out .println ("--------intercept method: " + statement .getId () + "\n -----sql: " + sql + " \n ------args: " + JSON . toJSONString ( args [ 1 ]) );
33
34
//执行目标方法
34
35
return invocation .proceed ();
35
36
}
You can’t perform that action at this time.
0 commit comments