package com.huatek.busi.dao;

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

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

/**
 * 避雷器标牌信息表 Dao
 *
 * @author anker_cheng
 * @date Jul 17, 2019 4:45:53 PM
 */
@Repository
public class  BusiOfflineArresterBrandDao extends BaseDao<BusiOfflineArresterBrand, String> {

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

