pagehelper / Mybatis-PageHelper

Mybatis通用分页插件
https://mybatis.io
MIT License
12.21k stars 3.13k forks source link

springboot最新版本pagehelper-spring-boot-starter 1.2.12 分页错误 #419

Closed yccool closed 5 years ago

yccool commented 5 years ago

SQL 解析错误

==> Preparing: SELECT A1.CodeDesc AS AreaLevel1, A2.CodeDesc AS AreaLevel2, CC.CodeDesc AS ClinicName, CC.IsDisplay, CC.Status, CD.WorkStartWeekDay, CD.WorkEndWeekDay, CD.WorkStartTime, CD.WorkEndTime, CD.WorkTimeRemark, CD.ContactTel, CD.Address, CD.Introduce, CD.TotalOrderCount, CD.Logo, CC.CodeID AS ClinicID, CC.ShowInSite, A1.CodeID AS area1, A2.CodeID AS area2, cd.Lat, cd.Lng, dbo.UDF_Util_GetDistance(?, ?, cd.Lat, cd.Lng) AS distance FROM Code_Clinic CC WITH(NOLOCK) INNER JOIN Clinic_Detail CD WITH(NOLOCK) ON CC.CodeID = CD.ClinicID INNER JOIN Code_Area A1 WITH(NOLOCK) ON CD.AreaLevel1ID = A1.CodeID INNER JOIN Code_Area A2 WITH(NOLOCK) ON CD.AreaLevel2ID = A2.CodeID WHERE CC.IsDisplay = 1 AND CC.Status = 'A' AND CC.ShowInSite = 1 AND CD.Address LIKE '%' + ? + '%' order by CC.CodeID OFFSET ? ROWS FETCH NEXT ? ROWS ONLY ==> Parameters: 22.502703(BigDecimal), 114.127960(BigDecimal), 紅磡(String), 0(Integer), 10(Integer)

分页参数

pageSize 我不管填写几,最后输出的sql语句永远参数0,导致我用于查询到第一页

PageHelper.startPage(1, 10);
xxMapper.select(model);

原 SQL

select * from xxx where xxx = xxx

期望的结果:

select * from xxx where xxx = xxx limit 10

完整异常信息

异常信息放在这里

其他类型的错误

功能建议

详细说明,尽可能提供(伪)代码示例。

yccool commented 5 years ago

是配置的问题,我把pagehelper.reasonable=true了