# `Sp_bi_workshop_3` (procedure)

> @author:zhucx
							@date:20211224 
							@describe: 印刷车间


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sBrId` | `varchar(100)` |
| 2 | IN | `sSuId` | `varchar(100)` |

## Body

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

## Narrative

**Business context:** BI / 印刷车间 — variant of `Sp_bi_workshop_1` (same header `@describe: 印刷车间`, `@author:zhucx 20211224`). Builds the same per-machine printing-shop dashboard snapshot into `p_Bd_workshop`, with a slightly different ordering or selection logic.

**What it does:** Same shape as `Sp_bi_workshop_1`: pulls from `plc_machinedata`, `plc_machinedata_status`, `plc_oeeupdate`, `mftproducereportmachinestate`, `mftproductionplanslave`, `mftproductionreportslave`, and `viw_plc_machine` into `p_Bd_workshop` / `p_Bd_PlcNo_No`. The header comments and internal calls match `_1`, including a self-reference `call Sp_bi_workshop_1('1111111111','1111111111');` in commented-out test code.

**Invocation:** Status: appears orphaned. Only DB reference is `Sp_bi_workshop_3` itself; no caller (form-master, gdsmodule, other routines, xly-src). Likely a newer/forked variant of `_1` for a specific BI screen, called directly from outside the ERP stack. Candidate for maintainer audit — verify whether `_1` or `_3` is the canonical one for the printing-shop dashboard.
