package com.huatek.busi.dao;

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

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

/**
 * 变压器气象数据统计 Dao
 *
 * @author anker_cheng
 * @date Oct 28, 2019 12:30:37 PM
 */
@Repository
public class TransformerMeteorologicalStatisticsDao extends BaseDao<TransformerMeteorologicalStatistics, String> {

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