package cn.superdesk.uniorder.dao.mapper.base;

import cn.superdesk.uniorder.dao.entity.base.UnifiedOrder;
import cn.superdesk.uniorder.dto.param._function.select.SelectOptionDepartmentCriteria;
import cn.superdesk.uniorder.dto.vo._function.select.SelectOptionDepartment;
import cn.superdesk.uniorder.dto.vo.order.Org2VirtStatisticsVo;
import cn.superdesk.uniorder.dto.vo.unified.UnifiedOrderCommonHeadSum;
import cn.superdesk.uniorder.dto.vo.unified.UnifiedOrderGoodsVo;
import cn.superdesk.uniorder.dto.vo.wechat.WxBillOrder;
import org.apache.ibatis.annotations.Param;

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

/**
 * @Description: Java类作用描述
 * @Author: linjinyu
 * @CreateDate: 2021/12/3 上午11:58
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/12/3 上午11:58
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public interface UnifiedOrderMapperEx {


    /****************************************** 订单管理 start ******************************************/

    /**
     * 订单管理
     *
     * @param params
     * @return
     */
    List<UnifiedOrderGoodsVo> getOrderManagerGoodsView(Map<String, Object> params);

    List<Org2VirtStatisticsVo> getOrg2VirtStatistics(Map<String, Object> params);


    /**
     * 订单管理
     *
     * @param params
     * @return
     */
    UnifiedOrderCommonHeadSum getOrderManagerGoodsPageHead(Map<String, Object> params);

    /****************************************** 订单管理   end ******************************************/

    List<SelectOptionDepartment> getSelectPurchaseDepartment(SelectOptionDepartmentCriteria criteria);

    List<UnifiedOrder> findAll(Map<String, Object> queryMap);

    Integer countAll(Map<String, Object> queryMap);

    /**
     * 根据 orderSn 得出 订单entity
     *
     * @param orderSn
     * @return
     */
    UnifiedOrder findByOrderSn(@Param("orderSn") String orderSn);

    /**
     * 双主体情况
     * 根据 正单 orderSn 找 订单表.refund_order_sn 字段 得出 退单List
     * 根据 退单 orderSn 找 订单表.refund_order_sn 字段 得出 正单List
     *
     * @param orderSn
     * @return
     */
    List<UnifiedOrder> findByRefundOrderSn(@Param("refundOrderSn") String refundOrderSn);

    UnifiedOrder findByJdOrderSn(@Param("jdOrderSn") String jdOrderSn);

    List<WxBillOrder> getVirtOrder(Map<String, Object> params);


    BigDecimal getPayAmount(Map<String, Object> upaymap);

    BigDecimal getAmount(Map<String, Object> query);

    Integer getOrderCount(Map<String, Object> queryMap);


}