package com.huatek.busi.dao;

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

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

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