Commit 9fea2e65 by Lichen

管理端用户管理用户里了表添加查询关联角色名称

parent a6ac18ba
...@@ -138,4 +138,7 @@ public class AccountVO { ...@@ -138,4 +138,7 @@ public class AccountVO {
@ApiModelProperty(value = "学员个人信息修改编辑权限") @ApiModelProperty(value = "学员个人信息修改编辑权限")
private StudentEditPermissionVO editPermissionVO; private StudentEditPermissionVO editPermissionVO;
@ApiModelProperty(value = "关联角色名称")
private String relationRoleNames;
} }
...@@ -247,4 +247,9 @@ public class Account { ...@@ -247,4 +247,9 @@ public class Account {
@ApiModelProperty(value = "绑定状态") @ApiModelProperty(value = "绑定状态")
@TableField(exist = false) @TableField(exist = false)
private String bindWeChatState; private String bindWeChatState;
@ApiModelProperty(value = "关联角色名称")
@TableField(exist = false)
private String relationRoleNames;
} }
...@@ -92,4 +92,10 @@ public interface AuthzAccountRoleMapper extends BaseMapper<AuthzAccountRole> { ...@@ -92,4 +92,10 @@ public interface AuthzAccountRoleMapper extends BaseMapper<AuthzAccountRole> {
@Param("siteId") Long siteId, @Param("siteId") Long siteId,
@Param("accountId") Long accountId); @Param("accountId") Long accountId);
/**
* 根据账号id来获取角色id
* @param accountIds
* @return
*/
List<AuthzAccountRole> getRoleIdsByAccountIds(@Param("accountIds") List<Long> accountIds);
} }
package com.yizhi.system.application.service; package com.yizhi.system.application.service;
import java.util.List;
import com.baomidou.mybatisplus.service.IService; import com.baomidou.mybatisplus.service.IService;
import com.yizhi.system.application.domain.AuthzAccountRole; import com.yizhi.system.application.domain.AuthzAccountRole;
import com.yizhi.system.application.domain.AuthzRoleMenu; import com.yizhi.system.application.domain.AuthzRoleMenu;
import java.util.List;
/** /**
* <p> * <p>
* 角色和账号关联表 * 角色和账号关联表
...@@ -40,4 +40,11 @@ public interface IAuthzAccountRoleService extends IService<AuthzAccountRole> { ...@@ -40,4 +40,11 @@ public interface IAuthzAccountRoleService extends IService<AuthzAccountRole> {
* @return * @return
*/ */
List<Long> getAdminIdsByAccountId(Long companyId,Long siteId,Long accountId); List<Long> getAdminIdsByAccountId(Long companyId,Long siteId,Long accountId);
/**
* 根据用户ID查询关联角色ID集合
* @param accountIds
* @return
*/
List<AuthzAccountRole> getRoleIdsByAccountIds(List<Long> accountIds);
} }
package com.yizhi.system.application.service.impl; package com.yizhi.system.application.service.impl;
import com.yizhi.system.application.mapper.AuthzAccountRoleMapper; import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yizhi.system.application.service.IAuthzAccountRoleService;
import com.yizhi.system.application.domain.AuthzAccountRole; import com.yizhi.system.application.domain.AuthzAccountRole;
import java.util.List;
import com.yizhi.system.application.domain.AuthzRoleMenu; import com.yizhi.system.application.domain.AuthzRoleMenu;
import com.yizhi.system.application.mapper.AuthzAccountRoleMapper;
import com.yizhi.system.application.service.IAuthzAccountRoleService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.service.impl.ServiceImpl; import java.util.List;
/** /**
* <p> * <p>
...@@ -44,4 +42,13 @@ public class AuthzAccountRoleServiceImpl extends ServiceImpl<AuthzAccountRoleMap ...@@ -44,4 +42,13 @@ public class AuthzAccountRoleServiceImpl extends ServiceImpl<AuthzAccountRoleMap
return authzAccountRoleMapper.getAdminIdsByAccountId(companyId,siteId,accountId); return authzAccountRoleMapper.getAdminIdsByAccountId(companyId,siteId,accountId);
} }
/**
* 根据用户ID查询关联角色ID集合
* @param accountIds
* @return
*/
@Override
public List<AuthzAccountRole> getRoleIdsByAccountIds(List<Long> accountIds) {
return authzAccountRoleMapper.getRoleIdsByAccountIds(accountIds);
}
} }
...@@ -61,4 +61,13 @@ ...@@ -61,4 +61,13 @@
AND ar.site_id = #{siteId} AND ar.site_id = #{siteId}
AND ar.create_by_id = #{accountId} AND ar.create_by_id = #{accountId}
</select> </select>
<select id="getRoleIdsByAccountIds" resultMap="BaseResultMap">
select <include refid="Base_Column_List"/> from authz_account_role
where account_id in
<foreach collection="accountIds" item="accountId" index="index" open="(" close=")" separator=",">
#{accountId}
</foreach>
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment