oracle Group by 分組查詢后,分頁


public Map getInWareHouseReport(int i, int j, InWareHouse inWareHouse) {
        //查詢分組后總條數
        String countquery="select WS_SKU_ID,sum(IN_NUMBER),sum(WH_MONEY) from IN_WAREHOUSE p group by WS_SKU_ID";
        //計算結束行
        int m=i+j;
        //分組分頁查詢
        String sqlString="select * from

(SELECT rownum as rn, a.* FROM (select WS_SKU_ID,sum(IN_NUMBER),sum(WH_MONEY) from IN_WAREHOUSE p group by WS_SKU_ID ) a)

where rn>"+i+" and rn<="+m+"";


        List trList = this.excuteSql(sqlString, "inreport");
        List clist = this.excuteSql(countquery, "count");
        int totalProperty = clist.size();
        Map map = new HashMap();
        map.put(TOTAL_PROPERTY, totalProperty);
        map.put(BUSI_LIST, trList);
        return map;
    }


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM