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.TransformerMeteorologicalCache;

/**
 * 变压器气象实时数据 Dao
 *
 * @author anker_cheng
 * @date Jun 28, 2019 4:19:31 PM
 */
@Repository
public class TransformerMeteorologicalCacheDao extends BaseDao<TransformerMeteorologicalCache, String> {

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