@Mapper
public interface AdminManuallyMapper
@Select(value=" select id, no, username, nick_name nickName, title, department, gender, type, avatar_url avatarUrl, mobile, email, enabled, created_by createdBy, created_by_name createdByName, created_time createdTime from tb_admin where id=#{adminId}")
@Result(property="roles",javaType=java.util.List.class,column="id",many=@Many(select="selectAllRolesByAdminId")) @Result(property="permissions",javaType=java.util.List.class,column="id",many=@Many(select="selectAllPermissionsByAdminId"))
Admin selectAdminInfoById(@Param(value="adminId")
Long adminId)
adminId - 管理员Id@Select(value="select b.id,b.name,b.label from ref_admin_role a left join tb_role b on a.role_id=b.id and b.enabled = 1 where a.admin_id =#{adminId}")
List<Map<String,Object>> selectAllRolesByAdminId(@Param(value="adminId")
Long adminId)
adminId - 管理员Id@Select(value="select c.id,c.name,c.label from ref_admin_role a left join ref_role_permission b on a.role_id=b.role_id left join tb_permission c on b.permission_id=c.id and c.enabled = true where a.admin_id =#{adminId}")
@Result(column="id",property="id") @Result(property="children",javaType=java.util.List.class,column="id",many=@Many(select="cn.watsontech.core.service.mapper.manually.PermissionManuallyMapper.selectAllChildPermissions"))
List<Map<String,Object>> selectAllPermissionsByAdminId(@Param(value="adminId")
Long adminId)
adminId - 管理员IdCopyright © 2020. All rights reserved.