package com.ruoyi.manage.service.impl;

import java.util.List;


import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manage.mapper.BaseManufacturerMapper;
import com.ruoyi.manage.domain.BaseManufacturer;
import com.ruoyi.manage.service.IBaseManufacturerService;
import com.ruoyi.common.core.text.Convert;

/**
 * 轮挡厂家管理Service业务层处理
 *
 * @author wangh
 * @date 2023-12-18
 */
@Service("baseManufacturerService")
public class BaseManufacturerServiceImpl implements IBaseManufacturerService {
    @Autowired
    private BaseManufacturerMapper baseManufacturerMapper;

    /**
     * 查询轮挡厂家管理
     *
     * @param manufacturerId 轮挡厂家管理主键
     * @return 轮挡厂家管理
     */
    @Override
    public BaseManufacturer selectBaseManufacturerByManufacturerId(Long manufacturerId) {
        return baseManufacturerMapper.selectBaseManufacturerByManufacturerId(manufacturerId);
    }

    /**
     * 查询轮挡厂家管理列表
     *
     * @param baseManufacturer 轮挡厂家管理
     * @return 轮挡厂家管理
     */
    @Override
    public List<BaseManufacturer> selectBaseManufacturerList(BaseManufacturer baseManufacturer) {
        return baseManufacturerMapper.selectBaseManufacturerList(baseManufacturer);
    }

    /**
     * 新增轮挡厂家管理
     *
     * @param baseManufacturer 轮挡厂家管理
     * @return 结果
     */
    @Override
    public int insertBaseManufacturer(BaseManufacturer baseManufacturer) {
            return baseManufacturerMapper.insertBaseManufacturer(baseManufacturer);
    }

    /**
     * 修改轮挡厂家管理
     *
     * @param baseManufacturer 轮挡厂家管理
     * @return 结果
     */
    @Override
    public int updateBaseManufacturer(BaseManufacturer baseManufacturer) {
                baseManufacturer.setUpdateBy(ShiroUtils.getLoginName());
                baseManufacturer.setUpdateTime(DateUtils.getNowDate());
        return baseManufacturerMapper.updateBaseManufacturer(baseManufacturer);
    }

    /**
     * 批量删除轮挡厂家管理
     *
     * @param manufacturerIds 需要删除的轮挡厂家管理主键
     * @return 结果
     */
    @Override
    public int deleteBaseManufacturerByManufacturerIds(String manufacturerIds) {
        return baseManufacturerMapper.deleteBaseManufacturerByManufacturerIds(Convert.toStrArray(manufacturerIds));
    }

    /**
     * 删除轮挡厂家管理信息
     *
     * @param manufacturerId 轮挡厂家管理主键
     * @return 结果
     */
    @Override
    public int deleteBaseManufacturerByManufacturerId(Long manufacturerId) {
        return baseManufacturerMapper.deleteBaseManufacturerByManufacturerId(manufacturerId);
    }
}
