oracle中,根據頁面分頁插件的參數,對SQL進行分頁查詢

public List<NewSystemPopUp> getNewSystemPopUp(Map<String, Object> map, User user, String status)
        throws BwdaException
    {
        String systemTitle = (String) map.get("systemTitle");
        map.put("status", status);
        
        String sql = "select rownum row_num, t.*  from T_NEWSYSTEM_POPUP t where 1=1 \r\n";

        String querySql =  "select * from ( \r\n";
               querySql += "      select rownum rn, n.*  from ( \r\n";
               querySql += sql;
               querySql += "    ) n \r\n";
               querySql += "    where rownum <= :endRow \r\n";
               querySql += ") m \r\n";
               querySql += "where m.rn >= :beginRow";
        logger.info(querySql);
        List<NewSystemPopUp> newSystemPopUpList  =  super.queryListBySql(NewSystemPopUp.class, querySql, map);
        return newSystemPopUpList;
    }

 

注意,map中已經事先put了endRow和beginRow的值在裏面

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章