package com.ruoyi.bst.modelSuit.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.bst.modelSuit.domain.ModelSuit;
import com.ruoyi.bst.modelSuit.domain.ModelSuitQuery;
import com.ruoyi.bst.modelSuit.domain.ModelSuitVO;
import com.ruoyi.bst.modelSuit.mapper.ModelSuitMapper;
import com.ruoyi.bst.modelSuit.service.ModelSuitService;
import com.ruoyi.common.utils.collection.CollectionUtils;

/**
 * 车型套餐关联Service业务层处理
 *
 * @author ruoyi
 * @date 2025-04-23
 */
@Service
public class ModelSuitServiceImpl implements ModelSuitService
{
    @Autowired
    private ModelSuitMapper modelSuitMapper;

    /**
     * 查询车型套餐关联
     *
     * @param id 车型套餐关联主键
     * @return 车型套餐关联
     */
    @Override
    public ModelSuitVO selectModelSuitById(Long id)
    {
        return modelSuitMapper.selectModelSuitById(id);
    }

    /**
     * 查询车型套餐关联列表
     *
     * @param modelSuit 车型套餐关联
     * @return 车型套餐关联
     */
    @Override
    public List<ModelSuitVO> selectModelSuitList(ModelSuitQuery modelSuit)
    {
        return modelSuitMapper.selectModelSuitList(modelSuit);
    }

    /**
     * 新增车型套餐关联
     *
     * @param modelSuit 车型套餐关联
     * @return 结果
     */
    @Override
    public int insertModelSuit(ModelSuit modelSuit)
    {
        return modelSuitMapper.insertModelSuit(modelSuit);
    }

    /**
     * 修改车型套餐关联
     *
     * @param modelSuit 车型套餐关联
     * @return 结果
     */
    @Override
    public int updateModelSuit(ModelSuit modelSuit)
    {
        return modelSuitMapper.updateModelSuit(modelSuit);
    }

    /**
     * 批量删除车型套餐关联
     *
     * @param ids 需要删除的车型套餐关联主键
     * @return 结果
     */
    @Override
    public int deleteModelSuitByIds(Long[] ids)
    {
        return modelSuitMapper.deleteModelSuitByIds(ids);
    }

    /**
     * 删除车型套餐关联信息
     *
     * @param id 车型套餐关联主键
     * @return 结果
     */
    @Override
    public int deleteModelSuitById(Long id)
    {
        return modelSuitMapper.deleteModelSuitById(id);
    }

    /**
     * 批量删除车型套餐关联
     *
     * @param suitIds 需要删除的套餐ID集合
     * @return 结果
     */
    @Override
    public int deleteModelSuitBySuitIds(List<Long> suitIds)
    {
        if (CollectionUtils.isEmptyElement(suitIds)) {
            return 0;
        }
        return modelSuitMapper.deleteModelSuitBySuitIds(suitIds);
    }

    /**
     * 批量删除车型套餐关联
     *
     * @param modelIds 需要删除的车型ID集合
     * @return 结果
     */
    @Override
    public int deleteModelSuitByModelIds(List<Long> modelIds)
    {
        if (CollectionUtils.isEmptyElement(modelIds)) {
            return 0;
        }
        return modelSuitMapper.deleteModelSuitByModelIds(modelIds);
    }

    /**
     * 批量新增车型套餐关联
     *
     * @param modelSuitList 车型套餐关联集合
     * @return 结果
     */
    @Override
    public int batchInsert(List<ModelSuit> modelSuitList)
    {
        if (CollectionUtils.isEmptyElement(modelSuitList)) {
            return 0;
        }
        return modelSuitMapper.batchInsert(modelSuitList);
    }
}
