package com.inspect.analysis.mapper;

import com.inspect.analysis.domain.*;
import com.inspect.partrolresult.domain.PatrolResult;
import com.inspect.task.domain.PatrolData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

@Mapper
public interface ResultAnalysisMapper {
    ResultAnalysis selectResultAnalysisByLineId(Long lineId);

    int selectResultAnalysisByMainId(Long mainId);

    List<ResultAnalysis> selectResultAnalysisList(ResultAnalysis resultAnalysis);

    List<ResultAnalysis> selectResultAnalysisListByMainId(ResultAnalysis resultAnalysis);

    List<ResultAnalysis> selectResultAnalysisListByMainIdNew(ResultAnalysis resultAnalysis);

    List<PatrolResult> selectResultAnd(ResultAnalysis resultAnalysis);

    Map<String, String> selectAlgorithmInfo(String key);

    Map<String, String> selectDeviceInfo(String key);

    Map<String, String> selectDeviceInfoByBj(String key);

    Map<String, String> selectPointInfoById(String id);

    List<Map<String, String>> selectChannelByEqId(String eqId);

    Map<String, Object> selectPointInfoByCode(String code);

    Map<String, Object> selectEqInfoByCode(String code);

    List<Map<String, Object>> selectEqInfoBySendCode(String sendCode);

    Map<String, String> selectStadPointInfoById(String id);

    int insertResultAnalysis(ResultAnalysis resultAnalysis);

    int insertAnalyseLog(AnalyseLog analyseLog);

    int updateResultAnalysis(ResultAnalysis resultAnalysis);

    int deleteResultAnalysisByLineId(Long lineId);

    int deleteResultAnalysisByLineIds(Long[] lineIds);

    List<Map<String, String>> defectList1();

    List<Map<String, String>> defectList2();

    List<Map<String, String>> defectList3();

    List<Map<String, String>> pointStatistics();

    ResultAnalysis selectTaskAbnormalData(ResultAnalysis resultAnalysis);

    List<Map<String, Object>> selectTaskAbnormalDataBatch(@Param("list") List<String> taskPatrolledIds);

    List<AlgPatrolPoint> selectResultAnalyseForAlarm(AnalyseSummaryAlarmModel alarmModel);

    List<PatrolData> selectResultAnalysisListForAlarm(AnalyseSummaryAlarmModel alarmModel);

    Long selectResultAnalysisListDefectInfo(@Param("filter") String filter,
                                                      @Param("isToday") String isToday,
                                                      @Param("type") String type);

    int selectResultAnalysisByMainIds(@Param("lineIds") List<Long> lineIds);

    List<ResultAnalysis> selectResultAnalysisListByMainIds(@Param("lineIds") List<Long> lineIds);

    List<ResultAnalysis> selectResultAnalysisListByMainIdsNew(@Param("lineIds") List<Long> lineIds, @Param("filter") String filter);

    List<ResultAnalysis> selectResultAnalysisListBatch(@Param("list") List<String> taskPatrolIds, @Param("resultType") String resultType);

    void updateResultAnalysisByCondition(ResultAnalysis analysis);

    List<ResultAnalysisSummaryDTO> countResultAnalysisSummary(@Param("list") List<String> taskPatrolIds);
}
