package com.bofeng.dao;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.bofeng.entity.Order;
import com.bofeng.entity.Settle;
import com.bofeng.entity.SettleDetail;
import com.bofeng.entity.StatisticsOrder;
import com.yvan.PageDb;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

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

@Mapper
@Repository
public interface OrderMapper extends BaseMapper<Order> {

    List<Order> selectAll(PageDb pageDb);

    List<Order> search(PageDb pageDb, Map<String, Object> param);

    List<StatisticsOrder> groupByStatistics(PageDb pageDb, Map<String, Object> param);

    List<Order> serchCurrentMarkList(@Param("saleUserId") Long saleUserId);

    List<Order> selectBySale(PageDb pageDb, Map<String, Object> param);

    List<StatisticsOrder> groupByStatistics(Map<String, Object> queryParam);

    int ordersSettle(@Param("list") List<Long> list, @Param("settleId") Long settleId);

    List<Order> selectByUserId(Long userId);

    List<Order> selectCmsByUserId(@Param("userId") Long userId);

    List<Settle> getSettleOrder(PageDb pageDb, Map<String, Object> queryParam);

    List<SettleDetail> selectOrderBySaleIdAndTimeSpace(@Param("orderStartAt") String orderStartAt, @Param("orderEndAt") String orderEndAt, @Param("saleId") Long saleId, @Param("placeId") Long placeId);

    int payFinish(@Param("orderId") Long orderId, @Param("payAmount") BigDecimal payAmount);

    int discard(@Param("orderId") Long orderId);

    Order selectByRoomId(@Param("roomId") Long roomId);

    int discardByRoomId(@Param("roomId") Long roomId);
}
