package com.huatek.busi.dao;

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

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

/**
 * 局部放电统计 Dao
 *
 * @author anker_cheng
 * @date Oct 25, 2019 2:48:37 PM
 */
@Repository
public class TransformerPdStatisticsDao extends BaseDao<TransformerPdStatistics, String> {

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