package com.bonus.material.ma.service.impl;

import java.util.List;
import com.bonus.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.material.ma.mapper.PartRepairMapper;
import com.bonus.material.ma.domain.PartRepair;
import com.bonus.material.ma.service.IPartRepairService;

/**
 * 维修班配件配置Service业务层处理
 * 
 * @author xsheng
 * @date 2024-09-27
 */
@Service
public class PartRepairServiceImpl implements IPartRepairService 
{
    @Autowired
    private PartRepairMapper partRepairMapper;

    /**
     * 查询维修班配件配置
     * 
     * @param partId 维修班配件配置主键
     * @return 维修班配件配置
     */
    @Override
    public PartRepair selectPartRepairByPartId(Long partId)
    {
        return partRepairMapper.selectPartRepairByPartId(partId);
    }

    /**
     * 查询维修班配件配置列表
     * 
     * @param partRepair 维修班配件配置
     * @return 维修班配件配置
     */
    @Override
    public List<PartRepair> selectPartRepairList(PartRepair partRepair)
    {
        return partRepairMapper.selectPartRepairList(partRepair);
    }

    /**
     * 新增维修班配件配置
     * 
     * @param partRepair 维修班配件配置
     * @return 结果
     */
    @Override
    public int insertPartRepair(PartRepair partRepair)
    {
        partRepair.setCreateTime(DateUtils.getNowDate());
        return partRepairMapper.insertPartRepair(partRepair);
    }

    /**
     * 修改维修班配件配置
     * 
     * @param partRepair 维修班配件配置
     * @return 结果
     */
    @Override
    public int updatePartRepair(PartRepair partRepair)
    {
        partRepair.setUpdateTime(DateUtils.getNowDate());
        return partRepairMapper.updatePartRepair(partRepair);
    }

    /**
     * 批量删除维修班配件配置
     * 
     * @param partIds 需要删除的维修班配件配置主键
     * @return 结果
     */
    @Override
    public int deletePartRepairByPartIds(Long[] partIds)
    {
        return partRepairMapper.deletePartRepairByPartIds(partIds);
    }

    /**
     * 删除维修班配件配置信息
     * 
     * @param partId 维修班配件配置主键
     * @return 结果
     */
    @Override
    public int deletePartRepairByPartId(Long partId)
    {
        return partRepairMapper.deletePartRepairByPartId(partId);
    }
}
