package com.huatek.busi.dao;

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

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

/**
 * 告警详情表 Dao
 *
 * @author anker_cheng
 * @date Aug 6, 2019 2:45:50 PM
 */
@Repository
public class  BusiEqmWarningInfoDao extends BaseDao<BusiEqmWarningInfo, String> {

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

