package com.ho.business.service.impl;

import com.ho.business.entity.TopologyJumpConfig;
import com.ho.business.mapper.TopologyJumpConfigMapper;
import com.ho.business.service.TopologyJumpConfigService;
import com.ho.business.vo.req.topologyJumpConfig.TopologyJumpConfigReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TopologyJumpConfigServiceImpl implements TopologyJumpConfigService {

    @Autowired
    TopologyJumpConfigMapper topologyJumpConfigMapper;

    @Override
    public List<TopologyJumpConfig> selectByParam(TopologyJumpConfigReq vo) {
        List<TopologyJumpConfig> list = topologyJumpConfigMapper.selectByParam(vo);
        return list;
    }

    @Override
    public int saveOrUpdateTopologyJumpConfig(TopologyJumpConfig vo) {
        int count = 0;
        if(vo.getId()!=null){
            count = topologyJumpConfigMapper.updateById(vo);
        }else{
            count = topologyJumpConfigMapper.insertOne(vo);
        }
        return count;
    }

    @Override
    public int insertList(List<TopologyJumpConfig> list) {
        int count = topologyJumpConfigMapper.insertList(list);
        return count;
    }

    @Override
    public int updateById(TopologyJumpConfig vo) {
        int count = topologyJumpConfigMapper.updateById(vo);
        return count;
    }

    @Override
    public int deleteByList(List<Integer> ids) {
        int count = topologyJumpConfigMapper.deleteByList(ids);
        return count;
    }
}
