# `Sp_Bd_bi20_1_new` (procedure)

> 喷码+分切现场 稼动图


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

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sPlcNo` | `varchar(100)` |
| 2 | IN | `sBrId` | `varchar(100)` |
| 3 | IN | `sSuId` | `varchar(100)` |
| 4 | OUT | `sCode` | `int` |
| 5 | OUT | `sReturn` | `longtext` |

## Body

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

## Narrative

**Business context:** 喷码+分切现场 稼动图 — second-generation rewrite of `Sp_Bd_bi20_1`. Same intent (single-machine OEE gauge for the 喷码现场 kanban) with refined shift-window and reference-value handling.

**What it does:** Same overall logic as `Sp_Bd_bi20_1` — reads `elemachine`/`viw_plc_machine` for `iPlcNo=sPlcNo`, computes shift window via `FUN_GET_DATE_BC_STARTDATE_NEW`, aggregates `plc_machinedata.dProduceHour` per `sStatus` to derive 时间稼动率 / 速度稼动率 / 总稼动率, emits JSON gauge into `sReturn`. Adjusts the reference 标准值 baselines (`p_dStdTimeOee` / `p_dStdSpeedOee` / `p_dStdOee` / `p_dStdOeeQty`) and the day-quota / month-plan defaults (`p_dDayQty=8000`, `p_dMonthPlanQty=240000`).

**Invocation:** No form-master sSqlStr, no `gdsmodule` hook, no other-routine caller (other than as a comment-line reference in `_newZZT`), no `xly-src` script install path, no Java caller. Status: appears orphaned — superseded by `Sp_Bd_bi20_1_newZZT` which adds an `iType` switch. Candidate for maintainer audit.

Flag: catalog header `喷码+分切现场 稼动图` is identical to the `_1` and `_newZZT` siblings — only the body differs.
