package com.huatek.busi.dao;

import com.huatek.busi.entity.GisSf6EnvMonitoringStatistics;
import com.huatek.busi.entity.GisSf6IncreaseRateCache;
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;

/**
 * sf6Env
 *
 * @author vent
 * @date 2023-04-19
 */
@Repository
public class GisSf6EnvMonitoringStatisticsDao extends BaseDao<GisSf6EnvMonitoringStatistics, String> {

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