# `Sp_Bd_bi20_hh` (procedure)

> @author:zhucx
							@date:20220111 
							@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_bi20_hh`'`._

## Narrative

**Business context:** 糊盒现场 workshop dashboard (kanban) — `_hh` (糊盒/hu-he, carton-gluing) fork of `Sp_Bd_bi20`. Despite the header saying `喷码+分切现场` (copy-pasted from sibling), the body's PLC list (`34,33,32,30`) targets 糊盒 machines per `elemachine.iPlcNo`. Returns the per-machine current-shift status block for the 糊盒现场 kanban page.

**What it does:** Same shape as `Sp_Bd_bi20` (喷码 sibling) — seeds `p_Bd_PlcNo_No(iPlcNo,iNo)` with `(34,1),(33,2),(32,3),(30,4)`, cursor-iterates per machine, reads current 工单号/班组/状态 from `viw_plc_machine`, computes 实际/标准/偏差 调机时间 + 完成版数/模数 from `plc_machinedata`, aggregates into `p_Bd_workshop5` and emits a `{"data":[...]}` JSON.

**Invocation:** No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no `xly-src` script install path, no Java caller. Status: appears orphaned — the live 糊盒现场 kanban presumably calls `Sp_Bd_bi23-糊盒现场.sql` from the canonical kanban folder; `_hh` is likely a fork-named scratch variant. Candidate for maintainer audit.

Flag: catalog header `喷码+分切现场` was copy-pasted from `Sp_Bd_bi20` and not updated for the 糊盒 PLC list — doc-vs-body mismatch.
