package com.docus.server.archive.mapper;


import com.docus.server.archive.dto.PatientState;
import com.docus.server.archive.entity.AfCollectTask;
import com.docus.server.archive.entity.BasicExtend;
import com.docus.server.archive.entity.TBasic;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface TBasicMapper {


    int invalidFileBySource(@Param("patientId") String patientId,@Param("collectorId") String collectorId);

    List<TBasic> getTbasicByReportTimeAndInpNoOrIdCard(@Param("sendDateStr") String sendDateStr,@Param("idCard") String idCard,@Param("inpatientNo") String inpatientNo);

    List<TBasic> getTbasicByPatientIds(@Param("patientIds") List<String> patientIds);


    int deleteTaskByPatAndSource(@Param("patientId")String patientId, @Param("collectorId")String collectorId);

    int flushPatTaskEndTime(@Param("patientId")String patientId,@Param("dateTime")String dateTime);

    List<AfCollectTask> getCollectTaskByPatAndSource(@Param("patientId")String patientId, @Param("collectorId") String collectorId);

    int delTaskById(@Param("id") Long id);

    int insertCollectTask(@Param("task") AfCollectTask task);

    int updateTaskById(@Param("task") AfCollectTask task);

    List<String> findFailedTaskPatId(@Param("collectorId") String collectorId,@Param("startDate") String startDateStr);

    List<BasicExtend> getZyPatientIdsByYzyJzh(@Param("preJzhs") List<String> preJzhs);

    int mergeYzyFile(@Param("yzhPatientId") String yzhPatientId, @Param("zyPatientId") String zyPatientId);

    List<String> getYzyPatientIdFromScanAssort();

    List<TBasic> getNoTaskPatientByDisDate(@Param("startDateTime") String startDateTime,@Param("collectorId") String collectorId);

    int cancelTask(@Param("patientId") String patientId, @Param("sysflag") String collectorId);

    PatientState getPatientState(@Param("patientId")  String patientId);

    int updateTaskRemarkById(@Param("id") Long id,@Param("remark") String remark);
}
