# `Sp_OEE_SearchProductionReport` (procedure)

> 获取上报信息


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sLoginId` | `varchar(100)` |
| 2 | IN | `sMachineId` | `varchar(255)` |
| 3 | IN | `sBrId` | `varchar(100)` |
| 4 | IN | `sSuId` | `varchar(100)` |
| 5 | IN | `bFilter` | `varchar(5000)` |
| 6 | OUT | `sCode` | `int` |
| 7 | OUT | `sReturn` | `varchar(5000)` |

## Body

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

## Narrative

**Business context:** OEE management — quick lookup of the most recent 上报 (production-report) rows for a single machine. Returns up to 100 rows from `viw_mftproductionreport` sorted descending by `iIncrement`, intended for an OEE client to display "latest reports" against a chosen machine.

**What it does:** Translates the optional front-end `bFilter` via `Fun_bFilter_toWhere(... 'P')`, splices it into a dynamic `SELECT * FROM viw_mftproductionreport P WHERE P.sMachineId = <sMachineId> <filter> ORDER BY P.iIncrement DESC LIMIT 100`, and prepares/executes the statement. No writes.

**Invocation:** Status: appears orphaned. No caller found in any channel (form-master, gdsmodule hooks, other routines, xly-src grep across all extensions, dynamic-dispatch search) — candidate for maintainer audit. Body is small and self-contained; the COMMENT `获取上报信息` suggests it was authored for an OEE client widget that never shipped or has since been replaced.
