package com.huatek.busi.dao;

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

import com.huatek.busi.entity.TemperIncreaseRateCache;
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 TemperIncreaseRateCacheDao extends BaseDao<TemperIncreaseRateCache, String> {

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