组织优化

pull/65/head
xiuchen 1 year ago
parent b0f797b5ca
commit 8f4c2ccce9

@ -79,8 +79,8 @@ public class UserGroupMemberRepositoryCustomizedImpl implements
`u`.update_by, `u`.update_by,
`u`.update_time, `u`.update_time,
`u`.remark_, `u`.remark_,
group_concat( IF(organization_member.primary_ = 1, null, organization_.display_path ) ) AS org_display_path, group_concat( IF(organization_member.primary_ = 1, null, organization_.display_path ) ) AS primary_org_display_path,
group_concat( IF(organization_member.primary_ IS NULL, null, organization_.display_path ) ) AS primary_org_display_path group_concat( IF(organization_member.primary_ IS NULL, null, organization_.display_path ) ) AS org_display_path
FROM FROM
user_group_member ugm user_group_member ugm
INNER JOIN user u ON ugm.user_id = u.id_ AND u.is_deleted = '0' INNER JOIN user u ON ugm.user_id = u.id_ AND u.is_deleted = '0'

@ -69,7 +69,7 @@ public class UserRepositoryCustomizedImpl implements UserRepositoryCustomized {
@Override @Override
public Page<UserPO> getUserList(UserListQuery query, Pageable pageable) { public Page<UserPO> getUserList(UserListQuery query, Pageable pageable) {
//@formatter:off //@formatter:off
StringBuilder builder = new StringBuilder("SELECT `user`.id_, `user`.username_,`user`.password_, `user`.email_, `user`.phone_,`user`.phone_area_code, `user`.full_name ,`user`.nick_name, `user`.avatar_ , `user`.status_, `user`.data_origin, `user`.email_verified, `user`.phone_verified, `user`.auth_total, `user`.last_auth_ip, `user`.last_auth_time, `user`.expand_, `user`.external_id , `user`.expire_date,`user`.create_by, `user`.create_time, `user`.update_by , `user`.update_time, `user`.remark_, group_concat( IF(organization_member.primary_ = 1, null, organization_.display_path ) ) AS org_display_path, group_concat( IF(organization_member.primary_ IS NULL, null, organization_.display_path ) ) AS primary_org_display_path FROM `user` INNER JOIN `organization_member` ON (`user`.id_ = organization_member.user_id) INNER JOIN `organization` organization_ ON (organization_.id_ = organization_member.org_id) WHERE `user`.is_deleted = 0"); StringBuilder builder = new StringBuilder("SELECT `user`.id_, `user`.username_,`user`.password_, `user`.email_, `user`.phone_,`user`.phone_area_code, `user`.full_name ,`user`.nick_name, `user`.avatar_ , `user`.status_, `user`.data_origin, `user`.email_verified, `user`.phone_verified, `user`.auth_total, `user`.last_auth_ip, `user`.last_auth_time, `user`.expand_, `user`.external_id , `user`.expire_date,`user`.create_by, `user`.create_time, `user`.update_by , `user`.update_time, `user`.remark_, group_concat( IF(organization_member.primary_ = 1, null, organization_.display_path ) ) AS primary_org_display_path, group_concat( IF(organization_member.primary_ IS NULL, null, organization_.display_path ) ) AS org_display_path FROM `user` INNER JOIN `organization_member` ON (`user`.id_ = organization_member.user_id) INNER JOIN `organization` organization_ ON (organization_.id_ = organization_member.org_id) WHERE `user`.is_deleted = 0");
//组织条件 //组织条件
if (StringUtils.isNotBlank(query.getOrganizationId())) { if (StringUtils.isNotBlank(query.getOrganizationId())) {
if (Boolean.TRUE.equals(query.getInclSubOrganization())) { if (Boolean.TRUE.equals(query.getInclSubOrganization())) {
@ -155,8 +155,8 @@ public class UserRepositoryCustomizedImpl implements UserRepositoryCustomized {
`user`.update_by, `user`.update_by,
`user`.update_time, `user`.update_time,
`user`.remark_, `user`.remark_,
group_concat( IF(organization_member.primary_ = 1, null, organization_.display_path ) ) AS org_display_path, group_concat( IF(organization_member.primary_ = 1, null, organization_.display_path ) ) AS primary_org_display_path,
group_concat( IF(organization_member.primary_ IS NULL, null, organization_.display_path ) ) AS primary_org_display_path group_concat( IF(organization_member.primary_ IS NULL, null, organization_.display_path ) ) AS org_display_path
FROM `user` FROM `user`
LEFT JOIN `organization_member` ON ( `user`.id_ = organization_member.user_id AND organization_member.is_deleted = '0' ) LEFT JOIN `organization_member` ON ( `user`.id_ = organization_member.user_id AND organization_member.is_deleted = '0' )
LEFT JOIN `organization` organization_ ON ( organization_.id_ = organization_member.org_id AND organization_.is_deleted = '0' ) LEFT JOIN `organization` organization_ ON ( organization_.id_ = organization_member.org_id AND organization_.is_deleted = '0' )

Loading…
Cancel
Save