# `Sp_PlanListCTP_BtnRepair` (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_PlanListCTP_BtnRepair`'`._

## Narrative

**Business context:** 生产管理 → 计划、排程 → 计划列表 — repair/inline-edit handler for CTP-related columns on `mftproductionplanslave`. The 修补 (BtnRepair) family is the standard counterpart to BtnEventFinished: it lets the user back-fill or correct CTP fields after the row has already been touched, without going through the finished button again.

**What it does:** Mirrors the BtnEventFinished shape — parses `$.params[*].value[*].sId` and the JSON-encoded `$.changeValue.valueKey` (comma-list of column names) plus per-column values. Builds a dynamic `UPDATE mftproductionplanslave SET <field>=<val>, … WHERE sId IN (…)` from the typed values via `Sp_System_ReplaceField`. No qty/cost math — strict field-edit only. Validates `sProInParam` length; emits `sCode=-1` with the `paramsErro` localised message from `Sp_Sis_GetConst` on bad input.

**Invocation:** Dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` — bound to a CTP-related cell-edit / repair button on the 计划列表 grid. Install script: `script/标版/30100101/Sp_PlanListCTP_BtnRepair.sql`.
