diff --git a/users/src/main/java/com/huoran/users/entity/res/UserInfoListRes.java b/users/src/main/java/com/huoran/users/entity/res/UserInfoListRes.java index d815087..b521afa 100644 --- a/users/src/main/java/com/huoran/users/entity/res/UserInfoListRes.java +++ b/users/src/main/java/com/huoran/users/entity/res/UserInfoListRes.java @@ -65,4 +65,7 @@ public class UserInfoListRes implements Serializable { @ApiModelProperty("openId") private String appOpenId; + @ApiModelProperty("账号来源") + private String accountSource; + } diff --git a/users/src/main/java/com/huoran/users/mapper/xml/HrUserAccountMapper.xml b/users/src/main/java/com/huoran/users/mapper/xml/HrUserAccountMapper.xml index a91e41a..21ebeae 100644 --- a/users/src/main/java/com/huoran/users/mapper/xml/HrUserAccountMapper.xml +++ b/users/src/main/java/com/huoran/users/mapper/xml/HrUserAccountMapper.xml @@ -839,20 +839,26 @@ a.is_enable, a.phone, a.create_time, - u.last_login_time, - u.login_number, - GROUP_CONCAT(u.user_name) as user_name, + max(u.last_login_time) as last_login_time, + count(u.login_number) as login_number, + max(CASE WHEN a.platform_id = 7 THEN u.user_name ELSE NULL END) as user_name, a.work_number, GROUP_CONCAT(s.platform_name) as platformName, CASE WHEN count(ai.id) > 0 THEN '已认证' ELSE '未认证' - END as authentication + END as authentication, + CASE + WHEN a.platform_id != 7 AND ta.invitation_account IS NULL THEN '自行注册' + WHEN a.platform_id != 7 AND ta.invitation_account IS NOT NULL THEN ta.invitation_account + ELSE NULL + END as accountSource FROM nakadai.hr_user_info u INNER JOIN nakadai.hr_user_account a ON u.user_id = a.user_id AND a.is_del = 0 inner join sys_platform s on a.platform_id = s.platform_id left join hr_user_authentication_information ai on a.id = ai.account_id + LEFT JOIN k_platform_team_account ta on ta.account_id = a.id WHERE u.is_del = 0 AND a.customer_id IS NULL