code: private String buildPageSql(String sql, Page page) {
      if (page == null || dialect == null || dialect.equals("")) {
        return sql;
      }
      StringBuilder sb = new StringBuilder();
      int startRow = page.getOffset();
  
      if ("mysql".equals(dialect)) {
        sb.append(sql);
        sb.append(" limit ").append(startRow).append(",").append(page.getLimit());
      } else if ("hsqldb".equals(dialect)) {
        sb.append("select limit ");
        sb.append(startRow);
        sb.append(" ");
        sb.append(page.getLimit());
        sb.append(" ");
        sb.append(sql.substring(6));
      } else if ("oracle".equals(dialect)) {
        sb.append("select * from (select tmp_tb.*,ROWNUM row_id from (");
        sb.append(sql);
        sb.append(")  tmp_tb where ROWNUM<=");
        sb.append(startRow + page.getLimit());
        sb.append(") where row_id>");
        sb.append(startRow);
      } else {
        throw new IllegalArgumentException("SelectInterceptor error:does not support " + dialect);
      }
      return sb.toString();
    }
docs: 生成特定数据库的分页语句
  
  @param sql
  @param page
  @return