# `Sp_Manufacture_ProductionPlanInfo_WorkCenter1` (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_WorkCenter1`'`._

## Narrative

**Business context:** 生产管理 → 生产计划管理 → 生产排程 — earlier / variant version of `Sp_Manufacture_ProductionPlanInfo_WorkCenter` (the 机台排程 顶部机台卡片 data-source). Same signature; the body is a leaner build that groups by 工序 first (`eleprocess.sProcessName`) rather than by 机台 — likely the predecessor before the unified WorkCenter rewrite.

**What it does:** Builds temp `p_TmpWorkCenter` with three buckets per `sWorkCenterId`: `iOrder=0` "全部单据" placeholder, `iOrder=1` "未排" (per `eleprocess`, summing `mftproductionplanslave.dHour` where `sState=0`), `iOrder=2` "所有" per machine (joining `elemachine`, summing scheduled hours / 60). Filters by `sWorkCenterId` when provided. Pages out via `bFilter` / `pageNum` / `pageSize` / `countMapJson`.

**Invocation:** Referenced only by `xly-src/script/标版/20210323/gdsconfigformmaster.sql` — the 2021-03 form-binding seed listing the form-master rows that *used* to point at this proc. The live `gdsconfigformmaster` snapshot no longer binds it (current 机台班组信息 forms target `Sp_Manufacture_ProductionPlanInfo_WorkCenter` instead). Status: appears retired in favour of the canonical WorkCenter proc; candidate for maintainer audit before deleting.
