# `Sp_elematerials_CheckUpdate` (procedure)

> 材料校验


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sGuid` | `varchar(100)` |
| 2 | IN | `sData` | `longtext` |
| 3 | IN | `sAllData` | `longtext` |
| 4 | IN | `sFormGuid` | `varchar(100)` |
| 5 | IN | `sLoginId` | `varchar(100)` |
| 6 | IN | `sBrId` | `varchar(100)` |
| 7 | IN | `sSuId` | `varchar(100)` |
| 8 | OUT | `sCode` | `int` |
| 9 | OUT | `sReturn` | `varchar(4000)` |

## Body

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

## Narrative

**Business context:** 材料校验 — pre-save guard meant to block any update or delete of an existing 物料 (elematerials) main-table row. Effectively a freeze: once a material exists, the row itself cannot be modified or removed. Bypassed when the editor has `sftlogininfo.bJurisdictionShow=1` (privileged role).

**What it does:** Reads `bJurisdictionShow` for the login; if 1, returns `sCode=1`. Otherwise walks `sAllData` to find the `elematerials` table block, then iterates its rows: any `handleType='update'` or `'del'` triggers `sReturn='材料主表不允许修改'`, `sCode=-8`, and exits.

**Invocation:** Status: appears orphaned. Not bound to any `gdsmodule.sSaveProName`/`sSaveProNameBefore`, no form-master reference, no other routine references it, and no xly-src reference. The naming convention matches the `Sp_<table>_CheckUpdate` pre-save validator slot — likely a tenant/override guard that was authored but never wired. Candidate for maintainer audit.
