package com.huatek.busi.dao;

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

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

/**
 * 数据缺失率 Dao
 *
 * @author anker_cheng
 * @date Jul 15, 2019 3:43:18 PM
 */
@Repository
public class  FailureRateDao extends BaseDao<FailureRate, String> {

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

