package com.huatek.busi.dao;

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

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

/**
 * GIS气象实时数据展示 Dao
 *
 * @author anker_cheng
 * @date Jun 28, 2019 4:19:31 PM
 */
@Repository
public class SubstationMicGisNowDao extends BaseDao<SubstationMicGisNow, String> {

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