package com.yonge.cooleshow.biz.dal.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yonge.cooleshow.biz.dal.dto.PracticeTimesSetting;
import com.yonge.cooleshow.biz.dal.entity.TeacherFreeTime;
import com.yonge.cooleshow.biz.dal.entity.TeacherSubjectPrice;
import com.yonge.cooleshow.biz.dal.vo.TeacherFreeTimeVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 老师可排课时间表(TeacherFreeTime)表数据库访问层
 *
 * @author zx
 * @since 2022-03-25 10:04:26
 */
public interface TeacherFreeTimeDao extends BaseMapper<TeacherFreeTime> {

    int insertBatch(@Param("entities") List<TeacherFreeTime> entities);

    /**
     * @param teacherId
     * @param courseMinutes
     * @param freeMinutes
     * @return com.yonge.cooleshow.biz.dal.entity.TeacherFreeTime
     * @description: 获取老师陪练课设置
     * @author zx
     * @date 2022/3/25 10:25
     */
    TeacherFreeTime findOne(@Param("teacherId") Long teacherId,
                            @Param("courseMinutes") Integer courseMinutes,
                            @Param("freeMinutes") Integer freeMinutes);

    /**
     * @param defaultFlag
     * @return void
     * @description: 修改默认配置
     * @author zx
     * @date 2022/3/29 10:02
     */
    void updateDefaultFlag(@Param("defaultFlag") boolean defaultFlag, @Param("teacherId") Long teacherId);

    //根据id删除关联表数据
    void deleteSubjectPrice(Long id);

    //新增声部价格
    void insertPrice(List<TeacherSubjectPrice> list);

    //查询老师配置
    TeacherFreeTimeVo getDetail(@Param("param") PracticeTimesSetting practiceTimesSetting);

    //根据id查声部售价
    List<TeacherSubjectPrice> getPrice(Long id);

    //查询老师声部默认售价
    TeacherSubjectPrice selectSubjectPrice(@Param("teacherId") Long teacherId, @Param("subjectId") Long subjectId);

    //查询老师所有声部配置
    List<TeacherSubjectPrice> selectPriceByTeacherId(Long teacherId);

    //查询过审老师配置默认
    List<TeacherFreeTime> getTeacherFreeTime();
}

