feat(system): 新增租户超级管理员用户ID字段

- Tenant实体类中新增superAdminUserId字段,标记为非数据库字段
- 在TenantMapper.xml的关联查询SQL中添加超级管理员用户ID字段查询
- 用于前端或业务逻辑识别租户对应的超级管理员用户ID,便于权限管理
This commit is contained in:
2026-07-21 14:28:10 +08:00
parent b2487572a6
commit 18db0f7d44
3 changed files with 33 additions and 1 deletions

View File

@@ -104,6 +104,10 @@ public class Tenant implements Serializable {
@TableField(exist = false)
private String phone;
@Schema(description = "超级管理员用户ID")
@TableField(exist = false)
private Integer superAdminUserId;
@Schema(description = "管理地址")
@TableField(exist = false)
private String adminUrl;

View File

@@ -5,7 +5,7 @@
<!-- 关联查询sql -->
<sql id="selectSql">
SELECT a.*,b.company_name,b.company_logo as logo,b.admin_url,b.domain,b.free_domain,
u.phone,u.username
u.phone,u.username,u.user_id as superAdminUserId
FROM sys_tenant a
LEFT JOIN sys_company b ON a.tenant_id = b.tenant_id
LEFT JOIN gxwebsoft_core.sys_user u ON u.tenant_id = a.tenant_id AND u.is_super_admin = 1 AND u.deleted = 0