package com.ym.mec.biz.dal.dao;

import com.ym.mec.biz.dal.dto.MusicalListDetailDto;
import com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail;
import com.ym.mec.biz.dal.enums.DealStatusEnum;
import com.ym.mec.biz.dal.enums.OrderDetailTypeEnum;
import com.ym.mec.biz.dal.enums.OrderTypeEnum;
import com.ym.mec.common.dal.BaseDAO;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public interface StudentPaymentOrderDetailDao extends BaseDAO<Long, StudentPaymentOrderDetail> {


    /**
     * 批量添加订单详情
     *
     * @param studentPaymentOrderDetailList
     * @return
     */
    int batchAdd(@Param("studentPaymentOrderDetailList") List<StudentPaymentOrderDetail> studentPaymentOrderDetailList);

    /**
     * 查询注册支付的订单详情
     *
     * @param musicGroupId
     * @param status
     * @return
     */
    List<StudentPaymentOrderDetail> findApplyOrderSuccess(@Param("musicGroupId") String musicGroupId, @Param("status") DealStatusEnum status);

    /**
     * 查询订单商品
     *
     * @param orderId
     * @return
     */
    List<StudentPaymentOrderDetail> findApplyOrderGoods(@Param("orderId") Long orderId);

    /**
     * 查询用户报名订单
     *
     * @param userId
     * @param status
     * @return
     */
    List<StudentPaymentOrderDetail> findUserApplyOrder(@Param("userId") Integer userId, @Param("musicGroupId") String musicGroupId, @Param("status") DealStatusEnum status);

    /**
     * 乐器采购清单明细
     *
     * @param musicGroupId
     * @return
     */
    List<MusicalListDetailDto> getMusicalListDetail(String musicGroupId);

    /**
     * 获取商品名称列表
     *
     * @param paymentOrderNo
     * @return
     */
    List<Map<Long, String>> queryGoodsNames(@Param("paymentOrderNo") List<Long> paymentOrderNo);

    /**
     * 获取对应商品类型总价
     *
     * @param paymentOrderNo
     * @param types
     * @return
     */
    List<Map<Long, BigDecimal>> queryGoodsPrice(@Param("paymentOrderNo") List<Long> paymentOrderNo, @Param("types") String types);

    /**
     * 获取订单商品
     *
     * @param orderId
     * @return
     */
    StudentPaymentOrderDetail findApplyOrderMusical(@Param("orderId") Long orderId);

    /**
     * 获取订单详细
     *
     * @param orderId
     * @return
     */
    List<StudentPaymentOrderDetail> getOrderDetail(@Param("orderId") Long orderId);

    /**
     * @param orderId
     * @return
     */
    List<String> getOrderDetailType(@Param("orderId") Long orderId);

    /**
     * 获取学生乐团报名购买的乐器信息
     *
     * @param studentId
     * @param musicGroupId
     * @return
     */
    List<StudentPaymentOrderDetail> getStudentApplyDetail(@Param("studentId") Integer studentId, @Param("musicGroupId") String musicGroupId);

    /**
     * 获取购买乐器的方式
     *
     * @param paymentOrderNo
     * @return
     */
    List<Map<Long, String>> queryPurchaseTypeMap(@Param("paymentOrderNo") List<Long> paymentOrderNo);

    /**
     * 获取订单的商品
     *
     * @param orderIds
     * @return
     */
    List<StudentPaymentOrderDetail> getOrderGoodies(@Param("orderIds") List<Long> orderIds);

    /**
     * @param userId:
     * @param orderType:
     * @return java.util.List<com.ym.mec.biz.dal.entity.StudentPaymentOrderDetail>
     * @describe 获取用户指定类型的订单
     * @author qnc99
     * @date 2020/12/7 0007
     */
    List<StudentPaymentOrderDetail> getWithUserAndOrderType(@Param("userId") Integer userId,
                                                            @Param("orderType") OrderTypeEnum orderType);

    List<StudentPaymentOrderDetail> getWithIds(@Param("paymentOrderIds") List<Long> paymentOrderIds);


    List<StudentPaymentOrderDetail> getOrderDetailByType(@Param("orderId") Long orderId, @Param("orderDetailTypes") List<OrderDetailTypeEnum> orderDetailTypes);

    /**
     * 根据订单号获取订单详情
     * @param orderId
     * @return
     */
    List<StudentPaymentOrderDetail> getOrderDetailByOrderId(@Param("orderId") Long orderId);
}
