package com.huimv.eartag.service;

import com.huimv.eartag.dao.entity.*;

import java.text.ParseException;
import java.util.List;
import java.util.Map;

public interface ICacheService {
    //{}
    Object getDeviceCodeByChipId(String chipId);

    //
    boolean checkEffectiveDeviceSet(String idCode);

    //# 读根据设备编码读取牧场id
    Object getFarmIdByDeviceCode(String deviceCode);

    void putDeviceRegister(String deviceCode, EartagDeviceRegisterEntity deviceRegisterEntity);

//    void putDeviceRegister(String deviceCode, EartagDeviceRegisterEntity deviceRegisterEntity);

    void putEartagFlowToCache(String earmark, EartagDataEntity dataEntity);

    void putEartagRegister(String earmark, EartagEartagRegisterEntity eartagRegisterEntity);

    void putEartagTotal(Integer total, String farmId);

    Object getHashProperty(String hashKey, String fieldName);

    void putDeviceInOnline(String deviceCode, EartagDeviceOnlineEntity eartagDeviceOnlineEntity);

    void putEartagOnlineCount(String earmark, EartagEartagOnlineEntity eartagOnlineEntity);

    void countEartagDeviceOnlineTimes(String earmark, String deviceCode, int total, EartagDeviceEartagCountEntity deviceEartagCountEntity);

    Map<Object, Object> getHashEntries(String hashKey);

    void putHashKeyProperty(String hashKey, String fieldName, Object value);

    boolean isExistEartagOnlineSet(String farmId, String earmark, String todayDateText);

    void putEartagDeviceOnlineCount(String earmark, String deviceCode, String todayDateText, EartagDeviceEartagCountEntity deviceEartagCountEntity);

    Integer getDeviceTotal(String farmId);

    void putDeviceTotal(Integer total, String farmId);

    Integer getDeviceOnlineSum(String farmId, String todayDateText);

    Integer getDeviceCancel(String farmId);

    void putDeviceCancel(Integer total, String farmId);

    void flashAllStatusCache(String farmId, EartarFarmAllStatusEntity farmAllStatusEntity);

    Integer getEartagTotal(String farmId);

    Integer getEartagOnlineTotalFromCache(String farmId, String todayDateText);

    void putEartagToOnlineInSet(String farmId, String earmark, String todayDateText) throws ParseException;

    Object getEartagLastAct(String earmark);

    void putEartagAct(String earmark, String nowAct);

    boolean isExistDeviceOnlineSet(String farmId, String deviceCode, String todayDateText);

    void putDeviceToOnlineSet(String farmId, String deviceCode, String todayDateText);

    Object getEnvTempThresholdVal(String farmId);

    void deleteDeviceToOnlineSet(String farmId, String deviceCode, String todayDateText);

    Map getFarmAllStatusByFarmId(String farmId);

    void putFarmAllStatusCache(String farmId, EartarFarmAllStatusEntity farmAllStatusEntity);

    int getDeviceOnlineTotal(String farmId, String todayDateText);

    int getEartagOnlineTotal(String farmId, String todayDateText);

    void putDeviceTotal_(Integer effectiveDeviceTotal, String farmId);

    void putAllDeviceSet(String deviceCode);

    void putChipIdToCache(String chipId, String deviceCode);

    void deleteDeviceRegister(String deviceCode);

    void deleteDeviceCodeSetCache(String deviceCode);

    void deleteOnlineDeviceSet(String farmId, String deviceCode, String todayDateText);

    void deleteChipIdHashCache(String chipId);

    int isExistAllDeviceSet();

    boolean isExistDeviceCode(String deviceCode);

    void putAllDeviceSet(List list);
}
