package com.huatek.busi.dao;

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

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

/**
 * 变压器局部放电暂存数据(  类型编码 ：021001) Dao
 *
 * @author anker_cheng
 * @date Jun 26, 2019 6:32:04 PM
 */
@Repository
public class  TransformerPdCacheDao extends BaseDao<TransformerPdCache, String> {

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

