getSysjurisdictionTreePro.md 1.86 KB

getSysjurisdictionTreePro (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 sLague varchar(255)
4 IN sLicense text

Body

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

Narrative

Business context: 系统管理 / 权限管理 — builds the role-permission tree shown in 角色权限分配. Same shape as getModuleTreePro but filtered to modules included in the tenant's license (Locate(',sId,', ',sLicense,') > 0), excludes sDisplayType='System' and hidden rows (bVisible=1), and localizes the display name per sLague (sChinese/sEnglish/sBig5).

What it does: Augments sLicense with any mobile-only modules (sDisplayType='mobile') so 移动端 entries appear in the picker. Then cursors over root-level licensed modules in iOrder order, emits each as {sId, sName, iOrder, key, isLeaf, showName, children:[...]}, and recurses via CALL getSysjurisdictionChildrenPro for nodes with descendants.

Invocation: Reached from SysjurisdictionServiceImpl.getSysjurisdictionTreePro() via DAO sysjurisdictionDao.getSysjurisdictionTreePro and MyBatis mapper SysjurisdictionMapper.xml (<select id="getSysjurisdictionTreePro" statementType="CALLABLE">). HTTP endpoint SysjurisdictionController.getSysjurisdictionTreePro(). Java side wraps with @Cacheable(value="getSysjurisdictionTreePro"); cache is evicted by GdsmoduleServiceImpl on any module mutation.

Note the m.sId <> '11811781131121915101184660940' literal exclusion — a hardcoded tenant-specific module skip; worth flagging if migrated to a different deployment.