Fun_getInitColumnByProName (function)
根据存储过程名字获取返回字段
- Type: FUNCTION
-
Returns:
varchar(5000) - Deterministic: NO
- SQL data access: CONTAINS SQL
Parameters
| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | sProductName |
varchar(100) |
Body
Body is not pre-cached. To inspect: mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE FUNCTIONFungetInitColumnByProName'._
Narrative
Business context: Dispatcher that returns the canonical column list for a stored-procedure-backed report given its name. Wired into the metadata-config tooling under gdsconfigtb* — when an admin generates the SQL script for a report-style proc, the platform asks this function which columns to declare in the wrapper.
What it does: a long chain of IF lower(sProductName) = lower('Sp_…') THEN @sColumns := 'sId,…' ; RETURN @sColumns; blocks. Each branch hard-codes the master+slave column union for one report proc — Sp_Sales_NotDeliverGoodList, Sp_BillOfNoPicking, Sp_Receivables_AR*, Sp_Payables_AP*, Sp_NotPayables, Sp_NotReceivables, Sp_Inventory_InOutStore, Sp_Inventory_ProductInOutStore, Sp_Manufacture_Production*, Sp_Cashier_OrderMoneyWarning, Sp_Element_ProduceReportSum, SP_DeliverGoods_Warning, etc. Pure string concatenation; no table access.
Invocation: called by MyBatis mapper GdsconfigtbMapper.getInitColumnByProName (select Fun_getInitColumnByProName(#{sTbName}) as sColumns…) during gdsconfigtb script generation for the named report procedure.