# `FUN_GET_DECOMPOSECUSTOMIZE` (function)

> 排程印面自定义


- **Type:** FUNCTION
- **Returns:** `varchar(255)`
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `p_titleEnd` | `varchar(50)` |
| 2 | IN | `p_sFaceName` | `varchar(50)` |
| 3 | IN | `p_sControlFaceName` | `longtext` |
| 4 | IN | `p_index` | `int` |
| 5 | IN | `p_iArrangeSrcValue` | `int` |

## Body

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

## Narrative

**Business context:** 生产排程 → 生产计划管理 → 生产管理 — when an MftPlan (生产工单 / production plan) row is being inserted and the work-order's "印面" (sheet face) is configured with a custom 分拆 (decomposition) scheme — by 贴数 (signature count) or 折页贴数 (folding signatures) — this function resolves the per-index face-name string the slave row should carry.

**What it does:** if no control-face-name input is provided, returns the plain `p_sFaceName`. If `p_iArrangeSrcValue` is 3 (按贴) or 4 (按折页贴), reads `sControlFaceName_tmp.sControlFacesChar` for the supplied `iIndex` and concatenates with `p_titleEnd` (正/反 marker). Otherwise returns the original control-face-name unchanged. Other 分拆 modes (1 无需分拆, 2 按印版付数, 5 按装订贴数, 6 按书刊贴数, 7 按实际米数) take the no-op path.

**Invocation:** called from `Sp_Manufacture_InsertMftPlanSlave` while it splits a slave plan row into per-signature instances. Sp_Manufacture_InsertMftPlan* chain is invoked by the production-plan generation flow (排程 module). No direct form-master or gdsmodule hook reference.
