package com.huatek.busi.dao;

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

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

/**
 * 变压器运行工况数据统计 Dao
 *
 * @author anker_cheng
 * @date Oct 28, 2019 2:05:37 PM
 */
@Repository
public class TransformerRunStatusStatisticsDao extends BaseDao<TransformerRunStatusStatistics, String> {

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