Sp_Sys_GetMenu (procedure)
根据模块sId删除模块(包含子模块) 需要执行:SET GLOBAL group_concat_max_len = 40960
- Type: PROCEDURE
- Deterministic: NO
- SQL data access: CONTAINS SQL
Parameters
| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | s_sbid |
varchar(255) |
| 2 | IN | s_ssid |
varchar(255) |
| 3 | IN | s_sLanguage |
varchar(255) |
| 4 | IN | s_pSid |
varchar(255) |
| 5 | IN | p_auSid |
varchar(255) |
Body
Body is not pre-cached. To inspect: mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURESpSys_GetMenu'._
Narrative
Business context: 系统平台 → 菜单 — returns the menu tree (one branch at a time) for the BACK side-bar of the logged-in user, scoped to the current brand/subsidiary. The proc itself doesn't apply role-authorisation; that's layered by the calling Java service.
What it does: When s_pSid is empty, selects all root-level gdsmodule rows (sParentId='') for the current sBrandsId/sSubsidiaryId, excluding sDisplayType='System' and the reserved sId '100', ordered by iOrder. When s_pSid is given, selects descendants by LOCATE(CONCAT('-', s_pSid), m.sAllId) > 0. The sMenuName output column picks sChinese/sEnglish/sBig5 based on s_sLanguage. Despite the auto-catalog header comment ("根据模块sId删除模块"), the body is a read-only SELECT — only the comment is misleading.
Invocation: Called by MyBatis GdsmoduleMapper.getBuMenu ({call Sp_Sys_GetMenu(...)}), wired into Java MenuServiceImpl.getBuMenu(param) — @Cacheable(value="getBuMenu") per (sUserId, sBrandsId, sSubsidiaryId). Also referenced by CleanRedisServiceImpl, BusinessParameterImpl, MenuChildServiceImpl, BusinessBaseService for cache invalidation of the same key. Install script: script/标版/30100101/Sp_Sys_GetMenu.sql.