class StoreRoleServiceImpl extends ServiceImpl<StoreRoleMapper, StoreRole> implements StoreRoleService {

    /**
     * 部门角色
     */
    @Autowired
    private StoreDepartmentRoleService storeDepartmentRoleService;
    /**
     * 用户权限
     */
    @Autowired
    private StoreClerkRoleService storeClerkRoleService;

    @Autowired
    private StoreMenuRoleService storeMenuRoleService;

    @Autowired
    private Cache cache;

    @Override
    public List<StoreRole> findByDefaultRole(Boolean defaultRole) {<FILL_FUNCTION_BODY>}

    @Override
    public void deleteRoles(List<String> roleIds) {
        //校验是否为当前店铺
        QueryWrapper queryWrapper = new QueryWrapper<>();
        queryWrapper.in("id", roleIds);
        List<StoreRole> roles = this.baseMapper.selectList(queryWrapper);
        roles.forEach(role -> {
            if (!role.getStoreId().equals(UserContext.getCurrentUser().getStoreId())) {
                throw new ServiceException(ResultCode.USER_AUTHORITY_ERROR);
            }
        });
        queryWrapper = new QueryWrapper<>();
        queryWrapper.in("role_id", roleIds);
        //校验是否绑定店铺部门
        if (storeDepartmentRoleService.count(queryWrapper) > 0) {
            throw new ServiceException(ResultCode.PERMISSION_DEPARTMENT_ROLE_ERROR);
        }
        //校验是否绑定店员
        if (storeClerkRoleService.count(queryWrapper) > 0) {
            throw new ServiceException(ResultCode.PERMISSION_USER_ROLE_ERROR);
        }
        //删除角色
        this.removeByIds(roleIds);
        //删除角色与菜单关联
        storeMenuRoleService.remove(queryWrapper);
        cache.vagueDel(CachePrefix.PERMISSION_LIST.getPrefix(UserEnums.STORE));
        cache.vagueDel(CachePrefix.STORE_USER_MENU.getPrefix());
    }

    @Override
    public Boolean update(StoreRole storeRole) {
        StoreRole storeRoleTemp = this.getById(storeRole.getId());
        //校验店铺角色是否存在
        if (storeRoleTemp == null) {
            throw new ServiceException(ResultCode.PERMISSION_ROLE_NOT_FOUND_ERROR);
        }
        //校验店铺角色是否属于当前店铺
        if (!storeRoleTemp.getStoreId().equals(UserContext.getCurrentUser().getStoreId())) {
            throw new ServiceException(ResultCode.PERMISSION_ROLE_NOT_FOUND_ERROR);
        }
        cache.vagueDel(CachePrefix.PERMISSION_LIST.getPrefix(UserEnums.STORE));
        cache.vagueDel(CachePrefix.STORE_USER_MENU.getPrefix());
        return updateById(storeRole);
    }


    @Override
    public Boolean saveStoreRole(StoreRole storeRole) {
        storeRole.setStoreId(UserContext.getCurrentUser().getStoreId());
        return save(storeRole);
    }

    @Override
    public List<StoreRole> list(List<String> ids) {
        QueryWrapper<StoreRole> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("store_id", UserContext.getCurrentUser().getStoreId());
        queryWrapper.in("id", ids);
        return this.baseMapper.selectList(queryWrapper);
    }
}

        QueryWrapper<StoreRole> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("default_role", true);
        return baseMapper.selectList(queryWrapper);
    
<no_super_class>