# `Sp_Manufacture_ProductionPlanInfoTree_Base_TC` (procedure)

> 点击机台获取排程数据(树形结构带不固定查询)


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sFlag` | `varchar(225)` |
| 2 | IN | `sLoginId` | `varchar(100)` |
| 3 | IN | `iBillOutside` | `int` |
| 4 | IN | `sState` | `varchar(10)` |
| 5 | IN | `sBrId` | `varchar(100)` |
| 6 | IN | `sSuId` | `varchar(100)` |
| 7 | IN | `bFilter` | `varchar(5000)` |
| 8 | IN | `pageNum` | `int` |
| 9 | IN | `pageSize` | `int` |
| 10 | OUT | `totalCount` | `int` |
| 11 | IN | `countCloumn` | `varchar(5000)` |
| 12 | OUT | `countMapJson` | `longtext` |
| 13 | IN | `sFilterOrderBy` | `varchar(5000)` |
| 14 | IN | `sGroupby_select_sql` | `varchar(5000)` |
| 15 | IN | `sGroupby_group_sql` | `varchar(5000)` |
| 16 | IN | `sTypeSear` | `varchar(225)` |

## Body

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

## Narrative

**Business context:** 生产管理 → 生产计划管理 → 印刷日计划 / 印后日计划 — `TC` ("套餐"/typed-card) base for the production-tree variants used by the dated 印刷日计划 and 印后日计划 boards. Dispatched into with `sTypeSear` in `{'TC','YH','YS'}` so a single body serves three look-alike boards.

**What it does:** Larger sibling of `_Tree_Base` (~30K body). Same scratch-table pipeline — `MftProductionPlanSlave_Tmp` / `MftProductionPlanSlave_Tmp_div` materialised from `MftProductionPlanSlave`, joined with `eleprocess` and overlaid with `mftproductionplanslavelock` to flag locked rows. Adds material-status filtering (`bYs=0 WHERE LOCATE('未核实', sMaterialsStatus)>0`) for the 印刷/印后 dialects. Final result goes through the outstanding-query helper for paging/totals.

**Invocation:** Reached indirectly: `Sp_Manufacture_ProductionPlanInfoTree_TC`, `_YH`, and `_YS` each `CALL` this proc with their tag (`sFlag`/`'YH'`/`'YS'`). Each of those is the `sSqlStr` of a different form — 生产排程(Tree), 印后日计划 form `2022042422070062930346682786757`, 印刷日计划 form `2022042422052518162677975419910`. No direct form-master binding for the `_Base_TC` proc itself.
