package com.keao.edu.user.dao;

import com.keao.edu.common.dal.BaseDAO;
import com.keao.edu.user.dto.ExamRegistrationPaymentDto;
import com.keao.edu.user.entity.ExamRegistrationPayment;
import com.keao.edu.user.enums.TransStatusEnum;
import org.apache.ibatis.annotations.Param;

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

public interface ExamRegistrationPaymentDao extends BaseDAO<Long, ExamRegistrationPayment> {

    /**
     * 获取用户项目未支付的订单
     *
     * @param examinationBasicId
     * @param userId
     * @return
     */
    ExamRegistrationPayment getExamIngOrder(@Param("examinationBasicId") Long examinationBasicId, @Param("userId") Integer userId);

    /**
     * 根据订单号获取订单
     *
     * @param orderNo
     * @return
     */
    ExamRegistrationPayment getByOrderNo(@Param("orderNo") String orderNo);

    /**
     * 根据状态获取订单
     *
     * @param status
     * @param payType
     * @return
     */
    List<ExamRegistrationPayment> getOrdersByStatus(@Param("status") String status, @Param("payType") String payType);


    /**
     * 获取过期未支付的订单列表
     *
     * @param orderNoList
     * @param transStatus
     * @param beforeTime
     * @return
     */
    List<ExamRegistrationPayment> findOrdersOverTime(@Param("orderNoList") List<String> orderNoList, @Param("transStatus") TransStatusEnum transStatus, @Param("beforeTime") Date beforeTime);

    /**
     * 获取支付列表
     *
     * @return
     */
    List<ExamRegistrationPaymentDto> getOrderPageList(Map<String, Object> params);

    /**
     * 获取订单总条数
     * @param params
     * @return
     */
    Integer getOrderListCount(Map<String, Object> params);

    /**
     * @describe 获取指定日期中分部考级项目的报名费用
     * @author Joburgess
     * @date 2020.07.16
     * @param examId:
     * @param organId:
     * @param days:
     * @return java.util.List<com.keao.edu.user.entity.ExamRegistrationPayment>
     */
    List<ExamRegistrationPayment> getWithExamOrganAndDay(@Param("examId") Long examId,
                                                         @Param("organId") Integer organId,
                                                         @Param("days") List<String> days);
}
