package com.xhpc.activity.mapper;

import com.xhpc.activity.domain.XhpcClearingCheckoutDomain;
import com.xhpc.activity.vo.CheckoutBankVo;
import org.apache.ibatis.annotations.Param;

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

public interface XhpcClearingCheckoutMapper {
    int deleteByPrimaryKey(Long clearingCheckoutId);

    int insert(XhpcClearingCheckoutDomain record);

    XhpcClearingCheckoutDomain selectByPrimaryKey(Long clearingCheckoutId);

    int updateByPrimaryKey(XhpcClearingCheckoutDomain record);

    List<XhpcClearingCheckoutDomain> selectByParams(@Param("params") Map<String, Object> params);

    List<Map<String, Object>> getXhpcOperatorParams(@Param("params") Map<String, Object> params);
    List<Map<String, Object>> selectCheckoutMapByParams(@Param("params") Map<String, Object> params);


    int deleteLogicByPrimaryKey(Long clearingCheckoutId);

    boolean checkByPrimaryKey(XhpcClearingCheckoutDomain domain);

    boolean updateStatusByPrimaryKey(XhpcClearingCheckoutDomain domain);

    BigDecimal selectAmountByStatus(@Param("operatorId")String operatorId, @Param("status")Integer status);

    List<CheckoutBankVo> selectOrderMapByCheckoutIds(@Param("checkoutIds")String checkoutIds);

    int updateStatusByIds(@Param("checkoutIds")String checkoutIds, @Param("status")Integer status);


    List<Map<String, Object>> selectMapGroupByStatus(@Param("checkoutIds")String checkoutIds);

    String selectIdsByStatusAndIds(@Param("checkoutIds")String checkoutIds, @Param("status") Integer status);

    //带清分金额
    BigDecimal selectUnclearingAmount(@Param("params") Map<String, Object> params);
    //不参与清分基恩
    Map<String, Object> selectClearingPrice(@Param("params") Map<String, Object> params);


    Map<String, Object> selectCashedAmountOrCashingAmount(@Param("operatorId")String operatorId);
        // 1. 批量获取待清分金额 - 返回 List
        List<Map<String, Object>> selectUnclearingAmountBatch(@Param("operatorIds") List<String> operatorIds,
                                                              @Param("params") Map<String, Object> params);
        // 2. 批量获取已提现和提现中金额 - 返回 List
        List<Map<String, Object>> selectCashedAmountOrCashingAmountBatch(@Param("operatorIds") List<String> operatorIds);

        // 3. 批量获取不参与清分金额 - 返回 List
        List<Map<String, Object>> selectCashAmountYuBatch(@Param("operatorIds") List<String> operatorIds);

        // 4. 批量获取清分价格和总金额 - 返回 List
        List<Map<String, Object>> selectClearingPriceBatch(@Param("operatorIds") List<String> operatorIds,
                                                           @Param("params") Map<String, Object> params);

}
