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.TSchoolPrivilege;
import com.qmth.teachcloud.common.mapper.TSchoolPrivilegeMapper;
import com.qmth.teachcloud.common.service.TSchoolPrivilegeService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 学校菜单权限表 服务实现类
 * </p>
 *
 * @author wangliang
 * @since 2021-10-28
 */
@Service
public class TSchoolPrivilegeServiceImpl extends ServiceImpl<TSchoolPrivilegeMapper, TSchoolPrivilege> implements TSchoolPrivilegeService {

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