package org.jeecg.modules.sensor.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.bigScreen.controller.bigScreenController;
import org.jeecg.modules.bigScreen.model.SensorTemperature;
import org.jeecg.modules.bigScreen.model.TableStructure;
import org.jeecg.modules.sensor.entity.BuSensor;
import org.jeecg.modules.sensor.model.DeviceDataRequest;
import org.jeecg.modules.sensor.model.TableNameStatistics;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * @Description: 传感器信息表
 * @Author: jeecg-boot
 * @Date:   2020-12-23
 * @Version: V1.0
 */
public interface IBuSensorService extends IService<BuSensor> {

	/**
	 * 删除一对多
	 */
	public void delMain (String id);

	/**
	 * 批量删除一对多
	 */
	public void delBatchMain (Collection<? extends Serializable> idList);

    public List<BuSensor> getDataByName(String name);

    public List<String> getBatteryVoltage(String deviceName);

    public BuSensor getValueById(String deviceId,String item);

    public List<String> getIpByName(String deviceName);
    public List<String> getHeightIpByName(String deviceName);
    public List<String> getElectricIpByName(String deviceName);

    public List<TableNameStatistics> getDataByDeviceId(String deviceId);
    public List<TableNameStatistics> getItemByDeviceId(String deviceId);

    public BuSensor getDataByTypeId(String typeId);

    public BuSensor getDataByIp(String ip);
    //查询设备状态
    public List<String> getNormalStatus();
    public List<BuSensor> getEarlyStatus();
    public List<BuSensor> getAlarmStatus();
    public List<BuSensor> getRepairStatus();
    //查询传感器电池电压
    public List<BuSensor> getPowerData();
    //查询传感器主板温度
    public List<BuSensor> getBoardData();

    //根据设备id和检测项目查询传感器信息
    public BuSensor getByCheckItem(String deviceId,String checkItem);
    //根据设备id和检测项目查询传感器信息
    public List<BuSensor> getByCheckName(String deviceId,String name);
    //根据设备id和传感器id
    public BuSensor getBySensorId(String deviceId,String sensorId);
    public BuSensor getByCode(String deviceId,String code);
    // 查询所有振动传感器ip
    public List<String> getVibrationSensorIp();
    // 查询振动传感器温度
    public double getTemperature(String tableName);

    public List<DeviceDataRequest> getDeviceData(String tableName,String ip,String beginTime,String endTime);
    //获取异常数据信息
    public SensorTemperature getTestClassData(String tableName, String dataId);
    //
    public List<TableStructure> getTableStrutureData(String tableName);

    public Map<String, Object> getValueByField(String tableName, String dataId, String field);

    public BuSensor getCodeData(String sensorId);

}
