package com.ruoyi.web.modules.order.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.web.modules.account.dto.MemberOrderQueryDTO;
import com.ruoyi.web.modules.order.domain.BizOrder;
import com.ruoyi.web.modules.order.dto.OrderAppListQueryDTO;
import com.ruoyi.web.modules.order.dto.SellerOrderQuery;

public interface BizOrderMapper
{
    BizOrder selectById(Long orderId);

    BizOrder selectByIdAndMember(@Param("orderId") Long orderId, @Param("memberId") Long memberId);

    List<BizOrder> selectSellerList(@Param("shopId") Long shopId, @Param("query") SellerOrderQuery query);

    List<BizOrder> selectMemberList(@Param("memberId") Long memberId, @Param("query") MemberOrderQueryDTO query);

    int updateForShip(BizOrder order);

    int updateForDelete(@Param("orderId") Long orderId, @Param("shopId") Long shopId,
            @Param("updateBy") String updateBy);

    int existsUnfinishedByShop(Long shopId);

    int existsUnfinishedByMerchant(Long merchantId);

    int insert(BizOrder order);

    String selectMaxOrderNoByPrefix(@Param("prefix") String prefix);

    int updateForPay(BizOrder order);

    int updateForAftersaleClose(@Param("orderId") Long orderId, @Param("shopId") Long shopId,
            @Param("closeType") String closeType, @Param("updateBy") String updateBy);

    int updateForCancelPay(@Param("orderId") Long orderId, @Param("memberId") Long memberId,
            @Param("closeType") String closeType);

    List<BizOrder> selectExpiredPendingPay(@Param("now") java.util.Date now);

    List<BizOrder> selectMemberAppList(@Param("memberId") Long memberId, @Param("query") OrderAppListQueryDTO query);

    int countMemberByStatus(@Param("memberId") Long memberId, @Param("orderStatus") String orderStatus);

    int countShopByStatus(@Param("shopId") Long shopId, @Param("orderStatus") String orderStatus);

    int updateForConfirmReceive(@Param("orderId") Long orderId, @Param("memberId") Long memberId,
            @Param("finishTime") java.util.Date finishTime);

    java.math.BigDecimal sumPendingSettleByShopId(Long shopId);

    java.math.BigDecimal sumPlatformPendingSettle();

    List<BizOrder> selectShippedForAutoConfirm(@Param("autoConfirmDays") int autoConfirmDays,
            @Param("limit") int limit);
}
