兼容xml的sql语句中表名称带`符号 数据权限sql不生效的问题
This commit is contained in:
parent
4a9fb0e17f
commit
7c23582250
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user