# `Sp_productionMainPlan_batchupdatememo` (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_productionMainPlan_batchupdatememo`'`._

## Narrative

**Business context:** 生产管理 / 主计划 / 机台数据 — grid batch-update handler on `plc_machinedata` (machine PLC abnormal records). The dispatcher/scheduler selects rows on the machine-status grid, edits the abnormal-memo textarea and any inline cell, then this proc applies the same `sAbnormalMemo` plus inline edits to every selected row in one shot. Despite the `productionMainPlan_` prefix the target table is `plc_machinedata`, not `mftproductionplan` — the prefix reflects the host module page, not the table.

**What it does:** Parses `$.params` (selected row sIds) and `$.changeValue` (`textareaValue` + per-column edits keyed by `valueKey`). Walks `valueKey` to splice a dynamic `SET col1=$[0].col1, col2=...` clause, then appends `sAbnormalMemo=<textareaValue>`. For each `sId`, `PREPARE` + `EXECUTE` an `Update plc_machinedata Set ... Where sId=? AND sBrandsId=? AND sSubsidiaryId=?`. Returns `paramsErro` localised error if `sProInParam` < 5 chars.

**Invocation:** Standard `Sp_<Module>_BtnEvent*` slot — dispatched by `GenericProcedureCallServiceImpl.doGenericProcedureCall()`. No form-master, gdsmodule hook, other-proc reference, or xly-src script — name appears only on the live `xlyweberp_saas_ai` instance and on the frontend button definition. Audit candidate: confirm the button still exists in the deployed UI.
