package com.gxwebsoft.shop.service;

import com.alipay.api.response.AlipayTradeQueryResponse;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gxwebsoft.common.core.web.PageResult;
import com.gxwebsoft.shop.entity.Order;
import com.gxwebsoft.shop.param.OrderParam;

import java.util.List;
import java.util.Map;

/**
 * 订单记录表Service
 *
 * @author WebSoft
 * @since 2022-11-16 11:25:58
 */
public interface OrderService extends IService<Order> {

    /**
     * 分页关联查询
     *
     * @param param 查询参数
     * @return PageResult<Order>
     */
    PageResult<Order> pageRel(OrderParam param);

    /**
     * 关联查询全部
     *
     * @param param 查询参数
     * @return List<Order>
     */
    List<Order> listRel(OrderParam param);

    /**
     * 根据id查询
     *
     * @param orderId 订单ID
     * @return Order
     */
    Order getByIdRel(Integer orderId);

    Order getByOutTradeNo(String outTradeNo);

    @InterceptorIgnore(tenantLine = "true")
    void paySuccess(AlipayTradeQueryResponse params);

    boolean allinPay(Map<String, String> params);

    @InterceptorIgnore(tenantLine = "true")
    void removeOrderByTimeOut();

    @InterceptorIgnore(tenantLine = "true")
    boolean updateByIdRel(Order order);

    PageResult<Order> selectPageSettled(OrderParam param);

    void updateByIdSettled(Order order);

}
