From ae403b4e16296712de0fd3e954a83d6279420121 Mon Sep 17 00:00:00 2001
From: Administrator <15274802129@163.com>
Date: Tue, 02 Jun 2026 09:57:50 +0800
Subject: [PATCH] refactor(okxNewPrice): 更新配置并优化网格交易初始化逻辑
---
src/main/java/com/xcong/excoin/configurations/interceptor/MybatisInterceptor.java | 38 +++++++++++++++++++++++++++++++++++++-
1 files changed, 37 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/xcong/excoin/configurations/interceptor/MybatisInterceptor.java b/src/main/java/com/xcong/excoin/configurations/interceptor/MybatisInterceptor.java
index 08aa177..46aad94 100644
--- a/src/main/java/com/xcong/excoin/configurations/interceptor/MybatisInterceptor.java
+++ b/src/main/java/com/xcong/excoin/configurations/interceptor/MybatisInterceptor.java
@@ -1,10 +1,46 @@
package com.xcong.excoin.configurations.interceptor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.ibatis.executor.Executor;
+import org.apache.ibatis.mapping.MappedStatement;
+import org.apache.ibatis.mapping.SqlCommandType;
+import org.apache.ibatis.plugin.*;
+import org.apache.ibatis.session.defaults.DefaultSqlSession;
+import org.springframework.stereotype.Component;
+
+import java.util.*;
+
/**
* mybatis拦截器,自动注入创建人、创建时间、修改人、修改时间
*
* @author wzy
* @date 2020-05-13
**/
-public class MybatisInterceptor {
+@Slf4j
+@Component
+@Intercepts({@Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class})})
+public class MybatisInterceptor implements Interceptor {
+ @Override
+ public Object intercept(Invocation invocation) throws Throwable {
+ MappedStatement mappedStatement = (MappedStatement) invocation.getArgs()[0];
+ SqlCommandType sqlCommandType = mappedStatement.getSqlCommandType();
+
+ Object parameter = invocation.getArgs()[1];
+ if (parameter == null) {
+ return invocation.proceed();
+ }
+
+ return invocation.proceed();
+ }
+
+ @Override
+ public Object plugin(Object o) {
+ return Plugin.wrap(o, this);
+ }
+
+ @Override
+ public void setProperties(Properties properties) {
+
+ }
+
}
--
Gitblit v1.9.1