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

import com.ym.mec.biz.dal.dto.CourseScheduleComplaintsDto;
import com.ym.mec.biz.dal.entity.CourseScheduleComplaints;
import com.ym.mec.common.dal.BaseDAO;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

public interface CourseScheduleComplaintsDao extends BaseDAO<Long, CourseScheduleComplaints> {

    /**
     * @return com.ym.mec.biz.dal.entity.CourseScheduleComplaints
     * @Author: Joburgess
     * @Date: 2019/10/8
     * @params [userId, courseScheduleId]
     * @describe 根据用户和课程获取申诉详情
     */
    CourseScheduleComplaints findByUserAndCourse(@Param("userId") Long userId, @Param("courseScheduleId") Long courseScheduleId);

    /**
     * @return java.util.List<com.ym.mec.biz.dal.entity.CourseScheduleComplaints>
     * @Author: Joburgess
     * @Date: 2019/10/15
     * @params [ids]
     * @describe 根据课程编号批量获取投诉记录
     */
    List<CourseScheduleComplaints> findByCourseScheduleIds(@Param("ids") List<Long> ids);

    /**
     * 获取课程的学员评价
     *
     * @param courseScheduleId
     * @return
     */
    List<CourseScheduleComplaintsDto> findByCourseScheduleId(Long courseScheduleId);

    /**
     * 获取用户的评价
     *
     * @param userId
     * @param courseScheduleId
     * @return
     */
    CourseScheduleComplaintsDto findByUserIdAndCourseId(@Param("userId") Long userId, @Param("courseScheduleId") Long courseScheduleId);

    /**
     * 获取用户多课程的评价
     *
     * @return
     */
    List<CourseScheduleComplaints> findByCourseIdAndUserId(@Param("courseIds") List<Long> courseIds, @Param("userId") Integer userId);

    /**
     * 根据课程id获取用户评价
     * @return
     */
    List<CourseScheduleComplaints> findComplaintsByCourseScheduleIds(@Param("ids") List<Long> ids);

    /**
     * 删除申述
     * @param courseScheduleId
     */
    void delByCourseScheduleId(@Param("courseScheduleId") Long courseScheduleId);

    /**
     * 删除申述
     * @param courseScheduleIds
     */
    void delByCourseScheduleIds(@Param("courseScheduleIds") Collection<Long> courseScheduleIds);

    /**
     * 获取课程用户的评价
     *
     * @param courseScheduleId
     * @return
     */
    List<CourseScheduleComplaintsDto> findCourseIdComplaints(@Param("courseScheduleId") Long courseScheduleId);
}