package com.huatek.busi.dao;

import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;

import com.huatek.torch.sql.dao.impl.BaseDao;
import com.huatek.torch.util.uuid.Uuid;
import com.huatek.busi.entity.TransformerInfraredMonitoringCache;

/**
 * 变压器红外监测暂存数据 Dao
 *
 * @author anker_cheng
 * @date Jun 28, 2019 1:20:56 PM
 */
@Repository
public class  TransformerInfraredMonitoringCacheDao extends BaseDao<TransformerInfraredMonitoringCache, String> {

    public int saveOrUpdate(TransformerInfraredMonitoringCache transformerInfraredMonitoringCache) {
        if(StringUtils.isEmpty(transformerInfraredMonitoringCache.getId())) {
            transformerInfraredMonitoringCache.setId(Uuid.getUUID());
            return this.add(transformerInfraredMonitoringCache);
        }
        return this.updateLocal(transformerInfraredMonitoringCache);
    }
}

