package com.huatek.busi.dao;

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

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

/**
 * 电容型设备——绝缘监测：022001实时数据表 Dao
 *
 * @author anker_cheng
 * @date Oct 28, 2019 7:01:53 PM
 */
@Repository
public class CapacitanceEquipmentImCacheDao extends BaseDao<CapacitanceEquipmentImCache, String> {

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