package com.microservices.dms.resourceLibrary.mapper;

import com.microservices.common.datasource.annotation.Slave;
import com.microservices.dms.achievementLibrary.domain.KeyValueVo;
import com.microservices.dms.resourceLibrary.domain.CompetitionResourceLibrary;
import com.microservices.dms.resourceLibrary.domain.vo.CompetitionListVo;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Mapper
@Slave
public interface CompetitionResourceLibraryMapper {

    List<UserActionDataVo> selectRegisterCondition(UserActionDataVo clicker);

    List<UserActionDataVo> selectOpusCondition(UserActionDataVo searcher);

    Long countRegisterCondition(UserActionDataVo clicker);

    Long  countOpusCondition(UserActionDataVo searcher);

    List<CompetitionListVo> selectCompetitionListCondition(CompetitionListVo downloader);

    CompetitionResourceLibrary selectCompetitionResourceLibraryById(Long id);

    List<CompetitionResourceLibrary> selectCompetitionResourceLibraryList(CompetitionResourceLibrary competitionResourceLibrary);

    int insertCompetitionResourceLibrary(CompetitionResourceLibrary competitionResourceLibrary);

    int updateCompetitionResourceLibrary(CompetitionResourceLibrary competitionResourceLibrary);

    int deleteCompetitionResourceLibraryById(Long id);

    int deleteCompetitionResourceLibraryByIds(Long[] ids);

    List<KeyValVo<String, String>> getAttachments(@Param("id") Long id);

    long getTotalOpenCompetitions();

    long getTotalCompetitionAchievements();

    long getTotalCompetitionSubmissions();

    long getTotalFinishedCompetitions();

    long getReviewCompetitionCount();

    Long getCompetitionFinish();

    Long getCompetitionEnroll();

    Long getCompetitionUnderway();

    Long getCompetitionSubmitCount();

    Long getCompetitionTransferCount();

    Long getCompetitionNeedAuditCount();

    List<KeyValueVo> getCompetitionStatisticYearly();

    List<Map<String,Object>> getCompetitionHot();

    List<KeyValVo<String, Long>> getCompetitionYearlyPaperAdd(@Param("s") Date s, @Param("e") Date e);

    List<KeyValVo<String, Long>> getCompetitionYearlyFinish(@Param("s") Date s, @Param("e") Date e);
}
