package com.ym.mec.biz.dal.dao;

import com.ym.mec.biz.dal.dto.CourseTeacherSalaryStatisticsDto;
import com.ym.mec.biz.dal.entity.TeacherCourseReward;
import com.ym.mec.biz.dal.enums.GroupType;
import com.ym.mec.biz.dal.enums.TeacherSalaryConfirmStatus;
import com.ym.mec.common.dal.BaseDAO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface TeacherCourseRewardDao extends BaseDAO<Long, TeacherCourseReward> {

    /**
     * 根据结算状态获取列表
     * @param settlementStatus
     * @return
     */
    List<TeacherCourseReward> findBySettlementStatus(@Param("settlementStatus") int settlementStatus);

    /**
     * 批量修改
     * @param teacherCourseRewards
     */
    void batchUpdate(@Param("teacherCourseRewards") List<TeacherCourseReward> teacherCourseRewards);

    /**
     * @describe 统计老师指定月份的奖励
     * @author Joburgess
     * @date 2020/4/24
     * @param teacherId: 教师编号
     * @param month: 月份
     * @return com.ym.mec.biz.dal.dto.CourseTeacherSalaryStatisticsDto
     */
    CourseTeacherSalaryStatisticsDto teacherCourseRewardStatWithMonth(@Param("teacherId") Integer teacherId,
                                                                      @Param("month") String month);
    /**
     * @describe 获取老师指定日期的转结奖励
     * @author Joburgess
     * @date 2020/4/24
     * @param params:
     * @return java.util.List<com.ym.mec.biz.dal.entity.TeacherCourseReward>
     */
    List<TeacherCourseReward> findTeacherCourseRewards(Map<String, Object> params);
    int countTeacherCourseRewards(Map<String, Object> params);

    /**
     * @describe 获取教师指定课程组的奖励
     * @author Joburgess
     * @date 2020/4/24
     * @param teacherId:
     * @param groupId:
     * @param groupType:
     * @return com.ym.mec.biz.dal.entity.TeacherCourseReward
     */
    TeacherCourseReward findTeacherCourseRewardWithGroup(@Param("teacherId") Integer teacherId,
                                                    @Param("groupId") String groupId,
                                                    @Param("groupType")GroupType groupType);

    /**
     * @describe 更新奖励的课酬确认状态
     * @author Joburgess
     * @date 2020/4/24
     * @param month:
     * @return int
     */
    int updateTeacherRewardConfirmStatusWithMonth(@Param("month") String month,
                                                  @Param("teacherId") Integer teacherId,
                                                  @Param("confirmStatus")TeacherSalaryConfirmStatus confirmStatus);

}
