package com.fjhx.purchase.mapper.purchase;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.purchase.entity.purchase.dto.PurchaseDto;
import com.fjhx.purchase.entity.purchase.po.Purchase;
import com.fjhx.purchase.entity.purchase.vo.PurchaseDetailVo;
import com.fjhx.purchase.entity.purchase.vo.PurchaseVo;
import com.fjhx.purchase.entity.quality.po.QualityDetail;
import com.fjhx.wms.entity.PurchaseDetailPo;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.utils.wrapper.IWrapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * <p>
 * 采购 Mapper 接口
 * </p>
 *
 * @author
 * @since 2023-04-06
 */
public interface PurchaseMapper extends BaseMapper<Purchase> {

    /**
     * 采购分页
     */
    Page<PurchaseVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<Purchase> wrapper);
    List<PurchaseVo> getList(@Param("ew") IWrapper<Purchase> wrapper);

    PurchaseVo getPageStatistics(@Param("ew") IWrapper<Purchase> wrapper);




    /**
     * 查询货款账单
     * @param query
     * @return
     */
    Page<PurchaseDto> paymentBill(@Param("page") Page<Object> page,@Param("ew") QueryWrapper<Object> query);

    /**
     * 查询到货金额
     * @param query
     * @return
     */
    List<PurchaseDto> arrivalAmount(@Param("ew") QueryWrapper<Object> query);

    /**
     * 查询已付款金额
     * @param wrapper
     * @return
     */
    List<PurchaseDto> paidAmount(@Param("ew") QueryWrapper<Object> wrapper);

    /**
     * 获取已采购产品部门列表
     */
    List<SysDept> getDepts();

    /**
     * 获取已采购数量
     */
    List<PurchaseDetailPo> getPurchaseCountList(@Param("ew") IWrapper<Object> wrapper);

    /**
     * 获取采购次品数量
     */
    List<QualityDetail> getPurchaseDisqualificationQuantity(@Param("purchaseId") Long purchaseId);

    List<PurchaseDetailVo>getArrayInfoById(@Param("ew") IWrapper<Object> wrapper);
}
