package com.inspect.taskstatus.mapper;

import com.inspect.calender.domain.DailyTaskStatsDTO;
import com.inspect.calender.domain.MonthlyTaskStatsDTO;
import com.inspect.taskstatus.domain.PatrolTaskStatus;
import com.inspect.taskstatus.domain.TaskCount;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

@Mapper
public interface PatrolTaskStatusMapper {
    PatrolTaskStatus selectPatrolTaskStatusByLineId(Long lineId);

    PatrolTaskStatus selectPatrolTaskStatusByTaskPatrolledId(String taskPatrolledId);

    List<PatrolTaskStatus> selectPatrolTaskStatusList(PatrolTaskStatus patrolTaskStatus);

    List<PatrolTaskStatus> selectPatrolTaskStatusCount(PatrolTaskStatus patrolTaskStatus);

    List<TaskCount> selectCountList(PatrolTaskStatus patrolTaskStatus);

    List<TaskCount> selectCountListByDate(PatrolTaskStatus patrolTaskStatus);

    int insertPatrolTaskStatus(PatrolTaskStatus patrolTaskStatus);

    int updatePatrolTaskStatus(PatrolTaskStatus patrolTaskStatus);

    int updatePatrolTaskStatusOfTaskProgress(PatrolTaskStatus patrolTaskStatus);

    int updatePatrolTaskStatusOfTaskState(PatrolTaskStatus patrolTaskStatus);

    int updatePatrolTaskStatusOfTaskStateAndEndTime(PatrolTaskStatus patrolTaskStatus);

    int updatePatrolTaskStatusRunning(PatrolTaskStatus patrolTaskStatus);

    int deletePatrolTaskStatusByLineId(Long lineId);

    int deletePatrolTaskStatusByLineIds(Long[] lineIds);

    List<PatrolTaskStatus> selectPatrolTaskStatusListByTaskPatrolledIds(@Param("taskPatrolledIds") List<String> taskPatrolledIds);

    List<MonthlyTaskStatsDTO> countMonthlyStatsByYear(Integer year);

    List<DailyTaskStatsDTO> selectDailyStatsByYearAndMonth(@Param("year") Integer year, @Param("month") Integer month);

    List<DailyTaskStatsDTO> selectDailyStatsByYearAndMonthAndDay(@Param("year") Integer year, @Param("month") Integer month, @Param("day") Integer day);

    int insertIgnorePatrolTaskStatus(PatrolTaskStatus patrolTaskStatusMain);

    List<PatrolTaskStatus> selectPatrolTaskStatusListByMainId(String taskPatrolledId);

    PatrolTaskStatus selectPatrolTaskStatusMain(String taskPatrolledId);

    List<Map<String, String>> selectTotalPointsAndAlgs(String taskCode);

    List<Map<String, String>> selectExecutedPointsAndAlgs(String taskPatrolledId);
}
