diff --git a/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisInterceptor.java b/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisInterceptor.java index 59f643a1..aef22667 100644 --- a/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisInterceptor.java +++ b/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisInterceptor.java @@ -106,7 +106,14 @@ public class MybatisInterceptor implements Interceptor { //e.printStackTrace(); } } - field.set(parameter, tenantId); + + if (field.getType().equals(String.class)) { + // 字段类型为String + field.set(parameter, tenantId); + } else { + // 字段类型不是String + field.set(parameter, oConvertUtils.getInt(tenantId, 0)); + } field.setAccessible(false); } }