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.OrderGoodsItemMapper;
import com.yiqi.order.domain.OrderGoodsItem;
import com.yiqi.order.service.IOrderGoodsItemService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 商品订单商品信息Service业务层处理
 *
 * @author ruoyi
 * @date 2023-12-06
 */
@Service
public class OrderGoodsItemServiceImpl extends ServiceImpl<OrderGoodsItemMapper,OrderGoodsItem> implements IOrderGoodsItemService {

    //<editor-folder desc="基础韩素">
    /**
     * 查询商品订单商品信息
     *
     * @param id 商品订单商品信息主键
     * @return 商品订单商品信息
     */
    @Override
    public OrderGoodsItem selectOrderGoodsItemById(Long id) {
        return baseMapper.selectOrderGoodsItemById(id);
    }

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

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

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

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

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


    //</editor-folder>

}
