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

import com.ym.mec.biz.dal.dto.*;
import com.ym.mec.biz.dal.entity.SysMusicCompareRecord;
import com.ym.mec.biz.dal.entity.SysMusicCompareWeekData;
import com.ym.mec.biz.dal.enums.HeardLevelEnum;
import com.ym.mec.biz.dal.page.ExportCompareQueryInfo;
import com.ym.mec.common.dal.BaseDAO;
import org.apache.ibatis.annotations.Param;

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

public interface SysMusicCompareRecordDao extends BaseDAO<Long, SysMusicCompareRecord> {

    /**
     * @describe 获取用户训练汇总数据
     * @author Joburgess
     * @date 2021/8/11 0011
     * @param startTime:
     * @param endTime:
     * @return java.util.List<com.ym.mec.biz.dal.dto.MusicCompareRankingDto>
     */
    List<MusicCompareRankingDto> getUserTrainStat(@Param("startTime") String startTime,
                                                  @Param("endTime") String endTime,
                                                  @Param("heardLevel")HeardLevelEnum heardLevel);

    /**
     * @describe 获取用户最后一次评测数据
     * @author Joburgess
     * @date 2021/8/23 0023
     * @param userId:
     * @return com.ym.mec.biz.dal.entity.SysMusicCompareRecord
     */
    SysMusicCompareRecord getUserLastEvaluationData(@Param("userId") Integer userId);

    /**
     * @describe 获取用户训练总览
     * @author Joburgess
     * @date 2021/8/11 0011
     * @param userId:
     * @return com.ym.mec.biz.dal.dto.StudentTrainOverviewDto
     */
    StudentTrainOverviewDto getUserTrainOverView(@Param("userId") Integer userId);

    /**
     * @describe 获取用户训练图表数据
     * @author Joburgess
     * @date 2021/8/12 0012
     * @param userId:
     * @param startTime:
     * @param endTime:
     * @return java.util.List<com.ym.mec.biz.dal.dto.StudentTrainChartDto>
     */
    List<StudentTrainChartDto> getUserTrainChartData(@Param("userId") Integer userId,
                                                     @Param("startTime") String startTime,
                                                     @Param("endTime") String endTime);

    List<MusicCompareRankingDto> queryMusicGroupStudentTrainData(Map<String, Object> params);
    int countMusicGroupStudentTrainData(Map<String, Object> params);

    /**
     * 老师端首页学员训练统计
     * @param params
     * @return
     */
    List<CountStudentTrainDataDto> queryStudentTrain(Map<String, Object> params);

    /**
     * @describe 统计分部云教练新增人数
     * @author Joburgess
     * @date 2021/8/18 0018
     * @param organId:
     * @return int
     */
    int getOrganNewCloudStudyNum(@Param("organId") Integer organId);
    int getOrgansTotalNewCloudStudyNum(@Param("organIds") List<Integer> organIds);
    List<Map<Integer, Integer>> getOrgansNewCloudStudyNum(@Param("organIds") List<Integer> organIds);

    /**
     * @describe 统计用户指定周训练数据
     * @author Joburgess
     * @date 2021/8/30 0030
     * @param userId:
     * @param monday:
     * @return com.ym.mec.biz.dal.entity.SysMusicCompareWeekData
     */
    SysMusicCompareWeekData getUserWeekCompareData(@Param("userId") Integer userId,
                                                   @Param("monday") String monday);

    /**
     * @describe 获取用户本周最高分对应曲目编号
     * @author Joburgess
     * @date 2021/8/30 0030
     * @param userId:
     * @param monday:
     * @param heardLevel:
     * @return java.lang.Integer
     */
    Integer getUserWeekMaxMusicScoreId(@Param("userId") Integer userId,
                                       @Param("monday") String monday,
                                        @Param("heardLevel") HeardLevelEnum heardLevel);
    
    int queryCurrentDatePlayTimeByUserId(Integer userId);

    List<ExportCompareRecordDto> exportCompareRecord(@Param("queryInfo") ExportCompareQueryInfo queryInfo);

    int countExportCompareRecord(@Param("queryInfo") ExportCompareQueryInfo queryInfo);
}
