# `Fun_GetListJson_ByKey2` (function)


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

## Parameters

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

## Body

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

## Narrative

**Business context:** Near-duplicate of `Fun_GetListJson_ByKey1` — same hard-coded `$.sParamKey` lookup, same return-on-match logic. The only difference is the commented-out `Else` branch is removed in this version. Used in the same production-report and work-order data-pack procs that consume JSON parameter lists.

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

**Invocation:** called from `Sp_Check_mftProductionReportValue`, `Sp_Check_mftProductionReportValueTest`, `Sp_OEE_ProductionReportAll`, `Sp_WorkOrder_CalcDataPackProductStd`.
