package com.huatek.busi.dao;

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

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

/**
 * 避雷器气象实时数据表 Dao
 *
 * @author anker_cheng
 * @date Jun 28, 2019 4:19:31 PM
 */
@Repository
public class  ArresterMeteorologicalCacheDao extends BaseDao<ArresterMeteorologicalCache, String> {

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

