package com.huatek.busi.dao;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Repository;

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

/**
 * 出场线（避雷器）——检修单 Dao
 *
 * @author anker_cheng
 * @date Jul 8, 2019 4:38:16 PM
 */
@Repository
public class  BusiOfflineArresterRepairDao extends BaseDao<BusiOfflineArresterRepair, String> {

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

