package com.huatek.busi.dao;

import com.huatek.busi.entity.BusiOfflineGeneratorRepair;
import com.huatek.busi.entity.BusiOfflineTransformerRepair;
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 anker_cheng
 * @date Jul 4, 2019 2:00:00 PM
 */
@Repository
public class BusiOfflineGeneratorRepairDao extends BaseDao<BusiOfflineGeneratorRepair, String> {

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

