package com.gree.mall.miniapp.commonmapper;

import com.baomidou.mybatisplus.annotation.SqlParser;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gree.mall.miniapp.bean.material.*;
import com.gree.mall.miniapp.bean.material.stock.WorkerNormStockBean;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MaterialMapper {


    /**
     * 购买记录
     */
    @SqlParser(filter = true)
    IPage<SalesOrderBean> buyList(IPage page, @Param("companyWechatId") String companyWechatId, @Param("userId") String userId, @Param("flag") String flag);

    /**
     * 网点库存分类
     *
     * @param companyWechatId
     * @param websitId
     * @return
     */
    List<WebsitSalesCategoryVO> existStockCategory(@Param("companyWechatId") String companyWechatId, @Param("websitId") String websitId);

    /**
     * 网点库存商品
     *
     * @param companyWechatId
     * @param websitId
     * @return
     */
    List<WebsitSalesGoodsVO> existStockGoods(@Param("companyWechatId") String companyWechatId,
                                             @Param("websitId") String websitId,
                                             @Param("goodsType") String goodsType,
                                             @Param("categoryId") String categoryId,
                                             @Param("goodsName") String goodsName);

    /**
     * 非网点库存商品
     *
     * @param companyWechatId
     * @param websitId
     * @return
     */
    List<WebsitSalesGoodsVO> notStockGoods(@Param("companyWechatId") String companyWechatId,
                                             @Param("websitId") String websitId,
                                             @Param("goodsType") String goodsType,
                                             @Param("categoryId") String categoryId,
                                             @Param("goodsName") String goodsName);

    /**
     *
     * @param page
     * @param companyWechatId
     * @param userId
     * @param orderId
     * @param goodsType
     * @param startTime
     * @param endTime
     * @return
     */
    @SqlParser(filter = true)
    IPage<NormRecordVO> normRecordList(IPage page,
                                       @Param("companyWechatId") String companyWechatId,
                                       @Param("userId") String userId,
                                       @Param("orderId") String orderId,
                                       @Param("goodsType") String goodsType,
                                       @Param("startTime") String startTime,
                                       @Param("endTime") String endTime);

    @SqlParser(filter = true)
    IPage<PartsRefundVO> partsRefundList(Page<Object> objectPage,
                                         @Param("companyWechatId") String currentCompanyWechatId,
                                         @Param("userId") String userId,
                                         @Param("type") String type,
                                         @Param("status") String status);

    /**
     * 查询购物车的商品清单
     * @param workerId
     * @param websitId
     * @param goodsType
     * @return
     */
    List<WebsitShoppingCartList> queryShoppingCartList(@Param("workerId") String workerId,
                                                       @Param("websitId") String websitId,
                                                       @Param("goodsType") String goodsType);

    /**
     * 收费标准师傅库存
     * @param goodsId
     * @param workerId
     * @return
     */
    List<WorkerNormStockBean> queryWorkerStockQty(@Param("goodsId") String goodsId, @Param("workerId") String workerId);
}
