queryResults

queryResults无参数,queryResultsCount初始化异常
上级 504c3dfc
......@@ -206,10 +206,15 @@ public class MapperSqlProvider <T extends BaseDomain>{
StringBuffer sql=new StringBuffer();
StringBuffer countSql=new StringBuffer();
for (ParameterMapping parameterMapping:boundSql.getParameterMappings()) {
countSql.append(selectSql.substring(0, selectSql.indexOf("?")));
countSql.append("#{"+parameterMapping.getProperty()+"}");
selectSql=selectSql.substring(selectSql.indexOf("?")+1);
if(boundSql.getParameterMappings()==null ||boundSql.getParameterMappings().isEmpty()) {
countSql.append(selectSql);
}else {
for (ParameterMapping parameterMapping:boundSql.getParameterMappings()) {
countSql.append(selectSql.substring(0, selectSql.indexOf("?")));
countSql.append("#{"+parameterMapping.getProperty()+"}");
selectSql=selectSql.substring(selectSql.indexOf("?")+1);
}
}
if(countSql.toString().toUpperCase().indexOf("DISTINCT")>0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册