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

import java.util.List;
import com.bonus.common.core.exception.ServiceException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bonus.material.repair.mapper.RepairCostMapper;
import com.bonus.material.repair.domain.RepairCost;
import com.bonus.material.repair.service.IRepairCostService;

/**
 * 维修详细Service业务层处理
 * 
 * @author xsheng
 * @date 2024-10-16
 */
@Service
public class RepairCostServiceImpl implements IRepairCostService {
    @Autowired
    private RepairCostMapper repairCostMapper;

    /**
     * 查询维修详细
     * 
     * @param id 维修详细主键
     * @return 维修详细
     */
    @Override
    public RepairCost selectRepairCostById(Long id) {
        return repairCostMapper.selectRepairCostById(id);
    }

    /**
     * 查询维修详细列表
     * 
     * @param repairCost 维修详细
     * @return 维修详细
     */
    @Override
    public List<RepairCost> selectRepairCostList(RepairCost repairCost) {
        return repairCostMapper.selectRepairCostList(repairCost);
    }

    /**
     * 新增维修详细
     * 
     * @param repairCost 维修详细
     * @return 结果
     */
    @Override
    public int insertRepairCost(RepairCost repairCost) {
        try {
            return repairCostMapper.insertRepairCost(repairCost);
        } catch (Exception e) {
            throw new ServiceException("错误信息描述");
        }
    }

    /**
     * 修改维修详细
     * 
     * @param repairCost 维修详细
     * @return 结果
     */
    @Override
    public int updateRepairCost(RepairCost repairCost) {
        try {
            return repairCostMapper.updateRepairCost(repairCost);
        } catch (Exception e) {
            throw new ServiceException("错误信息描述");
        }
    }

    /**
     * 批量删除维修详细
     * 
     * @param ids 需要删除的维修详细主键
     * @return 结果
     */
    @Override
    public int deleteRepairCostByIds(Long[] ids) {
        return repairCostMapper.deleteRepairCostByIds(ids);
    }

    /**
     * 删除维修详细信息
     * 
     * @param id 维修详细主键
     * @return 结果
     */
    @Override
    public int deleteRepairCostById(Long id) {
        return repairCostMapper.deleteRepairCostById(id);
    }
}
