package com.huatek.busi.dao;

import com.huatek.busi.entity.TransformerInfraredMonitoringStatistics;
import com.huatek.busi.entity.TransformerWindingTemperatureStatistics;
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 28, 2019 11:30:57 AM
 */
@Repository
public class TransformerWindingTemperatureStatisticsDao
    extends BaseDao<TransformerWindingTemperatureStatistics, String> {

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