package com.huatek.busi.dao;

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

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

/**
 * 变压器油色谱增长率暂存数据（类型编码 ：021002） Dao
 *
 * @author anker_cheng
 * @date Jul 15, 2019 11:13:43 AM
 */
@Repository
public class  TransformerEpaIncreaseCacheDao extends BaseDao<TransformerEpaIncreaseCache, String> {

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

