package com.yonge.cooleshow.biz.dal.dao;

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yonge.cooleshow.biz.dal.entity.UserOrder;
import com.yonge.cooleshow.biz.dal.enums.OrderStatusEnum;
import org.apache.ibatis.annotations.Param;
import com.yonge.cooleshow.biz.dal.vo.UserOrderVo;
import com.yonge.cooleshow.biz.dal.dto.search.OrderSearch;


public interface UserOrderDao extends BaseMapper<UserOrder>{
	/**
	 * 查询详情-通过id
     * @author liweifan
     * @date 2022-03-30 13:53:51
     * @return: com.yonge.cooleshow.biz.dal.vo.OrderVo
	 */
	UserOrderVo detailById(@Param("id") Long id);
	/**
	 * 查询详情-通过订单号
	 * @author liweifan
	 * @date 2022-03-30 13:53:51
	 * @return: com.yonge.cooleshow.biz.dal.vo.OrderVo
	 */
	UserOrderVo detailByOrderNo(@Param("orderNo") String orderNo);
	/***
	 * app查询
	 * @author liweifan
	 * @param: id
	 * @updateTime 2022/4/20 15:57
	 * @return: com.yonge.cooleshow.biz.dal.vo.UserOrderVo
	 */
	UserOrderVo detailApp(@Param("param") UserOrder param);
	/***
	 * 通过业务id查询用户正在交易中的订单
	 * @author liweifan
	 * @param: param
	 * @updateTime 2022/4/27 17:05
	 * @return: com.yonge.cooleshow.biz.dal.vo.UserOrderVo
	 */
	UserOrderVo getPendingOrder(@Param("param") OrderSearch param);
	/**
	 * 分页查询
     * @author liweifan
     * @date 2022-03-30 13:53:51
     * @return: com.yonge.cooleshow.biz.dal.vo.OrderVo
	 */
	List<UserOrderVo> selectPage(@Param("page") IPage page, @Param("param") OrderSearch order);
	/**
	 * 查询集合
	 * @author liweifan
	 * @date 2022-03-30 13:53:51
	 * @return: com.yonge.cooleshow.biz.dal.vo.OrderVo
	 */
	List<UserOrderVo> selectList(@Param("param") OrderSearch order);
	/***
	 * 查询创建时间超过半小时还在交易中的订单
	 * @author liweifan
	 * @updateTime 2022/4/13 16:38
	 * @return: java.util.List<com.yonge.cooleshow.biz.dal.entity.UserOrder>
	 */
	List<UserOrderVo> selectPendingList();
	/***
	 * 修改订单状态
	 * @author liweifan
	 * @param: orderNo
	 * @param: paying
	 * @updateTime 2022/4/19 10:57
	 * @return: java.lang.Integer
	 */
    Integer updateStatusByOrderNo(@Param("orderNo")String orderNo,@Param("orderStatus") String orderStatus);
	/***
	 * 查询未记录第一次购买时间的订单
	 * @author liweifan
	 * @param: query
	 * @updateTime 2022/4/28 10:18
	 * @return: java.util.List<com.yonge.cooleshow.biz.dal.entity.UserOrder>
	 */
    List<UserOrder> selectUnRecordTimeOrder(@Param("param") OrderSearch param);
}