package com.fs.live.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fs.common.utils.DateUtils;
import com.fs.live.domain.LiveAnchor;
import com.fs.live.mapper.LiveAnchorMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fs.live.mapper.LiveGoodsOrderMapper;
import com.fs.live.domain.LiveGoodsOrder;
import com.fs.live.service.ILiveGoodsOrderService;

/**
 * 订单Service业务层处理
 * 
 * @author fs
 * @date 2025-01-17
 */
@Service
public class LiveGoodsOrderServiceImpl extends ServiceImpl<LiveGoodsOrderMapper, LiveGoodsOrder> implements ILiveGoodsOrderService
{
    @Autowired
    private LiveGoodsOrderMapper liveGoodsOrderMapper;

    /**
     * 查询订单
     * 
     * @param orderId 订单主键
     * @return 订单
     */
    @Override
    public LiveGoodsOrder selectLiveGoodsOrderByOrderId(Long orderId)
    {
        return liveGoodsOrderMapper.selectLiveGoodsOrderByOrderId(orderId);
    }

    /**
     * 查询订单列表
     * 
     * @param liveGoodsOrder 订单
     * @return 订单
     */
    @Override
    public List<LiveGoodsOrder> selectLiveGoodsOrderList(LiveGoodsOrder liveGoodsOrder)
    {
        return liveGoodsOrderMapper.selectLiveGoodsOrderList(liveGoodsOrder);
    }

    /**
     * 新增订单
     * 
     * @param liveGoodsOrder 订单
     * @return 结果
     */
    @Override
    public int insertLiveGoodsOrder(LiveGoodsOrder liveGoodsOrder)
    {
        liveGoodsOrder.setCreateTime(DateUtils.getNowDate());
        return liveGoodsOrderMapper.insertLiveGoodsOrder(liveGoodsOrder);
    }

    /**
     * 修改订单
     * 
     * @param liveGoodsOrder 订单
     * @return 结果
     */
    @Override
    public int updateLiveGoodsOrder(LiveGoodsOrder liveGoodsOrder)
    {
        liveGoodsOrder.setUpdateTime(DateUtils.getNowDate());
        return liveGoodsOrderMapper.updateLiveGoodsOrder(liveGoodsOrder);
    }

    /**
     * 批量删除订单
     * 
     * @param orderIds 需要删除的订单主键
     * @return 结果
     */
    @Override
    public int deleteLiveGoodsOrderByOrderIds(Long[] orderIds)
    {
        return liveGoodsOrderMapper.deleteLiveGoodsOrderByOrderIds(orderIds);
    }

    /**
     * 删除订单信息
     * 
     * @param orderId 订单主键
     * @return 结果
     */
    @Override
    public int deleteLiveGoodsOrderByOrderId(Long orderId)
    {
        return liveGoodsOrderMapper.deleteLiveGoodsOrderByOrderId(orderId);
    }
}
