package com.huatek.busi.dao;

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

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

/**
 * 避雷器-绝缘监测-阈值表：023001 Dao
 *
 * @author anker_cheng
 * @date Aug 5, 2019 5:29:06 PM
 */
@Repository
public class  ArresterInsulationMonitorThresholdDao extends BaseDao<ArresterInsulationMonitorThreshold, String> {

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

