Skip to content

Commit

Permalink
update mybatis-plus 3.5.7 => 3.5.8 代码适配更改
Browse files Browse the repository at this point in the history
  • Loading branch information
JavaLionLi committed Sep 19, 2024
1 parent fb0d67d commit 0ee13b8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 21 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<spring-cloud.version>2023.0.3</spring-cloud.version>
<spring-boot-admin.version>3.2.3</spring-boot-admin.version>
<mybatis.version>3.5.16</mybatis.version>
<mybatis-plus.version>3.5.7</mybatis-plus.version>
<mybatis-plus.version>3.5.8</mybatis-plus.version>
<p6spy.version>3.9.1</p6spy.version>
<dynamic-ds.version>4.3.1</dynamic-ds.version>
<velocity.version>2.3</velocity.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ default List<T> selectList() {
* @return 插入操作是否成功的布尔值
*/
default boolean insertBatch(Collection<T> entityList) {
Db.saveBatch(entityList);
// 临时解决 新版本 mp 插入状态判断错误问题
return true;
return Db.saveBatch(entityList);
}

/**
Expand All @@ -84,9 +82,7 @@ default boolean insertBatch(Collection<T> entityList) {
* @return 更新操作是否成功的布尔值
*/
default boolean updateBatchById(Collection<T> entityList) {
Db.updateBatchById(entityList);
// 临时解决 新版本 mp 插入状态判断错误问题
return true;
return Db.updateBatchById(entityList);
}

/**
Expand All @@ -96,9 +92,7 @@ default boolean updateBatchById(Collection<T> entityList) {
* @return 插入或更新操作是否成功的布尔值
*/
default boolean insertOrUpdateBatch(Collection<T> entityList) {
Db.saveOrUpdateBatch(entityList);
// 临时解决 新版本 mp 插入状态判断错误问题
return true;
return Db.saveOrUpdateBatch(entityList);
}

/**
Expand All @@ -109,9 +103,7 @@ default boolean insertOrUpdateBatch(Collection<T> entityList) {
* @return 插入操作是否成功的布尔值
*/
default boolean insertBatch(Collection<T> entityList, int batchSize) {
Db.saveBatch(entityList, batchSize);
// 临时解决 新版本 mp 插入状态判断错误问题
return true;
return Db.saveBatch(entityList, batchSize);
}

/**
Expand All @@ -122,9 +114,7 @@ default boolean insertBatch(Collection<T> entityList, int batchSize) {
* @return 更新操作是否成功的布尔值
*/
default boolean updateBatchById(Collection<T> entityList, int batchSize) {
Db.updateBatchById(entityList, batchSize);
// 临时解决 新版本 mp 插入状态判断错误问题
return true;
return Db.updateBatchById(entityList, batchSize);
}

/**
Expand All @@ -135,9 +125,7 @@ default boolean updateBatchById(Collection<T> entityList, int batchSize) {
* @return 插入或更新操作是否成功的布尔值
*/
default boolean insertOrUpdateBatch(Collection<T> entityList, int batchSize) {
Db.saveOrUpdateBatch(entityList, batchSize);
// 临时解决 新版本 mp 插入状态判断错误问题
return true;
return Db.saveOrUpdateBatch(entityList, batchSize);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import lombok.extern.slf4j.Slf4j;
import net.sf.jsqlparser.JSQLParserException;
import net.sf.jsqlparser.expression.Expression;
import net.sf.jsqlparser.expression.Parenthesis;
import net.sf.jsqlparser.expression.operators.conditional.AndExpression;
import net.sf.jsqlparser.expression.operators.relational.ParenthesedExpressionList;
import net.sf.jsqlparser.parser.CCJSqlParserUtil;
import org.apache.ibatis.io.Resources;
import org.dromara.common.core.exception.ServiceException;
Expand Down Expand Up @@ -106,7 +106,7 @@ public Expression getSqlSegment(Expression where, String mappedStatementId, bool
try {
Expression expression = CCJSqlParserUtil.parseExpression(dataFilterSql);
// 数据权限使用单独的括号 防止与其他条件冲突
Parenthesis parenthesis = new Parenthesis(expression);
ParenthesedExpressionList<Expression> parenthesis = new ParenthesedExpressionList<>(expression);
if (ObjectUtil.isNotNull(where)) {
return new AndExpression(where, parenthesis);
} else {
Expand Down

0 comments on commit 0ee13b8

Please sign in to comment.