package com.huatek.busi.dao;

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

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

/**
 * 变压器铁芯接地电流暂存数据(类型编码 ：021004) Dao
 *
 * @author anker_cheng
 * @date Jun 27, 2019 6:53:42 PM
 */
@Repository
public class  TransformerIcgeCacheDao extends BaseDao<TransformerIcgeCache, String> {

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

