package com.game.business.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.game.business.mapper.ShopBusinessOrderMapper;
import com.game.business.domain.ShopBusinessOrder;
import com.game.business.service.IShopBusinessOrderService;
import com.game.common.annotation.DataSource;
import com.game.common.enums.DataSourceType;

/**
 * 购物订单Service业务层处理
 *
 * @author game
 * @date 2024-09-06
 */
@Service
public class ShopBusinessOrderServiceImpl extends ServiceImpl<ShopBusinessOrderMapper, ShopBusinessOrder> implements IShopBusinessOrderService {
    @Autowired
    private ShopBusinessOrderMapper shopBusinessOrderMapper;

    /**
     * 查询购物订单
     *
     * @param id 购物订单主键
     * @return 购物订单
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public ShopBusinessOrder selectShopBusinessOrderById(Long id) {
        return shopBusinessOrderMapper.selectShopBusinessOrderById(id);
    }

    /**
     * 查询购物订单列表
     *
     * @param shopBusinessOrder 购物订单
     * @return 购物订单
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public List<ShopBusinessOrder> selectShopBusinessOrderList(ShopBusinessOrder shopBusinessOrder) {
        return shopBusinessOrderMapper.selectShopBusinessOrderList(shopBusinessOrder);
    }

    /**
     * 新增购物订单
     *
     * @param shopBusinessOrder 购物订单
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int insertShopBusinessOrder(ShopBusinessOrder shopBusinessOrder) {
            return shopBusinessOrderMapper.insertShopBusinessOrder(shopBusinessOrder);
    }

    /**
     * 修改购物订单
     *
     * @param shopBusinessOrder 购物订单
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int updateShopBusinessOrder(ShopBusinessOrder shopBusinessOrder) {
        return shopBusinessOrderMapper.updateShopBusinessOrder(shopBusinessOrder);
    }

    /**
     * 批量删除购物订单
     *
     * @param ids 需要删除的购物订单主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteShopBusinessOrderByIds(Long[] ids) {
        return shopBusinessOrderMapper.deleteShopBusinessOrderByIds(ids);
    }

    /**
     * 删除购物订单信息
     *
     * @param id 购物订单主键
     * @return 结果
     */
    @Override
    @DataSource(DataSourceType.SLAVE)
    public int deleteShopBusinessOrderById(Long id) {
        return shopBusinessOrderMapper.deleteShopBusinessOrderById(id);
    }
}