package com.yiqi.order.service.impl;

import java.util.List;
import com.yiqi.common.utils.DateUtils;
import com.yiqi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yiqi.order.mapper.OrderPurchaseGoodsItemMapper;
import com.yiqi.order.domain.OrderPurchaseGoodsItem;
import com.yiqi.order.service.IOrderPurchaseGoodsItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 商品订单商品信息Service业务层处理
 *
 * @author ruoyi
 * @date 2023-10-20
 */
@Service
public class OrderPurchaseGoodsItemServiceImpl extends ServiceImpl<OrderPurchaseGoodsItemMapper,OrderPurchaseGoodsItem> implements IOrderPurchaseGoodsItemService {

    /**
     * 查询商品订单商品信息
     *
     * @param id 商品订单商品信息主键
     * @return 商品订单商品信息
     */
    @Override
    public OrderPurchaseGoodsItem selectOrderPurchaseGoodsItemById(Long id) {
        return baseMapper.selectOrderPurchaseGoodsItemById(id);
    }

    /**
     * 查询商品订单商品信息列表
     *
     * @param orderPurchaseGoodsItem 商品订单商品信息
     * @return 商品订单商品信息
     */
    @Override
    public List<OrderPurchaseGoodsItem> selectOrderPurchaseGoodsItemList(OrderPurchaseGoodsItem orderPurchaseGoodsItem) {
        return baseMapper.selectOrderPurchaseGoodsItemList(orderPurchaseGoodsItem);
    }

    /**
     * 新增商品订单商品信息
     *
     * @param orderPurchaseGoodsItem 商品订单商品信息
     * @return 结果
     */
    @Override
    public int insertOrderPurchaseGoodsItem(OrderPurchaseGoodsItem orderPurchaseGoodsItem) {
        orderPurchaseGoodsItem.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertOrderPurchaseGoodsItem(orderPurchaseGoodsItem);
    }

    /**
     * 修改商品订单商品信息
     *
     * @param orderPurchaseGoodsItem 商品订单商品信息
     * @return 结果
     */
    @Override
    public int updateOrderPurchaseGoodsItem(OrderPurchaseGoodsItem orderPurchaseGoodsItem) {
        orderPurchaseGoodsItem.setUpdateTime(DateUtils.getNowDate());
        return baseMapper.updateOrderPurchaseGoodsItem(orderPurchaseGoodsItem);
    }

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

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



}
