package com.zcloud.personnel.positioning.persistence.repository;

import com.zcloud.personnel.positioning.persistence.dataobject.PersonnelLocalPersonDO;
import com.zcloud.personnel.positioning.persistence.dataobject.PersonnelMappingSnapshotDO;
import com.zcloud.personnel.positioning.persistence.dataobject.TerminalBindingSnapshotDO;
import com.zcloud.personnel.positioning.persistence.dataobject.TerminalLocationSnapshotDO;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

public interface PersonnelMatchRepository {
    long countActive(String sourceConfigCode);

    long countAll();

    long countMatched();

    LocalDateTime maxLastSyncTime(String sourceConfigCode);

    void upsert(Map<String, Object> params);

    void disableMissing(String sourceConfigCode, LocalDateTime syncTime);

    int updateOnline(String sourceConfigCode, String terminalNo, String deviceStatus, LocalDateTime syncTime);

    void markStaleOffline(String sourceConfigCode, LocalDateTime syncTime);

    List<PersonnelMappingSnapshotDO> listMatched(Map<String, Object> params);

    List<PersonnelLocalPersonDO> listPeopleByPhones(List<String> values);

    List<PersonnelLocalPersonDO> listPeopleByTerminalNos(List<String> values);

    List<TerminalBindingSnapshotDO> listTerminalBindingsByIdCardNos(List<String> values);

    List<TerminalLocationSnapshotDO> listTerminals(List<String> values);
}
