# `Sp_OEE_ProductionReportAll` (procedure)

> OEE：上报列表所有任务


- **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_OEE_ProductionReportAll`'`._

## Narrative

**Business context:** OEE管理 → OEE本设备对应工序任务 — paged data source for the OEE production-reporting screen that lists every active process task (`mftproductionplanslave`) tied to a given machine, so operators can pick which task to log a 上报 (production report) against.

**What it does:** Builds a temporary `p_Tmp_ProductionReport` table mirroring the rich `mftproductionplanslave` column set (machine, work order, process, customer, plate-count, reserves, first-inspection times, etc.), runs the OEE process-permission filter from `SysSystemSettings.CkxProcessFilter` + `Fun_GetLookProcess`, applies `Fun_bFilter_toWhere` translation of the front-end `bFilter`, paginates by `pageNum`/`pageSize`, and selects the final set joined back to `eleprocess`, `elemachine`, etc. Filters keep only rows where `dProcessQty - dProductionReportQty > 0` and `sState = 2` (in-progress).

**Invocation:** Bound as the data-source of the OEE本设备对应工序任务 form `gfm.sId=101251240115016087809801980` via `gdsconfigformmaster.sSqlStr` — the report under OEE管理. Loaded when the OEE 上报 client opens the task list. Install script ships at `script/标版/30100101/schedule/Sp_OEE_ProductionReportAll.sql`.
