package com.huatek.busi.service.impl.cable;

import cn.hutool.core.bean.BeanUtil;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.huatek.busi.common.util.DecimalUtil;
import com.huatek.busi.dao.BusiCableCirculationCacheDao;
import com.huatek.busi.dto.cable.BusiCableCirculationCacheDto;
import com.huatek.busi.entity.BusiCableCirculation;
import com.huatek.busi.entity.BusiCableCirculationCache;
import com.huatek.busi.entity.EquipmentTemperatureCache;
import com.huatek.busi.mapper.cable.BusiCableCirculationCacheMapper;
import com.huatek.busi.mapper.cable.EquipmentTemperatureCacheMapper;
import com.huatek.busi.service.cable.BusiCableCirculationCacheService;
import com.huatek.busi.service.transformer.EquipmentTemperatureCacheService;
import com.huatek.busi.vo.cable.BusiCableCirculationCacheVo;
import com.huatek.torch.util.uuid.Uuid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.math.RoundingMode;

/**
 * @author Bobi_huo
 * @date 2020-11-24 11:19
 */
@Component
@Service(interfaceClass = EquipmentTemperatureCacheService.class)
@Transactional(rollbackFor = Exception.class)
public class EquipmentCacheServiceImpl implements EquipmentTemperatureCacheService {


    @Autowired
    EquipmentTemperatureCacheMapper equipmentTemperatureCacheMapper;
    @Autowired
    EquipmentTemperatureCacheService equipmentTemperatureCacheService;

    @Override
    public EquipmentTemperatureCache findSensorCode(String sensorId) {
       EquipmentTemperatureCache equipmentTemperatureCache =equipmentTemperatureCacheMapper.findByTreeId(sensorId);
        return equipmentTemperatureCache;
    }

    @Override
    public int addSensor(EquipmentTemperatureCache equipmentTemperatureCache) {
        int count = equipmentTemperatureCacheMapper.addSensor(equipmentTemperatureCache);
        return count;
    }

    @Override
    public int updateSenSor(EquipmentTemperatureCache findSensorCode) {
        int count = equipmentTemperatureCacheMapper.updateSensor(findSensorCode);
        return count;
    }


}
