package com.fs.live.service.impl;

import java.util.Collections;
import java.util.List;

import com.fs.live.domain.LiveOrder;
import com.fs.live.param.LiveOrderParam;
import com.fs.live.vo.LiveOrderItemExportVO;
import com.fs.live.vo.LiveOrderItemListUVO;
import com.fs.live.vo.LiveOrderItemVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.live.mapper.LiveOrderItemMapper;
import com.fs.live.domain.LiveOrderItem;
import com.fs.live.service.ILiveOrderItemService;

/**
 * 订单详情Service业务层处理
 *
 * @author fs
 * @date 2025-07-08
 */
@Service
public class LiveOrderItemServiceImpl implements ILiveOrderItemService {

    @Autowired
    private LiveOrderItemMapper baseMapper;

    /**
     * 查询订单详情
     *
     * @param itemId 订单详情主键
     * @return 订单详情
     */
    @Override
    public LiveOrderItem selectLiveOrderItemByItemId(String itemId)
    {
        return baseMapper.selectLiveOrderItemByItemId(itemId);
    }

    /**
     * 查询订单详情列表
     *
     * @param liveOrderItem 订单详情
     * @return 订单详情
     */
    @Override
    public List<LiveOrderItem> selectLiveOrderItemList(LiveOrderItem liveOrderItem)
    {
        return baseMapper.selectLiveOrderItemList(liveOrderItem);
    }

    /**
     * 新增订单详情
     *
     * @param liveOrderItem 订单详情
     * @return 结果
     */
    @Override
    public int insertLiveOrderItem(LiveOrderItem liveOrderItem)
    {
        return baseMapper.insertLiveOrderItem(liveOrderItem);
    }

    /**
     * 修改订单详情
     *
     * @param liveOrderItem 订单详情
     * @return 结果
     */
    @Override
    public int updateLiveOrderItem(LiveOrderItem liveOrderItem)
    {
        return baseMapper.updateLiveOrderItem(liveOrderItem);
    }

    /**
     * 批量删除订单详情
     *
     * @param itemIds 需要删除的订单详情主键
     * @return 结果
     */
    @Override
    public int deleteLiveOrderItemByItemIds(String[] itemIds)
    {
        return baseMapper.deleteLiveOrderItemByItemIds(itemIds);
    }

    /**
     * 删除订单详情信息
     *
     * @param itemId 订单详情主键
     * @return 结果
     */
    @Override
    public int deleteLiveOrderItemByItemId(String itemId)
    {
        return baseMapper.deleteLiveOrderItemByItemId(itemId);
    }

    @Override
    public List<LiveOrderItemVo> selectCheckedByUserId(LiveOrder liveOrder) {
        return baseMapper.selectCheckedByUserId(liveOrder.getUserId());
    }

    @Override
    public List<LiveOrderItemListUVO> selectLiveOrderItemListUVOByOrderId(Long orderId) {
        return baseMapper.selectLiveOrderItemListUVOByOrderId(orderId);
    }

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

    @Override
    public List<LiveOrderItem> selectCheckedByOrderId(Long id) {
        return baseMapper.selectCheckedByOrderId(id);
    }

    @Override
    public List<LiveOrderItemExportVO> selectLiveOrderItemListExportVO(LiveOrderParam param) {
        return baseMapper.selectFsStoreOrderItemListExportVO(param);
    }
}
