# `Sp_productionPlanInfo_BtnEventSuspend` (procedure)

> 机台计划：暂停


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sProInParam` | `varchar(10000)` |
| 2 | IN | `sMakePerson` | `varchar(100)` |
| 3 | IN | `sBrId` | `varchar(100)` |
| 4 | IN | `sSuId` | `varchar(100)` |
| 5 | OUT | `sReturn` | `varchar(1000)` |
| 6 | OUT | `sCode` | `int` |

## Body

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

## Narrative

**Business context:** 生产管理 → 生产计划管理 → 生产排程 — toolbar handler "机台计划：暂停" (pause) on `mftproductionplanslave`. Moves an active/released row to `sState=3` so the machine operator stops it and the planner can reshuffle without losing the row's machine binding.

**What it does:** Picks `slave`/`slaveInfo` list. Per dash-split `sId`: reads `bFrozen`, `sState`, `bLock`, `sMachineId`. Rejects frozen with `sProductionNoOperation`, locked with `sLockOrderWaitOperation`. If `sState` is 0, 5, or 3 rejects with `sPauseOnlyXd` ("only released or scheduled rows can be paused"). Otherwise `UPDATE mftproductionplanslave SET sState='3' WHERE sId=p_sIdOne AND tenant matches`. Collects the touched ids into `p_sUpdateIds`; the original OEE-notification block that would push a `sysmesmsg` to the machine is commented out.

**Invocation:** Dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — 生产排程 form's "暂停" button. Inverse: `Sp_productionPlanInfo_BtnEventResume`. xly-src ships `script/标版/30100101/schedule/Sp_productionPlanInfo_BtnEventSuspend.sql`.
