package com.huatek.busi.dao;

import com.huatek.busi.entity.DataOutputEntitySimulation;
import com.huatek.busi.entity.DataOutputEntityWarning;
import com.huatek.torch.sql.dao.impl.BaseDao;
import com.huatek.torch.util.uuid.Uuid;
import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;

/**
 * 数据输出记录 Dao
 *
 * @author anker_cheng
 * @date Oct 12, 2019 9:57:47 AM
 */
@Repository
public class DataOutputWarningEntityDao extends BaseDao<DataOutputEntityWarning, String> {

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