springboot 使用 PageHelper 进行分页报错 :无法自动获取数据库类型,请通过 helperDialect 参数指定!

配置文件

图片说明

if (StringUtils.isNotBlank(key)) {
            criteria.andLike("channelName", "%" + key + "%");
        }
        PageHelper.startPage(page, rows);
        List<FrontChannel> frontChannels = this.channelMapper.selectByExample(example);

图片说明

需要添加以下配置:

PageHelper分页插件

pagehelper:
helperDialect: oracle
reasonable: true
supportMethodsArguments: true
params: count=countSql

pagehelper:
  helperDialect: mysql

你这个是达梦数据库?不是常规数据库可能无法识别,可以试试指定为mysql试试,这个分页插件只不过是在原有的sql后面增加limit因为问题不大