# `Sp_Manufacture_ProductionPlanInfoTree_Base` (procedure)

> 点击机台获取排程数据(树形结构带不固定查询)


- **Type:** PROCEDURE
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sFlag` | `varchar(225)` |
| 2 | IN | `sLoginId` | `varchar(100)` |
| 3 | IN | `iBillOutside` | `int` |
| 4 | IN | `sState` | `varchar(10)` |
| 5 | IN | `sBrId` | `varchar(100)` |
| 6 | IN | `sSuId` | `varchar(100)` |
| 7 | IN | `bFilter` | `varchar(5000)` |
| 8 | IN | `pageNum` | `int` |
| 9 | IN | `pageSize` | `int` |
| 10 | OUT | `totalCount` | `int` |
| 11 | IN | `countCloumn` | `varchar(5000)` |
| 12 | OUT | `countMapJson` | `longtext` |
| 13 | IN | `sFilterOrderBy` | `varchar(5000)` |
| 14 | IN | `sGroupby_select_sql` | `varchar(5000)` |
| 15 | IN | `sGroupby_group_sql` | `varchar(5000)` |
| 16 | IN | `sTypeSear` | `varchar(225)` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_Manufacture_ProductionPlanInfoTree_Base`'`._

## Narrative

**Business context:** 生产管理 → 生产计划管理 → 生产排程(Tree) — shared base for the production-scheduling tree-grid. `sTypeSear` selects the dialect: `'TREE'` for the generic 排程(Tree) form. `_YH` (印后) and `_YS` (印刷) variants delegate here too in older deployments, though the current `Sp_Manufacture_ProductionPlanInfoTree_YH/_YS` actually call the `_TC` companion — see those pages.

**What it does:** Materialises `MftProductionPlanSlave_Tmp` and `MftProductionPlanSlave_Tmp_div` from `MftProductionPlanSlave`, joins with `eleprocess` to attach the prior-process name, and refines per-machine ordering with window-style row numbering (`@ROWNUM`, `@GROUP_NAME`). Then funnels the result through the outstanding-query helper for paging, `countCloumn`/`countMapJson` footer totals, and `bFilter` splicing. ~14K body — see `SHOW CREATE PROCEDURE`.

**Invocation:** Reached indirectly: dispatched by `Sp_Manufacture_ProductionPlanInfoTree` (the form-master entry) and historically by `_TC`/`_YH`/`_YS`. No direct form-master binding, no `gdsmodule` hook, no Java caller. Shipped as `script/标版/30100101/schedule/Sp_Manufacture_ProductionPlanInfoTree_Base.sql`.
