package com.huatek.busi.dao;

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

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

/**
 * 铁芯接地日统计表 Dao
 *
 * @author anker_cheng
 * @date Jul 29, 2019 3:40:15 PM
 */
@Repository
public class TransformerIcgeStatisticsDao extends BaseDao<TransformerIcgeStatistics, String> {

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