# `Sp_System_ReCostStructure` (procedure) > @author:杨恒林 @date:20210616 封存 @describe: 成本结构发生变化时,需要保存当前的数据到备份表,CotOrderCostAnalysis+时分秒 - **Type:** PROCEDURE - **Deterministic:** NO - **SQL data access:** CONTAINS SQL ## Parameters | # | Mode | Name | Type | |---|---|---|---| | 1 | IN | `sProInParam` | `varchar(100)` | | 2 | IN | `sMakePerson` | `varchar(100)` | | 3 | IN | `sBrId` | `varchar(100)` | | 4 | IN | `sSuId` | `varchar(100)` | | 5 | OUT | `sReturn` | `varchar(1000)` | | 6 | OUT | `sCode` | `int` | ## Body _Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `Sp_System_ReCostStructure`'`._ ## Narrative **Business context:** 成本管理 → 成本结构维护 — snapshot the active cost-analysis table when 成本结构 schema changes. Header comment (@author:杨恒林 @date:20210616 封存): "成本结构发生变化时,需要保存当前的数据到备份表,CotOrderCostAnalysis+时分秒". Production version (paired with the `_new` developer copy); after renaming the table it re-initialises a Jan 2000 placeholder period via `Sp_System_InitCurrentPeriodCost`. **What it does:** Hard-codes `p_sDbName='xlyweberp'` and `p_sTableName='cotordercostanalysis'+DATE_FORMAT(NOW(),'%Y%m%d%H%i%s')`. Checks `information_schema.tables` for `cotordercostanalysis`; if present executes `ALTER TABLE CotOrderCostAnalysis rename to ` via PREPARE/EXECUTE. Re-checks and `DROP TABLE cotordercostanalysis` if it still exists. Calls `Sp_System_InitCurrentPeriodCost('2000-01-01','2000-01-01','200001', sMakePerson, sBrId, sSuId, sReturn, sCode)` to seed a fresh empty period, then clears `sReturn`. **Invocation:** No `gdsmodule` binding, no form-master, no other-proc, no xly-src match beyond `script/标版/30100101/cost/Sp_System_ReCostStructure.sql` install script — dispatched dynamically by `GenericProcedureCallServiceImpl.doGenericProcedureCall()` from a 成本结构维护 admin button (likely 重置成本结构). The hard-coded `xlyweberp` database name and `封存` tag suggest this is brittle in multi-tenant SaaS; verify before invoking.