package com.huatek.busi.dao;

import com.huatek.busi.entity.BusiCableCirculationCache;
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;

/**
 * @author Bobi_huo
 * @date 2020-11-24 13:35
 */
@Repository
public class BusiCableCirculationCacheDao extends BaseDao<BusiCableCirculationCache, String> {

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