package com.huatek.busi.dao;

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

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

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

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

