# `Sp_Bd_Cqzy_workshop1` (procedure)

> 车间效率综合看板-根


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

## Narrative

**Business context:** 车间效率综合看板-根 — root/composite 车间效率 (workshop efficiency) overview board. Acts as the top-level dashboard tile for the Cqzy (车间综合 / workshop-综合) family `Sp_Bd_Cqzy_workshop1..6` — the earlier evolution of the cq_workshop / bi20-24 family.

**What it does:** Hardcodes a 6-row `p_Bd_PlcNo_No(iPlcNo,iNo)` map for PLCs `1, 2, 3, 4, 6, 7`, then per-PLC reads `elemachine`/`plc_currentmachinevalue`/`mft_workorder*` to assemble per-machine 当前状态/工单/产量/调机时间 rows into `p_Bd_workshop1`, emits a JSON board into `sReturn`.

**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_Bd_Cqzy_workshop1.sql`. No form-master sSqlStr, no `gdsmodule` hook, no Java caller. Status: reachable only via an external dashboard HTTP endpoint that invokes the proc by name.

Flag: PLC literals tenant-deployment-specific; the Cqzy_workshop2/3/5/6 carry `封存` (sealed) markers — workshop1 likely the only one still active.
