package com.microservices.dms.resourceLibrary.mapper;

import com.microservices.common.datasource.annotation.Slave;
import com.microservices.dms.resourceLibrary.domain.*;
import com.microservices.dms.resourceLibrary.domain.vo.KeyValVo;
import com.microservices.dms.resourceLibrary.domain.vo.TaskListVo;
import com.microservices.dms.resourceLibrary.domain.vo.UserActionDataVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


@Slave
@Mapper
public interface TaskResourceLibraryMapper {

    int insertClicker(Clicker record);
    long countClicker(Clicker record);
    long countClickerSimple(Clicker record);
    int insertSearcher(Searcher record);

    int insertDownloader(Downloader record);

    List<UserActionDataVo> selectClickerCondition(UserActionDataVo clicker);

    List<UserActionDataVo> selectVisitCondition(UserActionDataVo clicker);

    List<UserActionDataVo> selectSearcherCondition(UserActionDataVo searcher);

    List<UserActionDataVo> selectDownloaderCondition(UserActionDataVo downloader);

    List<UserActionDataVo> selectWatcherCondition(UserActionDataVo watcher);

    List<UserActionDataVo> selectPapersCondition(UserActionDataVo paper);

    List<UserActionDataVo> selectTaskJournalsCondition(UserActionDataVo taskJournals);

    List<TaskListVo> selectTaskListCondition(TaskListVo taskListVo);

    long countClickerCondition(UserActionDataVo clicker);

    long countVisitCondition(UserActionDataVo clicker);

    long countSearcherCondition(UserActionDataVo searcher);

    long countDownloaderCondition(UserActionDataVo downloader);

    long countWatcherCondition(UserActionDataVo watcher);

    long countPapersCondition(UserActionDataVo paper);

    long countTaskJournalsCondition(UserActionDataVo taskJournals);

    TaskResourceLibrary selectTaskResourceLibraryById(Long id);

    List<TaskResourceLibrary> selectTaskResourceLibraryList(TaskResourceLibrary taskResourceLibrary);

    int insertTaskResourceLibrary(TaskResourceLibrary taskResourceLibrary);

    int updateTaskResourceLibrary(TaskResourceLibrary taskResourceLibrary);

    int deleteTaskResourceLibraryById(Long id);

    int deleteTaskResourceLibraryByIds(Long[] ids);

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

    /**
     * 获取任务总数
     *
     * @return 任务总数
     */
    long getTotalTasks();

    /**
     * 获取转换成果任务金额
     *
     * @return 转换成果任务金额
     */
    double getConvertedTaskAmount();

    /**
     * 获取任务转换成果数
     *
     * @return 任务转换成果数
     */
    long getConvertedTasksCount();

    /**
     * 获取任务金额
     *
     * @return 任务金额
     */
    Double getTaskAmount();

    /**
     * 获取需评审任务数
     *
     * @return 需评审任务数
     */
    long getReviewTaskCount();

    int insertFavorite(Favorite favorite);

    int insertWatcher(Watcher watcher);

    int delFavorite(Favorite favorite);

    int delWatcher(Watcher watcher);

    double getConvertedTaskAmount2();
}
