package com.huatek.busi.dao;

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

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

/**
 * 变压器红外测温时间 Dao
 *
 * @author anker_cheng
 * @date Jun 28, 2019 1:20:56 PM
 */
@Repository
public class BusiTransfromTemperatureExcessDao extends BaseDao<BusiTransfromTemperatureExcess, String> {

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