# `Sp_bd_MachinePlanTemplate_4` (procedure)

> @author:zhucx
							@date:20210621 封存
							@describe: 看板管理-单机设备看板(1屏) 对应commonAuto/QCZH1 下 本班时间分析展示


- **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` | `varchar(5000)` |

## Body

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

## Narrative

**Business context:** 看板管理 / 单机设备看板(1屏) (front-end template `commonAuto/QCZH1`). The "本班时间分析展示" tile — current-shift time-breakdown pie for one PLC machine, parallel to `Sp_bd_MachinePlanStatus` but team-bound. Author tagged `封存` 2021-06-21.

**What it does:** Resolves the machine (`elemachine.iPlcNo=sPlcNo`) and current team (`eleteam.sTeamNo` joined to `viw_plc_machine.sPlcsStatusValue` where `sPlcsStatusName='当前班组'`), derives the current `sWorkType` from `sOffWork`/`sShiftsWork`, then aggregates `plc_machinedata.dProduceHour/3600` by `sStatus` for this team's current shift and emits a labelled time-breakdown JSON pie.

**Invocation:** No install script for this exact name under `xly-src/script/标版/30100101/`, no form-master sSqlStr, no `gdsmodule` hook, no other-routine caller, no Java caller. Status: appears orphaned. No caller found in any channel — candidate for maintainer audit. Marked `封存` (sealed) 2021-06-21; reachable only by a tenant-baked external dashboard endpoint.
