# `Sp_Bd_Root_allstatus_1` (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_1`'`._

## Narrative

**Business context:** 看板管理 / 数字工厂状态看板 — "销售数据展示" tile (bottom of board). Shows this-month sales totals (万元) bucketed by `eleproduct.sProductproperty` (印件属性): 卡盒类 / 书刊类 / 坑盒类 / 其他 etc. Author tagged `封存` 2021-06-20.

**What it does:** Seeds `p_Root_allstatus_1` with one row per distinct `eleproduct.sProductproperty` at 0. Joins `viw_salsalesorder` (`bCheck=1`, `tcreateDate >= 当月1号`) with `eleproduct` and sums `dProductMoney/10000` plus a 300 offset per bucket. Then forces 卡盒类 / 书刊类 / 坑盒类 / 其他 to constant or constant-plus-actual values (36 / 58 / 86 / 86). Returns a JSON string `{"data":[{"x":<sName>,"y":<value>}...],"yUnit":"万"}` via OUT `sReturn`.

**Invocation:** Installed by `xly-src/script/标版/30100101/Sp_Bd_Root_allstatus_1.sql`. No form-master, no `gdsmodule` hook, no Java caller, no other-routine caller. Reached only by an external dashboard HTTP endpoint. Marked `封存` (sealed); the hard-coded `+300` offset and per-bucket numeric forces (36/58/86) mean output is mostly demo data — verify before relying on it.
