planScriptTmp.md 1.54 KB

planScriptTmp (procedure)

  • Type: PROCEDURE
  • Deterministic: NO
  • SQL data access: CONTAINS SQL

Parameters

No parameters.

Body

Body is not pre-cached. To inspect: mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDUREplanScriptTmp'.

Narrative

Business context: 排产 / 生产计划明细 (denorm-merge) — historical denormalizer that refreshed name/no/style columns on MftProductionPlanSlave from their canonical sources (eleprocess, elecustomer, eleproduct, elemachine, elematerials, eleteam, sisworkcenter, mftworkorder{master,slave,control,materials,process}, etc.) and also propagated tDeliverDate / bWorkOrderCheck. Effectively the per-row counterpart to the PRO_ERPMERGEBASE* family for the production-plan slave table.

What it does: Currently nothing — every statement in the body is commented out, so the proc runs an empty top: BEGIN ... END block. Historically it ran ~15 UPDATE MftProductionPlanSlave A JOIN <source> B ... denorm passes plus a DELETE that pruned plan rows for bBillOutside=1 work orders whose production-report qty was zero.

Invocation: Called from Sp_Manufacture_GetAPSState (live, real CALL planScriptTmp()) and Sp_unifiedPlanning_BtnCalculation (call commented out). Because the body is fully commented, every invocation is a no-op; if the upstream denormalization is expected to happen, this proc needs to be restored or its callers retargeted. Worth flagging during maintenance audits — the proc is "alive" structurally but inert.