package com.huatek.busi.dao;

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

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

/**
 * 变压器投运验收结论 Dao
 *
 * @author anker_cheng
 * @date Jul 4, 2019 2:00:00 PM
 */
@Repository
public class  BusiOfflineTransformerCheckDao extends BaseDao<BusiOfflineTransformerCheck, String> {

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

