package com.qmth.teachcloud.common.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qmth.teachcloud.common.entity.TSchoolRole;
import com.qmth.teachcloud.common.mapper.TSchoolRoleMapper;
import com.qmth.teachcloud.common.service.TSchoolRoleService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 学校角色权限表 服务实现类
 * </p>
 *
 * @author wangliang
 * @since 2021-10-28
 */
@Service
public class TSchoolRoleServiceImpl extends ServiceImpl<TSchoolRoleMapper, TSchoolRole> implements TSchoolRoleService {

    /**
     * 根据学校id查找自定义角色
     *
     * @param schoolId
     * @return
     */
    @Override
    public List<TSchoolRole> findBySchoolId(Long schoolId) {
        QueryWrapper<TSchoolRole> tSchoolRoleQueryWrapper = new QueryWrapper<>();
        tSchoolRoleQueryWrapper.lambda().eq(TSchoolRole::getSchoolId, schoolId);
        return this.list(tSchoolRoleQueryWrapper);
    }
}
