v5.1.5
版本发布时间: 2018-09-04 22:01:12
pagehelper/Mybatis-PageHelper最新发布版本:v6.0.0(2023-11-05 11:52:39)
5.1.5 - 2018-09-02
- 优化代码,去掉没必要的校验(by lenosp)
- 解决 pageKey 多处理一次的小问题 #268
- 新增 gitee 提供的 javadoc 文档(https://apidoc.gitee.com/free/Mybatis_PageHelper)
- 解决默认反射不带缓存的问题 fixed #275
- 优化mysql ifnull函数导致分页性能问题 (by miaogr)(这个修改最终改成了下面的
aggregateFunctions
) - jsqlparser 升级为 1.2 版本,和 1.0 有不兼容的情况,已经解决。 fixed 273
- 去掉 PageInfo 中存在歧义的 g(s)etFirstPage 和 g(s)etLastPage 两个方法
- 抛出排序时解析失败的异常 fixed #257
- 解决 Spring
<bean>
方式配置时,没有properties
属性时的初始化问题 fixed #26 - 修复Oracle分页会漏查数据的问题 (by muyun12)
- 新增
aggregateFunctions
参数(CountSqlParser
), 允许手动添加聚合函数(影响行数),所以以聚合函数开头的函数,在进行 count 转换时,会套一层。其他函数和列会被替换为 count(0),其中count列可以自己配置。
增加 aggregateFunctions
参数后,和原先最大的区别是,如果存在 select ifnull(xxx, yy) from table ...
,原先的 count 查询是
select count(0) from (select ifnull(xxx, yy) from table ...) temp_count
,现在会区别聚合函数,如果不是聚合函数,就会变成
select count(0) from table ...
。
默认包含的聚合函数前缀如下:
/**
* 聚合函数,以下列函数开头的都认为是聚合函数
*/
private static final Set<String> AGGREGATE_FUNCTIONS = new HashSet<String>(Arrays.asList(
("APPROX_COUNT_DISTINCT," +
"ARRAY_AGG," +
"AVG," +
"BIT_" +
//"BIT_AND," +
//"BIT_OR," +
//"BIT_XOR," +
"BOOL_," +
//"BOOL_AND," +
//"BOOL_OR," +
"CHECKSUM_AGG," +
"COLLECT," +
"CORR," +
//"CORR_," +
//"CORRELATION," +
"COUNT," +
//"COUNT_BIG," +
"COVAR," +
//"COVAR_POP," +
//"COVAR_SAMP," +
//"COVARIANCE," +
//"COVARIANCE_SAMP," +
"CUME_DIST," +
"DENSE_RANK," +
"EVERY," +
"FIRST," +
"GROUP," +
//"GROUP_CONCAT," +
//"GROUP_ID," +
//"GROUPING," +
//"GROUPING," +
//"GROUPING_ID," +
"JSON_," +
//"JSON_AGG," +
//"JSON_ARRAYAGG," +
//"JSON_OBJECT_AGG," +
//"JSON_OBJECTAGG," +
//"JSONB_AGG," +
//"JSONB_OBJECT_AGG," +
"LAST," +
"LISTAGG," +
"MAX," +
"MEDIAN," +
"MIN," +
"PERCENT_," +
//"PERCENT_RANK," +
//"PERCENTILE_CONT," +
//"PERCENTILE_DISC," +
"RANK," +
"REGR_," +
"SELECTIVITY," +
"STATS_," +
//"STATS_BINOMIAL_TEST," +
//"STATS_CROSSTAB," +
//"STATS_F_TEST," +
//"STATS_KS_TEST," +
//"STATS_MODE," +
//"STATS_MW_TEST," +
//"STATS_ONE_WAY_ANOVA," +
//"STATS_T_TEST_*," +
//"STATS_WSR_TEST," +
"STD," +
//"STDDEV," +
//"STDDEV_POP," +
//"STDDEV_SAMP," +
//"STDDEV_SAMP," +
//"STDEV," +
//"STDEVP," +
"STRING_AGG," +
"SUM," +
"SYS_OP_ZONE_ID," +
"SYS_XMLAGG," +
"VAR," +
//"VAR_POP," +
//"VAR_SAMP," +
//"VARIANCE," +
//"VARIANCE_SAMP," +
//"VARP," +
"XMLAGG").split(",")));
5.1.5 - 2018-09-02
- Optimize the code and remove unnecessary checks(by lenosp)
- Solve the small problem of pageKey multi-processing once #268
- Added javadoc documentation on gitee(https://apidoc.gitee.com/free/Mybatis_PageHelper)
- Solve the problem of default reflection without cache fixed #275
- Optimizing mysql ifnull function causes paging performance problems (by miaogr)(This change was eventually changed to the following
aggregateFunctions
) - Jsqlparser has been upgraded to version 1.2, which is incompatible with 1.0 and has been resolved. fixed 273
- Remove the g(s)etFirstPage and g(s)etLastPage methods that are ambiguous in PageInfo
- Throws an exception that failed to parse when sorting fixed #257
- Resolve the initialization problem when there is no properties property when configuring the spring use
<bean>
. fixed #26 - Fix the problem that Oracle paging will leak data (by muyun12)
-
aggregateFunctions
: The default is the aggregate function of all common databases, allowing you to manually add aggregate functions ( affecting the number of rows ). All functions that start with aggregate functions will be wrap as subquery. Other functions and columns will be replaced with count(0).
After adding the aggregateFunctions
parameter, the biggest difference from the original is that if there is select ifnull(XXX,YY) from table ...
, the original count query is
select count(0) from (select ifnull(xxx,yy) from table ... ) temp_count
now distinguishes aggregate functions, if not aggregate functions, it will become
select count(0) from table ...
.
The aggregate function prefixes included by default are as the above code.