# `Sp_Bd_Root_allstatus_3` (procedure)

> @author:zhucx
							@date:20210620 封存
							@describe: 看板管理-数字工厂状态看板 下 销售数据展示
							根据印件中的 印件属性为取值


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

## Parameters

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

## Body

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

## Narrative

**Business context:** 看板管理 / 数字工厂状态看板 — "今日要事" counter strip (bottom of board). Shows today's counts across 8 ERP activity buckets: 今日工单 / 在排工单 / 今日异常 / 工单变更 / 今日入库 / 今日送货 / 发外工单 / 今日退货. Author tagged `封存` 2021-06-20.

**What it does:** Fills `p_Root_allstatus_3(sName, sValue, iOrder)` row-by-row with `COUNT()` queries against `mftworkordermaster`, `mftproductionplan` (`sState IN (2,3,7)`), `mftqualityaccidentmaster`, `mftprocesschangemaster`, `pitproductinstoremaster`, `saldelivergoodsmaster`, `opsoutsideprocessmaster`, `salrejectgoodsmaster`, each filtered by `bCheck=1` and `tcreateDate = today`. Each query is followed by an `IF NOT EXISTS` block that inserts a 0 row so the bucket is always present. Result is serialised to JSON via OUT `sReturn`.

**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_Bd_Root_allstatus_3.sql`. No form-master, no `gdsmodule` hook, no Java caller, no other-routine caller. Reached only by an external dashboard HTTP endpoint. Marked `封存` (sealed) — superseded by `Sp_Bd_Root_allstatus_3_new`.
