package com.huatek.busi.dao;

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

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

@Repository
public class BusiTransformerLoadDao extends BaseDao<BusiTransformerLoad, String> {

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