package com.yida.data.device.consume.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yida.data.common.core.entity.consume.EduConsumeOrder;
import com.yida.data.device.dto.consume.ConsumeOrderPageDTO;
import com.yida.data.device.dto.consume.H5ConsumeOrderPageDTO;
import com.yida.data.device.vo.consume.ConsumeOrderPageVO;
import com.yida.data.device.vo.consume.ConsumeRefundOrderVO;
import com.yida.data.device.vo.consume.H5ConsumeOrderPageVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 消费订单(充值记录)Mapper
 *
 * @author ZYJ
 * @date 2023/3/23
 */
public interface EduConsumeOrderMapper extends BaseMapper<EduConsumeOrder> {

    /**
     * 前端查询账单订单列表数据
     * 未支付、成功、退款中
     *
     * @param page 分页数据
     * @param dto  消费订单列表请求类(充值记录)
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.yida.data.device.vo.consume.H5ConsumeOrderPageVO>
     * @author ZYJ
     * @date 2023/3/24 14:29
     */
    IPage<H5ConsumeOrderPageVO> listH5ConsumeOrderPage(Page<EduConsumeOrder> page,
                                                       @Param("dto") H5ConsumeOrderPageDTO dto);

    /**
     * 前端查询消费订单详情(充值记录)
     *
     * @param orderId   订单id
     * @param orderCode 订单号
     * @return com.yida.data.device.vo.consume.H5ConsumeOrderPageVO
     * @author ZYJ
     * @date 2023/3/24 14:45
     */
    H5ConsumeOrderPageVO getH5ConsumeOrderInfo(@Param("orderId") Long orderId, @Param("orderCode") String orderCode);

    /**
     * 查询所有已经超时订单
     * 未支付状态
     *
     * @return java.util.List<com.yida.data.common.core.entity.consume.EduConsumeOrder>
     * @author ZYJ
     * @date 2023/4/3 13:31
     */
    List<EduConsumeOrder> selectTimeOutConsumeOrder();

    /**
     * 查询退款中状态的消费订单
     *
     * @return java.util.List<com.yida.data.device.vo.consume.ConsumeRefundOrderVO>
     * @author ZYJ
     * @date 2023/4/3 16:07
     */
    List<ConsumeRefundOrderVO> selectRefundOrder();

    /**
     * 消费订单后台列表分页查询
     *
     * @param page      分页信息
     * @param schoolIds 学校id集合
     * @param dto       消费订单后台列表请求类
     * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.yida.data.device.vo.consume.ConsumeOrderPageVO>
     * @author ZYJ
     * @date 2023/4/14 17:09
     */
    Page<ConsumeOrderPageVO> listConsumeOrderPage(Page page,
                                                  @Param("schoolIds") List<Long> schoolIds,
                                                  @Param("dto") ConsumeOrderPageDTO dto);
}
