# `Sp_Bd_Root_allstatus` (procedure)

> @author:zhucx
							@date:20210620 封存
							@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_Root_allstatus`'`._

## Narrative

**Business context:** 看板管理 / 数字工厂状态看板 — top-of-board status summary covering environment readings and today's supply-chain totals. Author tagged `封存` 2021-06-20.

**What it does:** Pulls 1区 temperature/humidity from `viw_plc_machine` (`iPlcNo = 27`), then overwrites with simulated readings for 上海/重庆 (random values around 20°C/25°C and 50%/55%), and appends today's count + 万元 totals for `viw_salsalesorder` and `viw_purpurchaseorder` (`bCheck=1` and `tcreateDate = today`). Returns `p_Root_allstatus(sName,sValue)` directly to the renderer.

**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_Bd_Root_allstatus.sql`. No form-master, no `gdsmodule` hook, no Java caller. Other DB references are siblings `Sp_Bd_Root_allstatus25`/`25_new`/`26` — none call it. Reached only by an external dashboard HTTP endpoint. Marked `封存` (sealed); the mixed "真实数据" + "模拟数据" inserts mean the live readings are immediately overwritten by the random fallbacks — verify before relying on it.
