package com.huatek.busi.dao;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;

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

/**
 * 考评指标配置 Dao
 *
 * @author anker_cheng
 * @date Jul 23, 2019 9:50:17 AM
 */
@Repository
public class  BusiEvaMonitorConfigDao extends BaseDao<BusiEvaMonitorConfig, String> {

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

