|
@@ -42,7 +42,7 @@ public class MybatisSqlIntercept implements Interceptor {
|
|
|
|
|
|
|
|
public static String I18N = "";
|
|
public static String I18N = "";
|
|
|
public static Integer cpId = 0;
|
|
public static Integer cpId = 0;
|
|
|
- public static String primaryKey = null;
|
|
|
|
|
|
|
+// public static String primaryKey = null;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Object intercept(Invocation invocation) throws Throwable {
|
|
public Object intercept(Invocation invocation) throws Throwable {
|
|
@@ -67,24 +67,32 @@ public class MybatisSqlIntercept implements Interceptor {
|
|
|
}
|
|
}
|
|
|
if (argsNo2Map != null) {
|
|
if (argsNo2Map != null) {
|
|
|
argsNo2Map.put("i18n", I18N);
|
|
argsNo2Map.put("i18n", I18N);
|
|
|
- if(cpId != 0){
|
|
|
|
|
|
|
+ if (cpId != 0) {
|
|
|
argsNo2Map.put("cpId", cpId);
|
|
argsNo2Map.put("cpId", cpId);
|
|
|
}
|
|
}
|
|
|
args2[1] = argsNo2Map;
|
|
args2[1] = argsNo2Map;
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if(primaryKey != null ){
|
|
|
|
|
- Map<String, Object> argsNo2Map = new HashMap<>();
|
|
|
|
|
- // 默认叫id
|
|
|
|
|
- argsNo2Map.put(primaryKey,args[1]);
|
|
|
|
|
- argsNo2Map.put("i18n", I18N);
|
|
|
|
|
- if(cpId != 0){
|
|
|
|
|
- argsNo2Map.put("cpId", cpId);
|
|
|
|
|
- }
|
|
|
|
|
- args2[1] =argsNo2Map;
|
|
|
|
|
- }else{
|
|
|
|
|
- args2[1] = args[1];
|
|
|
|
|
|
|
+ Map<String, Object> argsNo2Map = new HashMap<>();
|
|
|
|
|
+ // 默认叫id
|
|
|
|
|
+ argsNo2Map.put("id", args[1]);
|
|
|
|
|
+ argsNo2Map.put("i18n", I18N);
|
|
|
|
|
+ if (cpId != 0) {
|
|
|
|
|
+ argsNo2Map.put("cpId", cpId);
|
|
|
}
|
|
}
|
|
|
|
|
+ args2[1] = argsNo2Map;
|
|
|
|
|
+// if(primaryKey != null ){
|
|
|
|
|
+// Map<String, Object> argsNo2Map = new HashMap<>();
|
|
|
|
|
+// // 默认叫id
|
|
|
|
|
+// argsNo2Map.put(primaryKey,args[1]);
|
|
|
|
|
+// argsNo2Map.put("i18n", I18N);
|
|
|
|
|
+// if(cpId != 0){
|
|
|
|
|
+// argsNo2Map.put("cpId", cpId);
|
|
|
|
|
+// }
|
|
|
|
|
+// args2[1] =argsNo2Map;
|
|
|
|
|
+// }else{
|
|
|
|
|
+// args2[1] = args[1];
|
|
|
|
|
+// }
|
|
|
//TODO 在此添加单参数的逻辑 做法是获取父类的方法的参数名 然后把单参数转成Map传给xml
|
|
//TODO 在此添加单参数的逻辑 做法是获取父类的方法的参数名 然后把单参数转成Map传给xml
|
|
|
}
|
|
}
|
|
|
args2[0] = args[0];
|
|
args2[0] = args[0];
|