SELECT u.id,u.username,u.password,u.name,u.sex,u.mobile,u.status,u.top_office_id,u.office_id,u.iconName,create_time,u.service_expiration_time, (SELECT l.logoAddress FROM t_sys_logo l WHERE u.iconName=l.iconName) as icon,u.user_photo as userPhotoUrl, (SELECT o.office_name FROM t_office o WHERE o.id = u.office_id) AS officeName, (SELECT o.office_logo FROM t_office o WHERE o.id = u.top_office_id) as officeLogoUrl, (SELECT o.office_name FROM t_office o WHERE o.id =u.top_office_id) as topOfficeName, uu.is_sys_role as sysRole,uu.role_id_list as roleIdList,uu.role_name_list as roleNameList FROM t_sys_user u left join (select tr.user_id,sum(sr.is_sys_role) is_sys_role,GROUP_CONCAT(sr.id) role_id_list,GROUP_CONCAT(sr.role_name) role_name_list from t_sys_role sr ,t_sys_user_roles tr where tr.del_flag=1 and tr.role_id=sr.id GROUP BY tr.user_id) uu on u.id=uu.user_id where DATE_SUB(CURDATE(), INTERVAL 90 DAY) <= DATE(u.service_expiration_time) AND u.del_flag = 1 ORDER BY u.service_expiration_time is null , u.service_expiration_time
时间: 2024-04-15 09:26:48 浏览: 156
这是一个查询语句,用于检索用户信息。它从表t_sys_user中选择了一些列,并连接了其他表来获取相关信息。查询的结果按照服务过期时间进行排序。
注意:这是一个复杂的查询语句,包含了子查询和嵌套查询。具体的查询逻辑可能需要结合数据库结构和数据来进行分析和调整。如果需要更详细的说明或修改,请提供更多的信息。
阅读全文