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.LiveGoodsOrderItemsMapper;
import com.fs.live.domain.LiveGoodsOrderItems;
import com.fs.live.service.ILiveGoodsOrderItemsService;

/**
 * 订单商品Service业务层处理
 * 
 * @author fs
 * @date 2025-01-17
 */
@Service
public class LiveGoodsOrderItemsServiceImpl extends ServiceImpl<LiveGoodsOrderItemsMapper, LiveGoodsOrderItems> implements ILiveGoodsOrderItemsService
{
    @Autowired
    private LiveGoodsOrderItemsMapper liveGoodsOrderItemsMapper;

    /**
     * 查询订单商品
     * 
     * @param id 订单商品主键
     * @return 订单商品
     */
    @Override
    public LiveGoodsOrderItems selectLiveGoodsOrderItemsById(Long id)
    {
        return liveGoodsOrderItemsMapper.selectLiveGoodsOrderItemsById(id);
    }

    /**
     * 查询订单商品列表
     * 
     * @param liveGoodsOrderItems 订单商品
     * @return 订单商品
     */
    @Override
    public List<LiveGoodsOrderItems> selectLiveGoodsOrderItemsList(LiveGoodsOrderItems liveGoodsOrderItems)
    {
        return liveGoodsOrderItemsMapper.selectLiveGoodsOrderItemsList(liveGoodsOrderItems);
    }

    /**
     * 新增订单商品
     * 
     * @param liveGoodsOrderItems 订单商品
     * @return 结果
     */
    @Override
    public int insertLiveGoodsOrderItems(LiveGoodsOrderItems liveGoodsOrderItems)
    {
        liveGoodsOrderItems.setCreateTime(DateUtils.getNowDate());
        return liveGoodsOrderItemsMapper.insertLiveGoodsOrderItems(liveGoodsOrderItems);
    }

    /**
     * 修改订单商品
     * 
     * @param liveGoodsOrderItems 订单商品
     * @return 结果
     */
    @Override
    public int updateLiveGoodsOrderItems(LiveGoodsOrderItems liveGoodsOrderItems)
    {
        liveGoodsOrderItems.setUpdateTime(DateUtils.getNowDate());
        return liveGoodsOrderItemsMapper.updateLiveGoodsOrderItems(liveGoodsOrderItems);
    }

    /**
     * 批量删除订单商品
     * 
     * @param ids 需要删除的订单商品主键
     * @return 结果
     */
    @Override
    public int deleteLiveGoodsOrderItemsByIds(Long[] ids)
    {
        return liveGoodsOrderItemsMapper.deleteLiveGoodsOrderItemsByIds(ids);
    }

    /**
     * 删除订单商品信息
     * 
     * @param id 订单商品主键
     * @return 结果
     */
    @Override
    public int deleteLiveGoodsOrderItemsById(Long id)
    {
        return liveGoodsOrderItemsMapper.deleteLiveGoodsOrderItemsById(id);
    }
}
