# `Fun_AnalysisListJson` (function)

> 根据 JSON字符串LIST类型解析函数


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `p_json` | `longtext` |
| 2 | IN | `cloumnNames` | `varchar(255)` |
| 3 | IN | `splitNames` | `varchar(10)` |

## Body

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

## Narrative

**Business context:** Flattens a JSON array of row objects into a delimited display string — the workhorse used by manufacturing-plan reports and work-order data-pack procs to render embedded detail lists (process steps, color sequences, parts lists) as a single column on a report row.

**What it does:** loops the `p_json` array. For each row, loops the comma-separated `cloumnNames` and extracts `$[i].column` via `JSON_EXTRACT`, stripping the JSON quotes. Each value gets the per-column suffix from `splitNames` (e.g., `+,+,*`); rows are joined by `,` unless `splitNames` is supplied (in which case rows are concatenated directly). Returns the original `p_json` untouched if input is empty or invalid.

**Invocation:** called from the MFT plan inserters (`Sp_Manufacture_InsertMftPlan`, `Sp_Manufacture_InsertMftPlanProcess`, `Sp_Manufacture_InsertMftPlanToErp`), the production-report check procs (`Sp_Check_mftProductionReportValue*`), the OEE reports (`Sp_OEE_ProductionReport*`), the work-order reports (`Sp_reportdata_WorkOrder*`), `Sp_WorkOrder_CalcDataPackProductStd`, and `Sp_WorkOpsOutProcess`.
