getModuleChildrenPro.md 1.6 KB

getModuleChildrenPro (procedure)

获取模块的子模块

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

Parameters

# Mode Name Type
1 IN sbid varchar(255)
2 IN ssid varchar(255)
3 IN p_pSid varchar(255)
4 IN p_key varchar(255)
5 IN treeNode longtext
6 OUT newTreeNode longtext
7 IN sHandModeType varchar(255)

Body

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

Narrative

Business context: 系统管理 / 模块树 — recursive child-builder used by getModuleTreePro. Walks one level of gdsmodule.sParentId = p_pSid and emits each child as a JSON-like tree node, appending sub-trees inline via self-recursion (SET @@max_sp_recursion_depth = 10).

What it does: Cursors over the children of p_pSid for the given brand/subsidiary in iOrder order. For each row emits {sName, iOrder, sAllId, sParentId, key, sUserType, isLeaf, sId, showName, children:[...]}, where key is built as CONCAT(p_key, '-', m.sId) so each node carries its full path. When a child has further descendants (isLeaf='true'), the proc calls itself with the new key. The accumulated treeNode is returned in the OUT parameter newTreeNode.

Invocation: Called only by getModuleTreePro and recursively by itself. Not exposed directly to Java — getModuleTreePro is the public entry point invoked via GdsmoduleMapper.getModuleTreePro and MenuServiceImpl.getModuleTreePro().