From 7c235822506ea42191aaab8b517dea8d34ac7034 Mon Sep 17 00:00:00 2001 From: "1351515658@qq.com" <1351515658@qq.com> Date: Wed, 3 Jan 2024 10:16:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9xml=E7=9A=84sql=E8=AF=AD?= =?UTF-8?q?=E5=8F=A5=E4=B8=AD=E8=A1=A8=E5=90=8D=E7=A7=B0=E5=B8=A6`?= =?UTF-8?q?=E7=AC=A6=E5=8F=B7=20=20=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90sql?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/db/DataPermissionDatabaseInterceptor.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java index 98f64d11a..b42dfde07 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java @@ -495,8 +495,10 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme // 生成条件 Expression allExpression = null; for (DataPermissionRule rule : ContextHolder.getRules()) { + + String tableName = MyBatisUtils.getTableName(table); // 判断表名是否匹配 - if (!rule.getTableNames().contains(table.getName())) { + if (!rule.getTableNames().contains(tableName)) { continue; } // 如果有匹配的规则,说明可重写。 @@ -505,7 +507,6 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme ContextHolder.setRewrite(true); // 单条规则的条件 - String tableName = MyBatisUtils.getTableName(table); Expression oneExpress = rule.getExpression(tableName, table.getAlias()); if (oneExpress == null){ continue;