Commit 21cb53bfcaeb0f4b491d916271928dc1b9b6f433

Authored by YunaiV
1 parent 49b883f0

【依赖升级】mybatis-plus from 3.5.7 to 3.5.8

yudao-dependencies/pom.xml
... ... @@ -24,8 +24,7 @@
24 24 <!-- DB 相关 -->
25 25 <druid.version>1.2.23</druid.version>
26 26 <mybatis.version>3.5.16</mybatis.version>
27   - <mybatis-plus.version>3.5.7</mybatis-plus.version>
28   - <mybatis-plus-generator.version>3.5.7</mybatis-plus-generator.version>
  27 + <mybatis-plus.version>3.5.8</mybatis-plus.version>
29 28 <dynamic-datasource.version>4.3.1</dynamic-datasource.version>
30 29 <mybatis-plus-join.version>1.4.13</mybatis-plus-join.version>
31 30 <easy-trans.version>3.0.6</easy-trans.version>
... ... @@ -184,7 +183,7 @@
184 183 <dependency>
185 184 <groupId>com.baomidou</groupId>
186 185 <artifactId>mybatis-plus-generator</artifactId> <!-- 代码生成器,使用它解析表结构 -->
187   - <version>${mybatis-plus-generator.version}</version>
  186 + <version>${mybatis-plus.version}</version>
188 187 </dependency>
189 188 <dependency>
190 189 <groupId>com.baomidou</groupId>
... ...
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRule.java
... ... @@ -21,6 +21,7 @@ import net.sf.jsqlparser.expression.operators.conditional.OrExpression;
21 21 import net.sf.jsqlparser.expression.operators.relational.EqualsTo;
22 22 import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
23 23 import net.sf.jsqlparser.expression.operators.relational.InExpression;
  24 +import net.sf.jsqlparser.expression.operators.relational.ParenthesedExpressionList;
24 25  
25 26 import java.util.HashMap;
26 27 import java.util.HashSet;
... ... @@ -141,7 +142,7 @@ public class DeptDataPermissionRule implements DataPermissionRule {
141 142 return deptExpression;
142 143 }
143 144 // 目前,如果有指定部门 + 可查看自己,采用 OR 条件。即,WHERE (dept_id IN ? OR user_id = ?)
144   - return new Parenthesis(new OrExpression(deptExpression, userExpression));
  145 + return new ParenthesedExpressionList(new OrExpression(deptExpression, userExpression));
145 146 }
146 147  
147 148 private Expression buildDeptExpression(String tableName, Alias tableAlias, Set<Long> deptIds) {
... ... @@ -157,7 +158,7 @@ public class DeptDataPermissionRule implements DataPermissionRule {
157 158 // 拼接条件
158 159 return new InExpression(MyBatisUtils.buildColumn(tableName, tableAlias, columnName),
159 160 // Parenthesis 的目的,是提供 (1,2,3) 的 () 左右括号
160   - new Parenthesis(new ExpressionList<LongValue>(CollectionUtils.convertList(deptIds, LongValue::new))));
  161 + new ParenthesedExpressionList(new ExpressionList<LongValue>(CollectionUtils.convertList(deptIds, LongValue::new))));
161 162 }
162 163  
163 164 private Expression buildUserExpression(String tableName, Alias tableAlias, Boolean self, Long userId) {
... ...
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/test/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionRuleHandlerTest.java
... ... @@ -8,10 +8,10 @@ import com.baomidou.mybatisplus.extension.plugins.inner.DataPermissionIntercepto
8 8 import net.sf.jsqlparser.expression.Alias;
9 9 import net.sf.jsqlparser.expression.Expression;
10 10 import net.sf.jsqlparser.expression.LongValue;
11   -import net.sf.jsqlparser.expression.Parenthesis;
12 11 import net.sf.jsqlparser.expression.operators.relational.EqualsTo;
13 12 import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
14 13 import net.sf.jsqlparser.expression.operators.relational.InExpression;
  14 +import net.sf.jsqlparser.expression.operators.relational.ParenthesedExpressionList;
15 15 import net.sf.jsqlparser.schema.Column;
16 16 import org.junit.jupiter.api.BeforeEach;
17 17 import org.junit.jupiter.api.Test;
... ... @@ -81,7 +81,7 @@ public class DataPermissionRuleHandlerTest extends BaseMockitoUnitTest {
81 81 Column column = MyBatisUtils.buildColumn(tableName, tableAlias, COLUMN);
82 82 ExpressionList<LongValue> values = new ExpressionList<>(new LongValue(10L),
83 83 new LongValue(20L));
84   - return new InExpression(column, new Parenthesis((values)));
  84 + return new InExpression(column, new ParenthesedExpressionList((values)));
85 85 }
86 86  
87 87 };
... ...