package com.gree.mall.manager.commonmapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gree.mall.manager.bean.engin.EnginPayManageGatherVO;
import com.gree.mall.manager.bean.engin.EnginPayManageVO;
import com.gree.mall.manager.bean.material.base.*;
import com.gree.mall.manager.bean.material.manage.*;
import com.gree.mall.manager.bean.material.stock.WebsitSalesCategoryVO;
import com.gree.mall.manager.bean.material.stock.WebsitSalesGoodsVO;
import com.gree.mall.manager.bean.material.vender.WebsitVenderVO;
import com.gree.mall.manager.zfire.bean.WebsitGoodsParamBean;
import com.gree.mall.manager.zfire.bean.ZfireParamBean;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MaterialMapper {

    /**
     * 配件基础
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<PartsBaseVO> partsBasePage(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 辅材分类
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<MaterialCategoryVO> materialCategoryPage(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 辅材列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<WebsitGoodsMVO> mPage(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 配件列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<WebsitGoodsPVO> pPage(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 师傅辅材列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<WorkerGoodsVO> workGoodsPage(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 网点商品价格列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<WebsitGoodsPriceVO> websitGoodsPricePage(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 网点商品调价列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<WebsitPriceUpdVO> websitPriceUpdPage(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 采购入库列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<WebsitPurchaseVO> websitPurchasePage(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 采购退货列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<WebsitPurchaseRetVO> websitPurchaseRetPage(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 供应商列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<WebsitVenderVO> websitVenderPage(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 收费标准列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<WebsitNormChargeVO> websitNormChargePage(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 销售订单列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<WebsitSalesVO> websitSalesPage(Page page,
                                         @Param("ex") ZfireParamBean zfireParamBean,
                                         @Param("goodsName") String goodsName,
                                         @Param("goodsSpecification") String goodsSpecification,
                                         @Param("isFilter") Boolean isFilter);

    /**
     * 根据存在的库存查询分类
     * @param companyWechatId
     * @param websitId
     * @return
     */
    List<WebsitSalesCategoryVO> existStockCategory(@Param("companyWechatId") String companyWechatId,
                                                   @Param("websitId") String websitId);

    /**
     * 根据存在的库存查询商品
     * @param companyWechatId
     * @param websitId
     * @param goodsType
     * @param categoryId
     * @param goodsName
     * @param goodsSpecification
     * @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("goodsSpecification") String goodsSpecification);

    /**
     * 查询配件
     * @param companyWechatId
     * @param websitId
     * @param goodsType
     * @param goodsName
     * @return
     */
    List<WebsitSalesGoodsVO> notStockGoods(@Param("companyWechatId") String companyWechatId,
                                             @Param("websitId") String websitId,
                                             @Param("goodsType") String goodsType,
                                             @Param("goodsName") String goodsName);

    /**
     * 交易列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<WebsitTradeVO> websitTradePage(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 工程开单辅材列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<WebsitGoodsAloneMVO> mAlonePage(Page page, @Param("ex") WebsitGoodsParamBean zfireParamBean);

    /**
     * 工程开单配件列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<WebsitGoodsAlonePVO> pAlonePage(Page page, @Param("ex") WebsitGoodsParamBean zfireParamBean);

    /**
     * 工程收款管理列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<EnginPayManageVO> enginPayManageList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    /**
     * 工程收款管理汇总列表
     * @param page
     * @param zfireParamBean
     * @return
     */
    IPage<EnginPayManageGatherVO> enginPayManageGatherList(Page page, @Param("ex") ZfireParamBean zfireParamBean);

    List<EnginPayManageGatherVO> enginPayManageGatherLastUpdate(@Param("companyWechatId") String companyWechatId, @Param("projectList") List<String> projectList);

    List<WorkerGoodsRelaExportBean> exportWorkerMaterialRela(@Param("companyWechatId") String companyWechatId);
}
