package com.cyksj.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cyksj.model.entity.OrderDon;
import com.cyksj.model.entity.OrderDonCustomerServiceRelate;
import com.cyksj.model.entity.RealGoodsInterestUser;
import com.cyksj.model.excel.ExcelOrderDonInfo;
import com.cyksj.model.views.*;
import org.apache.ibatis.annotations.Param;

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

/**
 * @author chan
 * @date 2021/10/11 下午4:06
 */
public interface OrderDonMapper extends BaseMapper<OrderDon> {


    List<ExcelOrderDonInfo> exportOrderInfo(@Param("promotionId") Long promotionId, @Param("start") String start, @Param("end") String end);

	List<OrderDon> getAppleOneOrderDons(@Param("skuIds") List<Long> skuIds, @Param("noOrderStatus") List<String> noOrderStatus, @Param("yesZeroDate") Date yesZeroDate, @Param("thisZeroDate") Date thisZeroDate);

	List<RealGoodsInterestUser> selectNoPaymentRealGoods();

	Integer updateHasPaymentInterestRealGoods();

	void updateHasPaymentInterestRealGoodsPayTime();

	BrokenLineObjView selectPlatBrokenLineMoney(@Param("first") String first, @Param("end") String end);

	BrokenLineObjView selectPersonDistributeBrokenLine(@Param("userId") Long userId, @Param("first") String first, @Param("end") String end);

	ChannelStatisticsView selectChannelStatistics(@Param("first") String first, @Param("end") String end);

	Integer selectCouponCodeUserNum(@Param("dsPopularizeId") Long dsPopularizeId, @Param("exCode") String exCode, @Param("noOrderAllStatus") List<String> noOrderAllStatus);

	ChannelPopularizeView countPopularizeOrderDetail(@Param("popularizeId") Long popularizeId, @Param("goodsId") Long goodsId, @Param("startTime") String startTime, @Param("endTime") String endTime);

	BigDecimal selectThisMonthAppleOneMoney(@Param("skuIds") Set<Long> skuIds, @Param("startDate") String startDate, @Param("endDate") String endDate);

	BigDecimal selectThisMonthDistributeOrderMoney(@Param("skuIds") Set<Long> skuIds, @Param("startDate") String startDate, @Param("endDate") String endDate);

	Map<String, Object> getOrderDetailByGoodsType(@Param("type") Integer type, @Param("noOrderStatus") List<String> noOrderStatus, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

	BackgroundDataView getBackgroundDataView(@Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("noOrderStatus") List<String> noOrderStatus);

	BigDecimal statisticsUsedBalance(@Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("noOrderAllStatus") List<String> noOrderAllStatus);

	Map<String, Object> selectYhShopDistributeOrderDetail(@Param("startDate") Date startDate, @Param("endDate") Date endDate);

	Integer selectCountActiveCodeOrderByAcId(Long acId);

	Map<String, Object> selectActiveCodeOrderDetail(@Param("acId") Long acId, @Param("startTime") String startTime, @Param("endTime") String endTime);

	BigDecimal getOriRenewOrderMoney(@Param("startDate") String startDate, @Param("endDate") String endDate);

	BigDecimal getTotalMoney(@Param("startDate") String startDate, @Param("endDate") String endDate);

	BigDecimal getClearRenewOrderMoney(@Param("startDate") String startDate, @Param("endDate") String endDate);

	BrokenLineObjView selectDsPlatBrokenLineMoney(@Param("sharedId") Long sharedId, @Param("first") String first, @Param("end") String end);

	UserOrderDetailView getTagUserOrdersData(@Param("tagIdStr") String tagIdStr, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("consumeStTime") String consumeStTime, @Param("consumeEtTime") String consumeEtTime);

	Page<UserOrderDetailView> getTagUserDataPage(@Param("page") Page<UserOrderDetailView> page, @Param("tagIdStr") String tagIdStr, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("consumeStTime") String consumeStTime, @Param("consumeEtTime") String consumeEtTime);

	Page<CorpTagUserOrderDataView> getTagUserTimeOrderData(@Param("page") Page<Object> objectPage, @Param("tagIdStr") String tagIdStr, @Param("toDate") String toDate, @Param("startTime") String startTime, @Param("endTime") String endTime);

	List<RealGoodsSourceData> getRealGoodsSourceData(@Param("isGeneral") Boolean isGeneral, @Param("startDate") String startDate, @Param("endDate") String endDate);

	String selectMaxRefundGoodsName(@Param("operator") String operator, @Param("startTime") String startTime, @Param("endTime") String endTime);

	OrderDonCustomerServiceRelate selectOrderRelate(Long orderId);

	BigDecimal selectSubChannelOrderMoney(@Param("sharedId") Long sharedId, @Param("invitedTime") Date invitedTime, @Param("limitTime") Date limitTime);

	Page<UserOrderDetailView> getPastRecord(@Param("objectPage") Page<Object> objectPage, @Param("tagIdStr") String tagIdStr, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("consumeStTime") String consumeStTime, @Param("consumeEtTime") String consumeEtTime);

	UserOrderDetailView getNumOfTagFansUser(@Param("tagIdStr") String tagIdStr, @Param("startTime") String startTime, @Param("endTime") String endTime);

	UserOrderDetailView getFansToDayOrdersView(@Param("tagIdStr") String tagIdStr, @Param("date") String date);

	List<Long> getPayGoodsIds(@Param("userIds") List<Long> relationUserIdList);

	BigDecimal getTotalRefundAmountTime(@Param("startDate") Date startDate, @Param("endDate") Date endDate);

	BigDecimal getCouponUsedMoney(Long couponId);

	Integer checkUserHasPaidMjMirror(@Param("list") List<Long> userIdList);

	Map<String, Object> selectUserMIrrorShopDistributeOrderDetail(@Param("startDate") Date startDate, @Param("endDate") Date endDate);
}
