# `Sp_Manufacture_ProductionPlanInfo_gant` (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 | `sState` | `varchar(10)` |
| 4 | IN | `sBrId` | `varchar(100)` |
| 5 | IN | `sSuId` | `varchar(100)` |
| 6 | IN | `bFilter` | `varchar(5000)` |
| 7 | IN | `pageNum` | `int` |
| 8 | IN | `pageSize` | `int` |
| 9 | OUT | `totalCount` | `int` |
| 10 | IN | `countCloumn` | `varchar(5000)` |
| 11 | OUT | `countMapJson` | `longtext` |
| 12 | IN | `sFilterOrderBy` | `varchar(5000)` |
| 13 | IN | `sGroupby_select_sql` | `varchar(5000)` |
| 14 | IN | `sGroupby_group_sql` | `varchar(5000)` |

## Body

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

## Narrative

**Business context:** 生产管理 → 生产计划管理 → 生产计划甘特图 — Gantt-flavour data-source for the 排程 board. Same signature as `Sp_Manufacture_ProductionPlanInfo` (`sFlag`, `sLoginId`, `sState`, `bFilter`, paging block) and same `bFilter` machine/process/state parsing logic, but groups the rows by `sSrcNo` and iterates them by cursor — the shape the Gantt component needs (one bar per source order across machines).

**What it does:** Parses `bFilter` to pull out `sMachineId`, `sProcessId`, `sWorkCenterId`, `sState`, `sId`, `tStartDate`. Builds temp `ptable_PlanInfo` from `MftProductionPlanSlave` for the matching machine/process and state, then opens cursor `Cur_row` over `SELECT DISTINCT(sSrcNo) FROM ptable_PlanInfo ORDER BY iIncrement` and per-source aggregates `dConter`, `dAdjustConter`, `dAdjustHour`, `dAbnormalHour`, `dHour`. Pages out via the standard `pageNum` / `pageSize` / `totalCount` / `countMapJson` block.

**Invocation:** No `gdsconfigformmaster.sSqlStr` row in the live snapshot binds it, no other routine references it, no xly-src caller found. Status: appears orphaned in this DB — the 生产计划甘特图 form `gfm.sId=101251240115016111296520860` currently binds `Sp_Manufacture_ProductionArrange2` instead. Looks like an earlier Gantt-specific implementation that was retired in favour of the unified Arrange2 path; candidate for maintainer audit.
