package com.huatek.busi.dao;

import com.huatek.busi.entity.BusiOfflineGeneratorBrand;
import com.huatek.busi.entity.BusiOfflineTransformerBrand;
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;

/**
 * 变压器标牌信息 Dao
 * 
 * @author walker_wang
 *
 */
@Repository
public class BusiOfflineGeneratorBrandDao extends BaseDao<BusiOfflineGeneratorBrand, String> {

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