# `Sp_Manufacture_ProductionPlanInfo` (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 | `sState` | `varchar(10)` |
| 4 | IN | `sBrId` | `varchar(100)` |
| 5 | IN | `sSuId` | `varchar(100)` |
| 6 | IN | `bFilter` | `varchar(5000)` |
| 7 | IN | `pageNum` | `int` |
| 8 | IN | `pageSize` | `int` |
| 9 | OUT | `totalCount` | `int` |
| 10 | IN | `countCloumn` | `varchar(5000)` |
| 11 | OUT | `countMapJson` | `longtext` |
| 12 | IN | `sFilterOrderBy` | `varchar(5000)` |
| 13 | IN | `sGroupby_select_sql` | `varchar(5000)` |
| 14 | IN | `sGroupby_group_sql` | `varchar(5000)` |

## Body

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

## Narrative

**Business context:** 生产管理 → 生产计划管理 → 生产排程 — header label "点击机台获取排程数据". Loads the per-machine 排程从表 list (the rows under the machine card) when the planner clicks a machine on the scheduling board. Anchor data-source of the 机台排程 view's middle pane.

**What it does:** Parses `bFilter` for `sMachineId`, `sProcessId`, `sWorkCenterId`, `sState`, `sId`, `tStartDate` (special-cases "所有"). Builds a temp set off `MftProductionPlanSlave` filtered by those facets and tenant, then projects the standard schedule columns (`sWorkOrderId`, `sCustomerId`, `sProductId`, `sProcessId`, `sMachineId`, qty/time fields, status flags) for the requested machine + state. Pages out via `bFilter` / `pageNum` / `pageSize` / `countMapJson` / `sGroupby_*`.

**Invocation:** Bound as data-source of 排程从表 / 从表分贴信息 / 机台班组信息 forms via `gdsconfigformmaster.sSqlStr` — `gfm.sId` `15813214130002729874796826202000`, `15813919750004894187658775812000`, `101251240115016110217766930`, `101251240115016110217770120`, `101251240115016221814786810`, `2022042422052580722848452054923`, `2022042422070075250247809950228`, etc. Also referenced by `WorkOrderPlanServiceImpl` and sister-routines `Sp_Manufacture_ProductionPlanInfoTree`, `..._TC`, `..._YH`, `..._YS`. Install scripts in `xly-src/script/标版/30100101/schedule/` plus customer overrides (远传, 千彩, 金宣发).
