PageHelper 分页 倒序排列

 public ReturnJson selectPage(Integer pageNum, Integer pageSize, ZyBook zyBook) {
        String orderBy = "create_time  desc nulls last";//按照排序字段 倒序 排序
        PageHelper.startPage(pageNum,pageSize,orderBy);
        List books = mapper.selectList(zyBook);
        PageInfo pageInfo = new PageInfo<>(books);

        return ReturnJson.success(pageInfo.getTotal(),pageInfo.getList());
    }

你可能感兴趣的:(postgreSQL)