# `Fun_GetListJson_ByName` (function)


- **Type:** FUNCTION
- **Returns:** `longtext`
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sJson` | `longtext` |
| 2 | IN | `sGetKey` | `varchar(100)` |

## Body

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

## Narrative

**Business context:** Named-parameter extractor for the standard `{sParamName, sParamValue}` JSON shape used to pickle MFT/scheduling/report run-time settings (`喷头个数`, `码样`, `喷码类型`, `走纸方向`, `印刷类型正面`, …). Given a JSON array and a name, returns the matching value.

**What it does:** iterates `sJson`, reads `$.sParamName` per element, compares to `sGetKey`; on match returns the stripped `$.sParamValue`. Returns `"未解析到Key"` on no match or invalid JSON.

**Invocation:** called from `Sp_GetMachineByApsRule` (APS machine-selection rule engine) and `Sp_Manufacture_ProductionPlanInfoTree_Base_TC` (production-plan info-tree builder, where it decodes the per-row `sReportParams` to populate `sReportParams1..N` display columns).
