Sp_bd_EqAdjust (procedure)
调机时间分析
- 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 |
varchar(5000) |
Body
Body is not pre-cached. To inspect: mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURESpbd_EqAdjust'._
Narrative
Business context: 调机时间分析 — equipment setup-time (调机) analysis dashboard tile, reports per-machine 总生产时间 vs 有效生产时间 for yesterday's 8:30 → today's 8:00 shift window. The "valid" subset is dAdjustableQty>0 (machine actually produced sellable output, not pure adjustment cycles). Sibling of Sp_bd_Eqabnormal and Sp_bd_EqAnalysis.
What it does: Builds p_bd_EqAdjust(iPlcNo, sMachineId, sMachineName, dTotalTime, dValidTime) from elemachine rows with iPlcNo>0 and MOD(iPlcNo,14) BETWEEN 1 AND 12, joins plc_machinedata aggregated over the yesterday-shift-start → today-shift-start window, computes dTotalTime = SUM(sStatus<>'offwork') and dValidTime = SUM(dAdjustableQty>0), emits the table-as-JSON into sReturn.
Invocation: Installed by xly-src/script/标版/30100101/Sp_bd_EqAdjust.sql. No form-master sSqlStr, no gdsmodule hook, no other-routine caller, no Java caller. Status: reachable only via an external dashboard HTTP endpoint that invokes the proc by name.
Flag: MOD(iPlcNo,14) machine-filter exempts PLCs 0 and 13, 27, 41, ... (every 14th from 0) — tenant-specific convention for marking test PLCs; will silently drop production machines if PLC numbering changes.