@Component public class OrgCache extends Object
| 构造器和说明 |
|---|
OrgCache() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear()
清除所有组织相关的缓存数据。
|
long |
getByOrgName(String orgName)
根据组织名称获取对应的组织ID
|
Map<String,Object> |
getOrg(Long orgId)
获取单个组织的信息(包括ID和名称)。
|
String |
getOrgName(Object orgId)
根据组织ID获取对应的组织名称。
|
String |
getOrgPath(Object orgId)
根据组织ID获取其完整的组织路径(基于组织名称构建)。
|
List<Map<String,Object>> |
getOrgs(List<Long> orgs)
批量获取多个组织的基本信息(包括ID和名称)。
|
List<Long> |
getSubOrg(Long orgId)
获取指定组织下的所有子组织ID列表。
|
void |
reload()
加载所有组织机构数据到缓存中。
|
void |
reload(Object orgId)
根据特定组织ID重新加载单个组织信息至缓存。
|
void |
remove(Object orgId)
移除指定组织在缓存中的记录。
|
@Comment(value="\u52a0\u8f7d\u7ec4\u7ec7\u673a\u6784\u7f13\u5b58")
public void reload()
throws SQLException
SQLException - 当数据库访问异常时抛出public long getByOrgName(String orgName)
orgName - 组织名称,如果为空或空白则返回0public List<Long> getSubOrg(Long orgId) throws SQLException
orgId - 指定的父级组织IDSQLException - 当数据库访问异常时抛出@Comment(value="\u6839\u636e\u7ec4\u7ec7ID\u91cd\u65b0\u52a0\u8f7d\u7ec4\u7ec7\u5230\u7f13\u5b58")
public void reload(@Comment(value="\u7ec4\u7ec7ID")
Object orgId)
throws SQLException
orgId - 需要重新加载的组织IDSQLException - 当数据库访问异常时抛出public List<Map<String,Object>> getOrgs(List<Long> orgs) throws SQLException
orgs - 组织ID列表SQLException - 当数据库访问异常时抛出public Map<String,Object> getOrg(Long orgId) throws SQLException
orgId - 组织IDSQLException - 当数据库访问异常时抛出@Comment(value="\u6839\u636e\u7ec4\u7ec7ID\u83b7\u53d6\u7ec4\u7ec7\u540d\u79f0") public String getOrgName(@Comment(value="\u7ec4\u7ec7ID") Object orgId) throws SQLException
orgId - 组织IDSQLException - 当数据库访问异常时抛出@Comment(value="\u6839\u636e\u7ec4\u7ec7ID\u83b7\u53d6\u7ec4\u7ec7\u8def\u5f84") public String getOrgPath(@Comment(value="\u7ec4\u7ec7ID") Object orgId) throws SQLException
orgId - 组织IDSQLException - 当数据库访问异常时抛出@Comment(value="\u6e05\u7a7a\u7ec4\u7ec7\u7f13\u5b58") public void clear()
@Comment(value="\u6e05\u7a7a\u7ec4\u7ec7\u7f13\u5b58")
public void remove(@Comment(value="\u7ec4\u7ec7ID")
Object orgId)
orgId - 待移除的组织IDCopyright © 2026. All rights reserved.