package com.huatek.busi.dao;

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

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

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

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

