# `Sp_Mes_EventReportOld` (procedure)

> mes-异常事件提报


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sMachineGuid` | `varchar(100)` |
| 2 | IN | `sTeamGuid` | `varchar(100)` |
| 3 | IN | `sShift` | `varchar(5)` |
| 4 | IN | `sBrId` | `varchar(100)` |
| 5 | IN | `sSuId` | `varchar(100)` |
| 6 | IN | `sMakePerson` | `varchar(100)` |
| 7 | OUT | `sReturn` | `longtext` |
| 8 | OUT | `sCode` | `int` |

## Body

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

## Narrative

**Business context:** Prior version of `Sp_Mes_EventReport` (same signature, same mes-异常事件提报 contract) kept under the `Old` suffix during the proc refresh. Per wiki convention, `*Old` objects are not narrated in depth — see `Sp_Mes_EventReport.md` for what the current body does.

**What it does:** Same shape as the current `Sp_Mes_EventReport` at the time of copy: derives the current shift window from `elemachine`, finds the most recent `mftproductionreportslave.tEndDate` (or earliest `plc_machinedata.tStartDate`) and returns the matching slave rows for the operator to annotate. Read-only.

**Invocation:** Status: appears orphaned. No `gdsmodule` hook, no form-master reference, no proc caller, no xly-src hit. Not expected to be called from production — kept as a rollback target. Verify before relying on it; the live path uses `Sp_Mes_EventReport` or its successor.
