# `Sp_Manufacture_ProductionPlanInfo_WorkCenter` (procedure)

> 机台排程：排程获取机台（小卡片）


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sLoginId` | `varchar(100)` |
| 2 | IN | `sWorkCenterId` | `varchar(100)` |
| 3 | IN | `sBrId` | `varchar(100)` |
| 4 | IN | `sSuId` | `varchar(100)` |
| 5 | IN | `bFilter` | `varchar(5000)` |
| 6 | IN | `pageNum` | `int` |
| 7 | IN | `pageSize` | `int` |
| 8 | OUT | `totalCount` | `int` |
| 9 | IN | `countCloumn` | `varchar(5000)` |
| 10 | OUT | `countMapJson` | `longtext` |
| 11 | IN | `sFilterOrderBy` | `varchar(5000)` |
| 12 | IN | `sGroupby_select_sql` | `varchar(5000)` |
| 13 | 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_WorkCenter`'`._

## Narrative

**Business context:** 生产管理 → 生产计划管理 → 生产排程 — header label 机台排程：排程获取机台（小卡片）. Drives the 顶部机台卡片 (top machine-card strip) and 机台班组信息 (machine/team panel) on the scheduling board: one card per machine inside the selected 工作中心, with workload aggregates (planned hours, "全部 / 未排" buckets, dispatched).

**What it does:** Builds temp `p_TmpWorkCenter` for the chosen `sWorkCenterId`, populating one row per machine plus the synthetic "全部" / "未排" buckets. Filters `mftproductionplanslave` by `sWorkCenterId` and tenant, joins `elemachine` for machine names. Honours user-permission flags (`p_iProcessFilter`, `p_iViewAllMachine`, `p_sSuper`, `p_sUserId`, `p_sProcessFilter`). Selects each card with a synthetic `sId` like `<type>_<machineId>_<tStartDate>` (special-cases 全部/未排/null) and the per-card `dHour`. Pages out through `bFilter` / `pageNum` / `pageSize` / `countMapJson` / `sGroupby_*`.

**Invocation:** Bound as data-source of 机台班组信息 / 顶部机台卡片 forms via `gdsconfigformmaster.sSqlStr` — `gfm.sId` `15812505560004852289206660178000`, `101251240115016110217766080`, `101251240115016221814783730`, `2022042422052548412969553934358`, `2022042422070056807157450658649` (multi-process scheduler variants). Loaded when the user opens the 生产排程 board. Install scripts in `xly-src/script/标版/30100101/schedule/` and `xly-src/script/标版/20210323/gdsconfigformmaster.sql` (the form-binding seed).
