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

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yonge.cooleshow.biz.dal.dto.activity.ActivityTeacherQuery;
import com.yonge.cooleshow.biz.dal.dto.search.MusicSheetSearch;
import com.yonge.cooleshow.biz.dal.vo.ActivityMusicVo;
import com.yonge.cooleshow.biz.dal.vo.MusicSheetVo;
import com.yonge.cooleshow.biz.dal.vo.activity.ActivityTeacherWrapper;
import com.yonge.cooleshow.biz.dal.wrapper.StatGroupWrapper;
import org.apache.ibatis.annotations.Param;
import com.yonge.cooleshow.biz.dal.entity.ActivityEvaluation;
import com.yonge.cooleshow.biz.dal.vo.ActivityEvaluationVo;
import com.yonge.cooleshow.biz.dal.dto.search.ActivityEvaluationSearch;


public interface ActivityEvaluationDao extends BaseMapper<ActivityEvaluation> {
    /**
     * 查询详情
     *
     * @author liweifan
     * @date 2022-08-04 10:19:49
     * @return: com.yonge.cooleshow.biz.dal.vo.ActivityEvaluationVo
     */
    ActivityEvaluationVo detail(@Param("id") Long id);
    /**
     * 分页查询
     *
     * @author liweifan
     * @date 2022-08-04 10:19:49
     * @return: com.yonge.cooleshow.biz.dal.vo.ActivityEvaluationVo
     */
    List<ActivityEvaluationVo> selectPage(@Param("page") IPage page, @Param("param") ActivityEvaluationSearch activityEvaluation);

	List<ActivityEvaluationVo> selectAll(@Param("param") ActivityEvaluationSearch activityEvaluation);

    /**
     * 批量给活动添加曲目
     *
     * @param activityId
     * @param musicSheetIds
     * @return
     */
    Integer addBatch(@Param("activityId") Long activityId,@Param("userId") Long userId , @Param("musicSheetIds") List<Long> musicSheetIds, @Param("resourceType") String resourceType);

	/**
	 * 获取活动曲目信息
	 *
	 * @param activityPlanId 活动id
	 * @param userId         用户id
	 * @return
	 */
    List<ActivityMusicVo> selectActivityMusic(@Param("activityPlanId") Long activityPlanId, @Param("userId") Long userId);

	/**
	 * 获取活动排名用户信息
	 *
	 * @param activityPlanId 活动id
	 * @return
	 */
	List<ActivityMusicVo> selectActivityUser(@Param("activityPlanId") Long activityPlanId);

	/**
	 * 查询曲子
	 * @param page
	 * @param query
	 * @return
	 */
	List<MusicSheetVo> musicPage(@Param("page") IPage<MusicSheetVo> page, @Param("param") MusicSheetSearch query);

	/**
	 * 活动老师信息
	 * @param page IPage<ActivityTeacherWrapper>
	 * @param query ActivityTeacherQuery
	 * @return List<ActivityTeacherWrapper>
	 */
	List<ActivityTeacherWrapper> selectActivityTeacherPageInfo(@Param("page") IPage<ActivityTeacherWrapper> page, @Param("record") ActivityTeacherQuery query);

	/**
	 * 查询活动老师信息
	 * - 通过时间匹配
	 * @param page IPage<ActivityTeacherWrapper>
	 * @param query ActivityTeacherQuery
	 * @return List<ActivityTeacherWrapper>
	 */
	List<ActivityTeacherWrapper> selectActivityTeacherByTimePageInfo(@Param("page") IPage<ActivityTeacherWrapper> page, @Param("record") ActivityTeacherQuery query);

	/**
	 * 评测活动声部曲目最高分
	 * @param activityId 活动ID
	 * @param userId 用户ID
	 * @return List<StatGroupWrapper>
	 */
    List<StatGroupWrapper> selectSubjectMusicHighestScoreStat(@Param("activityId") Long activityId, @Param("userId") Long userId);
}