Closed yccool closed 5 years ago
PageHelper.startPage(pageNo, pageSize,"CC.CodeID"); System.out.println(">>>>>>>>>>"+pageNo); List<Map<String, Object>> list = clinicDetailMapper.selectClinic(area1, area2, clinicName, clinicAddress,gpsLat,gpsLng); PageInfo<Map<String, Object>> page = new PageInfo<Map<String, Object>>(list); return page;
springboot2.1.1, sqlserver2012, eclipse
==> 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);
select * from xxx where xxx = xxx
select * from xxx where xxx = xxx limit 10
异常信息放在这里
详细说明,尽可能提供(伪)代码示例。
是配置的问题,我把pagehelper.reasonable=true了
异常模板
PageHelper.startPage(pageNo, pageSize,"CC.CodeID"); System.out.println(">>>>>>>>>>"+pageNo); List<Map<String, Object>> list = clinicDetailMapper.selectClinic(area1, area2, clinicName, clinicAddress,gpsLat,gpsLng); PageInfo<Map<String, Object>> page = new PageInfo<Map<String, Object>>(list); return page;
使用环境
springboot2.1.1, sqlserver2012, eclipse
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,导致我用于查询到第一页
原 SQL
期望的结果:
完整异常信息
其他类型的错误
功能建议
详细说明,尽可能提供(伪)代码示例。