From acc20af6ad1ebd92ffdf785e6bb6a5a462087c24 Mon Sep 17 00:00:00 2001 From: zoemak <58775+zoemak@user.noreply.gitee.com> Date: Thu, 10 Oct 2024 08:40:10 +0000 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91=E5=BF=BD?= =?UTF-8?q?=E7=95=A5=E5=A4=9A=E7=A7=9F=E6=88=B7=E7=9A=84=E8=A1=A8=EF=BC=8C?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E8=A1=A8=E5=90=8D=E5=B8=A6=E6=9C=89=E5=8C=85?= =?UTF-8?q?=E8=A3=B9=E7=AC=A6=E5=8F=B7=E7=9A=84=E6=83=85=E5=86=B5=20?= =?UTF-8?q?=E5=88=A9=E7=94=A8SqlParserUtils.removeWrapperSymbol(tableName)?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=A1=A8=E5=90=8D=E5=89=8D=E5=90=8E=E7=9A=84?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E7=AC=A6=E5=8F=B7=EF=BC=8C=E6=AF=94=E5=A6=82?= =?UTF-8?q?MySQL=E7=9A=84=E5=8F=8D=E5=BC=95=E5=8F=B7=E6=88=96=E8=80=85SQLS?= =?UTF-8?q?erver=E7=9A=84=E4=B8=AD=E6=8B=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zoemak <58775+zoemak@user.noreply.gitee.com> --- .../framework/tenant/core/db/TenantDatabaseInterceptor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/db/TenantDatabaseInterceptor.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/db/TenantDatabaseInterceptor.java index 8ea1a96b87..786b4fe6b5 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/db/TenantDatabaseInterceptor.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/db/TenantDatabaseInterceptor.java @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; import cn.iocoder.yudao.framework.tenant.config.TenantProperties; import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; import com.baomidou.mybatisplus.extension.plugins.handler.TenantLineHandler; +import com.baomidou.mybatisplus.extension.toolkit.SqlParserUtils; import net.sf.jsqlparser.expression.Expression; import net.sf.jsqlparser.expression.LongValue; @@ -37,7 +38,7 @@ public class TenantDatabaseInterceptor implements TenantLineHandler { @Override public boolean ignoreTable(String tableName) { return TenantContextHolder.isIgnore() // 情况一,全局忽略多租户 - || CollUtil.contains(ignoreTables, tableName); // 情况二,忽略多租户的表 + || CollUtil.contains(ignoreTables, SqlParserUtils.removeWrapperSymbol(tableName)); // 情况二,忽略多租户的表 } -} +} \ No newline at end of file