package com.ruoyi.frequency.mallorder.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.controller.req.MallOrderPageReq;
import com.ruoyi.controller.resp.MallOrderDetailResp;
import com.ruoyi.controller.resp.MallOrderPageResp;
import com.ruoyi.frequency.mallorder.entity.MallOrder;
import com.ruoyi.frequency.mallorder.model.result.MallOrderCount;
import com.ruoyi.vo.UserVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 订单主Mapper接口
 *
 * @author liwenlong
 * @date 2024-01-25
 */
public interface MallOrderMapper  extends BaseMapper<MallOrder>
{
    /**
     * 查询订单主
     *
     * @param id 订单主主键
     * @return 订单主
     */
    public MallOrder selectMallOrderById(Long id);

    /**
     * 查询订单主列表
     *
     * @param mallOrder 订单主
     * @return 订单主集合
     */
    public List<MallOrder> selectMallOrderList(MallOrder mallOrder);

    /**
     * 新增订单主
     *
     * @param mallOrder 订单主
     * @return 结果
     */
    public int insertMallOrder(MallOrder mallOrder);

    /**
     * 修改订单主
     *
     * @param mallOrder 订单主
     * @return 结果
     */
    public int updateMallOrder(MallOrder mallOrder);

    List<MallOrder> selectOrderNeedConfirmReceipt(@Param("days") Integer days);

    List<MallOrder> arrivalAmount();

    Page<MallOrderPageResp> orderPage(@Param("page") Page<Object> objectPage, @Param("req") MallOrderPageReq req, @Param("userVo")UserVo userVo);

    MallOrderDetailResp orderDetail(@Param("orderId") Long orderId);

    List<MallOrderPageResp> orderList(@Param("list") List<Long> mallOrderIds,@Param("userVo") UserVo userVo);

    Integer hasBuyNum(@Param("goodsId")Long goodsId, @Param("userVo")UserVo userVo);

    MallOrderCount statistics(@Param("list")List<Long> mallOrderIdList);
}
