1. 修复自定义 sql 中大写表名无法匹配到 mybatis 中的缓存表信息,导致表被忽略租户的问题
2. 新增 iwork feign api 调用
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
package com.zt.plat.framework.tenant.core.db;
|
||||
|
||||
import com.zt.plat.framework.tenant.config.TenantProperties;
|
||||
import com.zt.plat.framework.tenant.core.aop.TenantIgnore;
|
||||
import com.zt.plat.framework.tenant.core.context.TenantContextHolder;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler;
|
||||
import com.baomidou.mybatisplus.extension.toolkit.SqlParserUtils;
|
||||
import com.zt.plat.framework.tenant.config.TenantProperties;
|
||||
import com.zt.plat.framework.tenant.core.aop.TenantIgnore;
|
||||
import com.zt.plat.framework.tenant.core.context.TenantContextHolder;
|
||||
import net.sf.jsqlparser.expression.Expression;
|
||||
import net.sf.jsqlparser.expression.LongValue;
|
||||
|
||||
@@ -69,7 +69,12 @@ public class TenantDatabaseInterceptor implements TenantLineHandler {
|
||||
// 找不到的表,说明不是 zt 项目里的,不进行拦截(忽略租户)
|
||||
TableInfo tableInfo = TableInfoHelper.getTableInfo(tableName);
|
||||
if (tableInfo == null) {
|
||||
return true;
|
||||
tableName = tableName.toLowerCase();
|
||||
tableInfo = TableInfoHelper.getTableInfo(tableName);
|
||||
}
|
||||
if (tableInfo == null) {
|
||||
tableName = tableName.toLowerCase();
|
||||
tableInfo = TableInfoHelper.getTableInfo(tableName);
|
||||
}
|
||||
// 如果继承了 TenantBaseDO 基类,显然不忽略租户
|
||||
if (TenantBaseDO.class.isAssignableFrom(tableInfo.getEntityType())) {
|
||||
|
||||
Reference in New Issue
Block a user