package com.gxwebsoft.shop.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.shop.entity.Order;
import com.gxwebsoft.shop.param.OrderParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 订单Mapper
 *
 * @author 科技小王子
 * @since 2024-05-14 13:20:04
 */
public interface OrderMapper extends BaseMapper<Order> {

  /**
   * 分页查询
   *
   * @param page  分页对象
   * @param param 查询参数
   * @return List<Order>
   */
  List<Order> selectPageRel(@Param("page") IPage<Order> page,
                            @Param("param") OrderParam param);

  /**
   * 查询全部
   *
   * @param param 查询参数
   * @return List<User>
   */
  List<Order> selectListRel(@Param("param") OrderParam param);


  @InterceptorIgnore(tenantLine = "true")
  List<Order> getByOutTradeNo(@Param("param") OrderParam param);

  @InterceptorIgnore(tenantLine = "true")
  void updateByOutTradeNo(@Param("param") Order outTradeNo);

  @InterceptorIgnore(tenantLine = "true")
  List<Order> selectExpirationOrder(@Param("param") OrderParam param);

  @InterceptorIgnore(tenantLine = "true")
  void updateExpirationOrder(@Param("orderId") Integer orderId);
}
