# `getSysjurisdictionChildrenPro` (procedure)

> 获取权限树的子权限（递归用）


- **Type:** PROCEDURE
- **Deterministic:** NO
- **SQL data access:** CONTAINS SQL

## Parameters

| # | Mode | Name | Type |
|---|---|---|---|
| 1 | IN | `sLague` | `varchar(8)` |
| 2 | IN | `sbid` | `varchar(255)` |
| 3 | IN | `ssid` | `varchar(255)` |
| 4 | IN | `p_pSid` | `varchar(255)` |
| 5 | IN | `p_key` | `varchar(255)` |
| 6 | IN | `sLicense` | `text` |
| 7 | IN | `treeNode` | `longtext` |
| 8 | OUT | `newTreeNode` | `longtext` |

## Body

_Body is not pre-cached. To inspect: `mysql --defaults-file=~/.my.cnf -e 'SHOW CREATE PROCEDURE `getSysjurisdictionChildrenPro`'`._

## Narrative

**Business context:** 系统管理 / 权限管理 — recursive child-builder for the role-permission tree assembled by `getSysjurisdictionTreePro`. Walks one level of `gdsmodule.sParentId = p_pSid`, filtered by the tenant's license (`Locate(',sId,', ',sLicense,') > 0`) and excluding `sDisplayType='System'`.

**What it does:** Cursors over the licensed children of `p_pSid` in `iOrder` order. For each row, selects the display name per `sLague` (sChinese / sEnglish / sBig5), builds `key = CONCAT(p_key,'-',sId)`, emits `{sId, sName, iOrder, key, isLeaf, showName, children:[...]}`, and recurses into itself when descendants exist (`@@max_sp_recursion_depth = 10`). The accumulated `treeNode` is returned via the OUT parameter `newTreeNode`.

**Invocation:** Called only by `getSysjurisdictionTreePro` and recursively by itself. Not exposed directly to Java — the public entry point is `getSysjurisdictionTreePro`, called from `SysjurisdictionServiceImpl.getSysjurisdictionTreePro()`.
