package com.fuint.repository.mapper;

import com.fuint.repository.model.MtOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 订单表 Mapper 接口
 *
 * Created by FSQ
 * CopyRight https://www.fuint.cn
 */
public interface MtOrderMapper extends BaseMapper<MtOrder> {

    BigDecimal getOrderCount(@Param("merchantId") Long merchantId);

    BigDecimal getStoreOrderCount(@Param("storeId") Long storeId);

    BigDecimal getOrderCountByTime(@Param("merchantId") Long merchantId, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime);

    BigDecimal getStoreOrderCountByTime(@Param("storeId") Long storeId, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime);

    MtOrder findByOrderSn(@Param("orderSn") String orderSn);

    MtOrder findByTableId(@Param("tableId") Long tableId);

    BigDecimal getPayMoney(@Param("merchantId") Long merchantId);

    BigDecimal getPayMoneyByTime(@Param("merchantId") Long merchantId, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime);

    BigDecimal getStorePayMoneyByTime(@Param("storeId") Long storeId, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime);

    BigDecimal getStorePayMoney(@Param("storeId") Long storeId);

    Integer getPayUserCount(@Param("merchantId") Long merchantId);

    Integer getStorePayUserCount(@Param("storeId") Long storeId);

    BigDecimal getUserPayMoney(@Param("userId") Long userId);

    Integer getUserPayOrderCount(@Param("userId") Long userId);

    List<MtOrder> getTobeCommissionOrderList(@Param("dateTime") String dateTime);

}
