Commit f01656cd by 李传峰

feat:[none] PageBeanNew bug

parent 790da83a
...@@ -3,9 +3,11 @@ package com.pcloud.common.core.mybatis.interceptor; ...@@ -3,9 +3,11 @@ package com.pcloud.common.core.mybatis.interceptor;
import java.util.Properties; import java.util.Properties;
import com.pcloud.common.core.mybatis.dialect.MySqlDialect; import com.pcloud.common.core.mybatis.dialect.MySqlDialect;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.ibatis.executor.Executor; import org.apache.ibatis.executor.Executor;
import org.apache.ibatis.mapping.BoundSql; import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement; import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.ParameterMapping;
import org.apache.ibatis.plugin.Intercepts; import org.apache.ibatis.plugin.Intercepts;
import org.apache.ibatis.plugin.Invocation; import org.apache.ibatis.plugin.Invocation;
import org.apache.ibatis.plugin.Plugin; import org.apache.ibatis.plugin.Plugin;
...@@ -89,6 +91,13 @@ public class ExecutorInterceptor extends AbstractInterceptor implements Initiali ...@@ -89,6 +91,13 @@ public class ExecutorInterceptor extends AbstractInterceptor implements Initiali
} }
BoundSql newBoundSql = new BoundSql(ms.getConfiguration(), sql, boundSql.getParameterMappings(), boundSql.getParameterObject()); BoundSql newBoundSql = new BoundSql(ms.getConfiguration(), sql, boundSql.getParameterMappings(), boundSql.getParameterObject());
if (CollectionUtils.isNotEmpty(boundSql.getParameterMappings())) {
for (ParameterMapping p : boundSql.getParameterMappings()) {
if (boundSql.hasAdditionalParameter(p.getProperty())) {
newBoundSql.setAdditionalParameter(p.getProperty(), boundSql.getAdditionalParameter(p.getProperty()));
}
}
}
MappedStatement newMs = copyFromMappedStatement(ms, new BoundSqlSqlSource(newBoundSql), true); MappedStatement newMs = copyFromMappedStatement(ms, new BoundSqlSqlSource(newBoundSql), true);
queryArgs[MAPPED_STATEMENT_INDEX] = newMs; queryArgs[MAPPED_STATEMENT_INDEX] = newMs;
queryArgs[PARAMETER_INDEX] = parameter; queryArgs[PARAMETER_INDEX] = parameter;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment