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

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 com.zcloud.personnel.positioning.persistence.mapper.PersonnelMatchMapper;
import com.zcloud.personnel.positioning.persistence.repository.PersonnelMatchRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;

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

@Repository
@RequiredArgsConstructor
public class PersonnelMatchRepositoryImpl implements PersonnelMatchRepository {
    private final PersonnelMatchMapper personnelMatchMapper;

    @Override public long countActive(String code) { return personnelMatchMapper.countActive(code); }
    @Override public long countAll() { return personnelMatchMapper.countAll(); }
    @Override public long countMatched() { return personnelMatchMapper.countMatched(); }
    @Override public LocalDateTime maxLastSyncTime(String code) { return personnelMatchMapper.maxLastSyncTime(code); }
    @Override public void upsert(Map<String, Object> params) { personnelMatchMapper.upsert(params); }
    @Override public void disableMissing(String code, LocalDateTime time) { personnelMatchMapper.disableMissing(code, time); }
    @Override public int updateOnline(String code, String terminalNo, String status, LocalDateTime time) {
        return personnelMatchMapper.updateOnline(code, terminalNo, status, time);
    }
    @Override public void markStaleOffline(String code, LocalDateTime time) {
        personnelMatchMapper.markStaleOffline(code, time);
    }
    @Override public List<PersonnelMappingSnapshotDO> listMatched(Map<String, Object> params) {
        return personnelMatchMapper.listMatched(params);
    }
    @Override public List<PersonnelLocalPersonDO> listPeopleByPhones(List<String> values) {
        return personnelMatchMapper.listPeopleByPhones(values);
    }
    @Override public List<PersonnelLocalPersonDO> listPeopleByTerminalNos(List<String> values) {
        return personnelMatchMapper.listPeopleByTerminalNos(values);
    }
    @Override public List<TerminalBindingSnapshotDO> listTerminalBindingsByIdCardNos(List<String> values) {
        return personnelMatchMapper.listTerminalBindingsByIdCardNos(values);
    }
    @Override public List<TerminalLocationSnapshotDO> listTerminals(List<String> values) {
        return personnelMatchMapper.listTerminals(values);
    }
}
