package com.qmth.teachcloud.common.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.teachcloud.common.entity.BasicUserCourse;
import com.qmth.teachcloud.common.entity.SysUser;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 用户和课程关联表 服务类
 * </p>
 *
 * @author xf
 * @since 2021-03-23
 */
public interface BasicUserCourseService extends IService<BasicUserCourse> {

    void removeByUserId(Long userId);

    void saveBatch(SysUser sysUser);

    /**
     * 根据课程id和班级集合更新'basic_user_course'表
     * 逻辑：课程id查询出所有该课程相关记录并删除，添加和班级对应关系
     * @param courseId 课程id
     * @param clazzIdSet 班级集合
     * @param sysUser 执行人
     * @param orgId 机构权限id
     */
    void updateByCourseIdAndClazzList(Long courseId, Set<Long> clazzIdSet, SysUser sysUser, Long orgId);

    List<BasicUserCourse> listBySchoolIdAndCourseCode(Long schoolId, String courseCode);
}
