package com.huatek.busi.dao;

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

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

/**
 * 避雷器-界面实时监测基础信息 Dao
 *
 * @author anker_cheng
 * @date Jul 1, 2019 2:17:35 PM
 */
@Repository
public class  RptAretMonitorDao extends BaseDao<RptAretMonitor, String> {

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

