package com.ghy.order.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ghy.order.mapper.OrderAttachmentRecordMapper;
import com.ghy.order.domain.OrderAttachmentRecord;
import com.ghy.order.service.IOrderAttachmentRecordService;
import com.ghy.common.core.text.Convert;

/**
 * 附件费Service业务层处理
 *
 * @author clunt
 * @date 2024-01-02
 */
@Service
public class OrderAttachmentRecordServiceImpl implements IOrderAttachmentRecordService
{
    @Autowired
    private OrderAttachmentRecordMapper orderAttachmentRecordMapper;

    /**
     * 查询附件费
     *
     * @param id 附件费主键
     * @return 附件费
     */
    @Override
    public OrderAttachmentRecord selectOrderAttachmentRecordById(Long id)
    {
        return orderAttachmentRecordMapper.selectOrderAttachmentRecordById(id);
    }

    /**
     * 查询附件费列表
     *
     * @param orderAttachmentRecord 附件费
     * @return 附件费
     */
    @Override
    public List<OrderAttachmentRecord> selectOrderAttachmentRecordList(OrderAttachmentRecord orderAttachmentRecord)
    {
        return orderAttachmentRecordMapper.selectOrderAttachmentRecordList(orderAttachmentRecord);
    }

    /**
     * 新增附件费
     *
     * @param orderAttachmentRecord 附件费
     * @return 结果
     */
    @Override
    public int insertOrderAttachmentRecord(OrderAttachmentRecord orderAttachmentRecord)
    {
        return orderAttachmentRecordMapper.insertOrderAttachmentRecord(orderAttachmentRecord);
    }

    /**
     * 修改附件费
     *
     * @param orderAttachmentRecord 附件费
     * @return 结果
     */
    @Override
    public int updateOrderAttachmentRecord(OrderAttachmentRecord orderAttachmentRecord)
    {
        return orderAttachmentRecordMapper.updateOrderAttachmentRecord(orderAttachmentRecord);
    }

    /**
     * 批量删除附件费
     *
     * @param ids 需要删除的附件费主键
     * @return 结果
     */
    @Override
    public int deleteOrderAttachmentRecordByIds(String ids)
    {
        return orderAttachmentRecordMapper.deleteOrderAttachmentRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除附件费信息
     *
     * @param id 附件费主键
     * @return 结果
     */
    @Override
    public int deleteOrderAttachmentRecordById(Long id)
    {
        return orderAttachmentRecordMapper.deleteOrderAttachmentRecordById(id);
    }

    /**
     * 删除附件费信息  根据子单id
     *
     * @return 结果
     */
    @Override
    public int deleteOrderAttachmentRecordByOrderDetailId(Long orderDetailId)
    {
        return orderAttachmentRecordMapper.deleteOrderAttachmentRecordByOrderDetailId(orderDetailId);
    }
}
