package com.fs.store.service.impl;

import java.util.List;

import com.fs.store.param.FsStoreOrderParam;
import com.fs.store.vo.FsStoreOrderItemExportVO;
import com.fs.store.vo.FsStoreOrderItemVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.store.mapper.FsStoreOrderItemMapper;
import com.fs.store.domain.FsStoreOrderItem;
import com.fs.store.service.IFsStoreOrderItemService;

/**
 * 订单详情Service业务层处理
 *
 * @author fs
 * @date 2022-03-21
 */
@Service
public class FsStoreOrderItemServiceImpl implements IFsStoreOrderItemService
{
    @Autowired
    private FsStoreOrderItemMapper fsStoreOrderItemMapper;

    /**
     * 查询订单详情
     *
     * @param itemId 订单详情ID
     * @return 订单详情
     */
    @Override
    public FsStoreOrderItem selectFsStoreOrderItemById(Long itemId)
    {
        return fsStoreOrderItemMapper.selectFsStoreOrderItemById(itemId);
    }

    /**
     * 查询订单详情列表
     *
     * @param fsStoreOrderItem 订单详情
     * @return 订单详情
     */
    @Override
    public List<FsStoreOrderItem> selectFsStoreOrderItemList(FsStoreOrderItem fsStoreOrderItem)
    {
        return fsStoreOrderItemMapper.selectFsStoreOrderItemList(fsStoreOrderItem);
    }

    /**
     * 新增订单详情
     *
     * @param fsStoreOrderItem 订单详情
     * @return 结果
     */
    @Override
    public int insertFsStoreOrderItem(FsStoreOrderItem fsStoreOrderItem)
    {
        return fsStoreOrderItemMapper.insertFsStoreOrderItem(fsStoreOrderItem);
    }

    /**
     * 修改订单详情
     *
     * @param fsStoreOrderItem 订单详情
     * @return 结果
     */
    @Override
    public int updateFsStoreOrderItem(FsStoreOrderItem fsStoreOrderItem)
    {
        return fsStoreOrderItemMapper.updateFsStoreOrderItem(fsStoreOrderItem);
    }

    /**
     * 批量删除订单详情
     *
     * @param itemIds 需要删除的订单详情ID
     * @return 结果
     */
    @Override
    public int deleteFsStoreOrderItemByIds(Long[] itemIds)
    {
        return fsStoreOrderItemMapper.deleteFsStoreOrderItemByIds(itemIds);
    }

    /**
     * 删除订单详情信息
     *
     * @param itemId 订单详情ID
     * @return 结果
     */
    @Override
    public int deleteFsStoreOrderItemById(Long itemId)
    {
        return fsStoreOrderItemMapper.deleteFsStoreOrderItemById(itemId);
    }

    @Override
    public List<FsStoreOrderItemVO> selectFsStoreOrderItemListByOrderId(Long ordreId) {
        return fsStoreOrderItemMapper.selectFsStoreOrderItemListByOrderId(ordreId);
    }

    @Override
    public List<FsStoreOrderItemExportVO> selectFsStoreOrderItemListExportVO(FsStoreOrderParam fsStoreOrder) {
        return fsStoreOrderItemMapper.selectFsStoreOrderItemListExportVO(fsStoreOrder);
    }

    @Override
    public Long countFsStoreOrderItemListExportVO(FsStoreOrderParam fsStoreOrder) {
        return fsStoreOrderItemMapper.itemsCount(fsStoreOrder);
    }

    @Override
    public int updateFsStoreOrderCode(Long orderId, String orderCode) {
        return fsStoreOrderItemMapper.updateFsStoreOrderCode(orderId,orderCode);
    }
}
