# `Sp_productionplan_ControlProcess1` (procedure)


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sLoginId` | `varchar(100)` |
| 2 | IN | `sState` | `varchar(10)` |
| 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` | `varchar(5000)` |
| 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_productionplan_ControlProcess1`'`._

## Narrative

**Business context:** 生产计划管理 → 生管主计划 — paged "control-process" variant. Comment: 跌装饼形图数据 — built for a stacked pie/bar chart that breaks down 生产主计划 rows by 工作中心 and reports each work-center's load (hours, qty, 已下达 vs 已排程 ratio). Uses the `Sp_Outstanding_Query` paging contract.

**What it does:** Reads `SysSystemSettings.CkxXd` (工序是否直接下达). Builds `Productionplan_ControlProcess_Tmp` and `INSERT INTO` from a base SELECT over what looks like an `mftproductionplan` join, labelling each row as '已下达' or '已排程' depending on `dProductionQty` and the `CkxXd` flag. The full implementation hands the dynamic SQL to `Sp_Outstanding_Query` for paging + `bFilter` splice + `totalCount`/`countMapJson` aggregation.

**Invocation:** Numeric-suffix variant of `Sp_productionplan_ControlProcess`. No xly-src grep hit and no chart binding in `gdsconfigcharmaster`/`gdsconfigcharmaster0302` — Status: appears orphaned. Candidate for maintainer audit; the live ControlProcess path runs through `Sp_productionplan_ControlProcessNew` via `WorkOrderPlanServiceImpl.getControlProcessList(...)`.
