package com.huatek.frame.base.mapper;

import com.huatek.frame.base.entity.ModelComponentData;
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;

@Repository
public class ModelComponentDataDao extends BaseDao<ModelComponentData, String> {
    public int saveOrUpdate(ModelComponentData entity) {
        if (StringUtils.isEmpty(entity.getId())) {
            entity.setId(Uuid.getUUID());
            return this.add(entity);
        }
        return this.updateLocal(entity);
    }
}
