# `Sp_Manufacture_Report` (procedure)


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `iState` | `int` |
| 2 | IN | `sLoginId` | `varchar(100)` |
| 3 | IN | `sMachineId_s` | `varchar(100)` |
| 4 | IN | `sProceeAllMachine` | `varchar(10)` |
| 5 | IN | `sSuId` | `varchar(100)` |
| 6 | IN | `sBrId` | `varchar(100)` |
| 7 | IN | `bFilter` | `longtext` |
| 8 | IN | `sUnTaskFormId` | `varchar(100)` |
| 9 | IN | `pageNum` | `int` |
| 10 | IN | `pageSize` | `int` |
| 11 | OUT | `totalCount` | `int` |
| 12 | IN | `countCloumn` | `varchar(5000)` |
| 13 | OUT | `countMapJson` | `longtext` |
| 14 | IN | `sFilterOrderBy` | `varchar(5000)` |
| 15 | IN | `sGroupby_select_sql` | `varchar(5000)` |
| 16 | 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_Report`'`._

## Narrative

**Business context:** 生产管理 — predecessor of `Sp_Manufacture_ProductionReport` (same parameter list, almost identical body but with many sections commented out). Was the data source for the production-report grid before the live `Sp_Manufacture_ProductionReport` superseded it.

**What it does:** Same shape as `Sp_Manufacture_ProductionReport` — populates `p_Tmp_ProductionReport` from `mftworkordermaster` and `eleprocessmachine`, with reject/quality columns from `SalRejectGoodsSlave`. Most update steps that exist in `ProductionReport` are commented out here (`-- update p_Tmp_ProductionReport`), so this version essentially seeds the scratch table without the enrichment passes. ~25K body, mostly comments.

**Invocation:** No form-master binding in `gdsconfigformmaster` matches this proc directly — the three forms that used the literal `Sp_Manufacture_Report` token (per `script/标版/20210323/gdsconfigformmaster.sql`) now bind `Sp_Manufacture_ProductionReport`. No `gdsmodule` hook, no other-routine caller. Status: appears orphaned — superseded by `Sp_Manufacture_ProductionReport`. The sibling `Sp_Manufacture_ReportProgress` (`机台计划，主计划：工序进度查看`) is a different proc and is still bound to 生产进度(弹窗). Candidate for maintainer cleanup.
