package com.bonus.canteen.core.order.mapper;

import com.bonus.canteen.core.order.domain.OrderInfo;
import com.bonus.canteen.core.order.domain.OrderPayResultDTO;
import com.bonus.canteen.core.order.domain.OrderRefundHistoryVO;
import com.bonus.canteen.core.order.domain.param.OrderQueryParam;
import com.bonus.canteen.core.order.domain.param.OrderRefundHistoryParam;
import com.bonus.canteen.core.order.domain.param.OrderWriteOffParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 订单Mapper接口
 * 
 * @author ruoyi
 * @date 2025-04-14
 */
public interface OrderInfoMapper 
{
    /**
     * 查询订单
     * 
     * @param orderId 订单主键
     * @return 订单
     */
    public OrderInfo selectOrderInfoByOrderId(Long orderId);
    public OrderInfo selectOrderInfoByDeviceOrderId(String orderId);

    /**
     * 查询订单列表
     * 
     * @return 订单集合
     */
    public List<OrderInfo> selectOrderInfoList(OrderQueryParam orderQueryParam);

    /**
     * 新增订单
     * 
     * @param orderInfo 订单
     * @return 结果
     */
    public int insertOrderInfo(OrderInfo orderInfo);

    public int batchInsertOrderInfo(@Param("list") List<OrderInfo> list);

    /**
     * 修改订单
     * 
     * @param orderInfo 订单
     * @return 结果
     */
    public int updateOrderInfo(OrderInfo orderInfo);
    public int updateOrderPayResult(@Param("param") OrderPayResultDTO orderInfo);

    /**
     * 删除订单
     * 
     * @param orderId 订单主键
     * @return 结果
     */
    public int deleteOrderInfoByOrderId(Long orderId);

    /**
     * 批量删除订单
     * 
     * @param orderIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteOrderInfoByOrderIds(@Param("orderIds") List<Long> orderIds);

    public List<OrderRefundHistoryVO> orderRefundHistory(@Param("param") OrderRefundHistoryParam param);

    public void writeOffOrderByOrderIds(@Param("param") OrderWriteOffParam param);
}
