package com.huatek.busi.mapper;

import com.huatek.busi.dto.cable.BusiCableThresholdDto;
import com.huatek.busi.entity.BusiCableThreshold;
import com.huatek.busi.vo.cable.BusiCableThresholdVo;
import com.huatek.busi.vo.cable.CableCirculationDataVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface BusiCableThresholdMapper {

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

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

    int deleteCableThreshold(BusiCableThresholdDto dto);

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

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

    BusiCableThreshold getCableBySensorCodeThreshold(@Param("sensorCode") String sensorCode);

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

}
