package com.huatek.busi.mapper.cable;

import com.huatek.busi.dto.cable.BusiOtherThresholdDto;
import com.huatek.busi.entity.BusiOtherThreshold;
import com.huatek.busi.vo.cable.BusiOtherThresholdVo;
import com.huatek.busi.vo.cable.CableCirculationDataVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 电缆环流阈值 Mapper
 *
 * @author Bobi_huo
 * @date 2020-09-16 13:22
 */
@Repository
public interface BusiOtherThresholdMapper {

    /**
     * 根据站点设备树ID获取变压器铁芯、夹件阈值
     *
     * @param dto
     * @return
     */
    BusiOtherThresholdVo getOtherThresholdVo(BusiOtherThresholdDto dto);

    /**
     * 根据站点设备树ID获取变压器铁芯、夹件阈值
     *
     * @param dto
     * @return
     */
    BusiOtherThresholdVo getGrowthRate(BusiOtherThresholdDto dto);

    int deleteOtherThreshold(BusiOtherThresholdDto dto);

    /**
     * 根据站点设备树ID获取其他阈值
     *
     * @param mainTreeId
     * @param runState
     * @param sensorCode
     * @return
     */
    BusiOtherThreshold getOtherThreshold(@Param("mainTreeId") String mainTreeId,
                                         @Param("runState") String runState, @Param("sensorCode") String sensorCode);

    /**
     * 根据sensor编码更新其他阈值
     *
     * @param oldSensorCode
     * @param newSensorCode
     * @return
     */
    int updateOtherThresholdBySensorCode(@Param("oldSensorCode") String oldSensorCode,@Param("newSensorCode") String newSensorCode);

    /**
     * 根据sensor编码删除其他阈值
     *
     * @param sensorCode
     * @return
     */
    int delOtherThresholdBySensorCode(@Param("sensorCode") String sensorCode);

    /**
     * 根据sensorCode获取当前数据
     *
     * @param sensorCode
     * @return
     */
    CableCirculationDataVo getCableData(@Param("sensorCode") String sensorCode,@Param("runStatus") String runStatus);

    CableCirculationDataVo getCableDataForCable(@Param("sensorCode") String sensorCode,@Param("runStatus") String runStatus);

    BusiOtherThresholdVo selectBySensorCode(@Param("sensorCode") String sensorCode);

    BusiOtherThreshold getCableThreshold(@Param("sensorCode") String sensorCode);

}
