# `Sp_Bd_cq_workshop_pm` (procedure)

> @author:zhucx
							@date:20211224 
							@describe: 喷码车间


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `iFlag` | `int` |
| 2 | IN | `iTmpCheck` | `int` |
| 3 | IN | `sFormGuid` | `varchar(100)` |
| 4 | IN | `sGuid` | `varchar(100)` |
| 5 | IN | `sLoginId` | `varchar(100)` |
| 6 | OUT | `sReturn` | `varchar(4000)` |
| 7 | IN | `sBrId` | `varchar(100)` |
| 8 | IN | `sSuId` | `varchar(100)` |
| 9 | OUT | `sCode` | `int` |

## Body

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

## Narrative

**Business context:** 喷码车间 — workshop-wide 车间看板 for the 喷码 (code-printing) line, covering 6 PLCs `48-53`. Predecessor of the narrower 4-tile `Sp_Bd_bi20` 喷码现场 board.

**What it does:** Hardcodes a 6-row `p_Bd_PlcNo_No(iPlcNo,iNo)` map for the 喷码 cluster, then per-PLC reads `elemachine`/`plc_currentmachinevalue`/`mft_workorder*` to assemble per-machine 当前状态/当前工单号/已生产数量/调机时间 rows into `p_Bd_workshop5`, emits a JSON board into `sReturn`.

**Invocation:** No form-master sSqlStr, no `gdsmodule` hook, no install script under `xly-src/script/` for this proc. Status: reachable only via an external dashboard HTTP endpoint that invokes the proc by name.

Flag: PLC literals `48-53` tenant-deployment-specific; header `-- call Sp_Bd_cq_workshop_mt(...)` is copy-pasted from the family root.
