com.addplus.server.security.service.mapper.SysRoleMapper Maven / Gradle / Ivy
The newest version!
package com.addplus.server.security.service.mapper;
import com.addplus.server.core.model.authority.data.SysRole;
import com.addplus.server.core.model.authority.data.SysUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface SysRoleMapper extends BaseMapper {
@Select("SELECT\n" +
" count(id) \n" +
"FROM\n" +
" sys_user \n" +
"WHERE\n" +
" FIND_IN_SET( #{roleId}, roles ) \n" +
" AND is_deleted = 0")
Long getUserAssociateRole(@Param("roleId") Long roleId);
@Select("SELECT count(1) FROM sys_user WHERE FIND_IN_SET(#{roleId},roles) AND is_deleted = 0;")
Integer getRoleSysUserCount(@Param("roleId") Long roleId);
@Select("SELECT id,roles FROM sys_user WHERE FIND_IN_SET(#{roleId},roles) AND is_deleted = 0")
List getRoleAssoiateSysUser(@Param("roleId") Long roleId);
}