This commit is contained in:
liuchengqian 2023-03-08 11:05:36 +08:00
parent 53d2af1d3e
commit d6d82f2377
3 changed files with 0 additions and 21 deletions

View File

@ -11,14 +11,6 @@ import java.util.List;
*/
public interface SysAuthorityService {
/**
* 获取权限实体列表根据用户名
*
* @param userName
* @return
*/
List<SysAuthorityEntity> getSysAuthorityListByUserName(String userName);
List<SysAuthorityEntity> findAllByIdIn(List<Long> id);
List<Long> selectAuthorityByUserId(Long userId);

View File

@ -23,11 +23,6 @@ public class SysAuthorityServiceImpl implements SysAuthorityService {
@Resource
private RelRoleAuthorityDao relRoleAuthorityDao;
@Override
public List<SysAuthorityEntity> getSysAuthorityListByUserName(String userName) {
return sysAuthorityDao.selectByUserName(userName);
}
@Override
public List<SysAuthorityEntity> findAllByIdIn(List<Long> id) {
return sysAuthorityDao.findAllByIdIn(id);

View File

@ -3,8 +3,6 @@ package com.xkrs.straw.dao;
import com.xkrs.straw.model.entity.SysAuthorityEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Component;
import java.util.List;
@ -12,12 +10,6 @@ import java.util.List;
@Component
public interface SysAuthorityDao extends JpaRepository<SysAuthorityEntity, Long>, JpaSpecificationExecutor<SysAuthorityEntity> {
/**
* 查询权限实体列表根据用户名 Object[]
*/
@Query(value = "SELECT a.id, a.authority_name, a.authority_name_zh, a.authority_desc FROM sys_authority a,rel_role_authority ra,sys_role r WHERE r.id = ra.role_id AND ra.authority_id = a.id AND r.id IN (SELECT r.id FROM sys_user u,sys_role r,rel_user_role ur WHERE u.user_name = :userName AND u.id = ur.user_id AND ur.role_id = r.id)", nativeQuery = true)
List<SysAuthorityEntity> selectByUserName(@Param("userName") String userName);
/**
* 根据id批量查询权限信息
*/