# `Sp_Do_ProcedurePageTree` (procedure) > 过程插入20条数据后,获取分组,分页条数 - **Type:** PROCEDURE - **Deterministic:** NO - **SQL data access:** CONTAINS SQL ## Parameters | # | Mode | Name | Type | |---|---|---|---| | 1 | IN | `p_sTmpTableName` | `varchar(1000)` | | 2 | IN | `p_sSumTableName` | `longtext` | | 3 | IN | `p_sTmpTableWhere` | `longtext` | | 4 | IN | `p_sLimit` | `varchar(500)` | | 5 | IN | `p_sTbNameBm` | `varchar(10)` | | 6 | IN | `countCloumn` | `varchar(5000)` | | 7 | IN | `p_sumCloumn` | `longtext` | | 8 | OUT | `totalCount` | `int` | | 9 | OUT | `countMapJson` | `longtext` | | 10 | OUT | `p_sSumSql` | `longtext` | ## Body _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_Do_ProcedurePageTree`'`._ ## Narrative **Business context:** Reporting infrastructure helper — the standard "page + total + column-sums" finisher invoked at the end of report procs that build their result-set inside a temporary table. Reports such as 销售管理 → 未发货明细 (`Sp_Sales_NotDeliverGoodList`), 生产管理 → 生产排程 (`Sp_Manufacture_ProductionArrange2`, `Sp_Manufacture_MftPlanPhase_product`) and 销售业绩 (`Sp_Sales_SalesAnalysiseOfSalesperson_copy1`) call it to honour the BACK grid's pagination, total-row and per-column aggregate UI. **What it does:** Given a base temp table (`p_sTmpTableName`), an optional `p_sSumTableName`, a `WHERE` clause, a `LIMIT` clause, a per-table-bm prefix, a comma-list of `countCloumn`s and a JSON map `p_sumCloumn` of override SQLs, it: (1) for each requested aggregate column either uses the override SQL (running it via prepared statement when it contains `@sum`) or falls back to `SUM(