feat(system): 添加参数以支持租户查询中获取手机号码
- 在 TenantParam 类中新增 getPhone 字段用于控制是否获取手机号码 - 修改 TenantMapper.xml,增加条件性连接 sys_user 表以获取电话号码 - 根据 getPhone 字段动态添加手机号码字段及关联表连接查询 - 实现租户查询时根据需要可选择返回手机号信息
This commit is contained in:
@@ -5,8 +5,14 @@
|
||||
<!-- 关联查询sql -->
|
||||
<sql id="selectSql">
|
||||
SELECT a.*,b.company_name,b.company_logo as logo,b.admin_url,b.domain,b.free_domain
|
||||
<if test="param.getPhone == true">
|
||||
,c.phone
|
||||
</if>
|
||||
FROM sys_tenant a
|
||||
LEFT JOIN sys_company b ON a.tenant_id = b.tenant_id
|
||||
<if test="param.getPhone == true">
|
||||
LEFT JOIN sys_user c ON a.user_id = c.user_id
|
||||
</if>
|
||||
<where>
|
||||
<if test="param.tenantId != null">
|
||||
AND a.tenant_id = #{param.tenantId}
|
||||
|
||||
@@ -52,4 +52,8 @@ public class TenantParam extends BaseParam {
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "是否获取手机号码")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean getPhone;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user