package com.fjhx.sale.mapper.purchase;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.sale.entity.purchase.po.EhsdPurchaseProduct;
import com.fjhx.sale.entity.purchase.vo.EhsdPurchaseProductVo;
import com.ruoyi.common.utils.wrapper.IWrapper;
import org.apache.ibatis.annotations.Param;

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


/**
 * <p>
 * ehsd采购产品表 Mapper 接口
 * </p>
 *
 * @author
 * @since 2023-05-17
 */
public interface EhsdPurchaseProductMapper extends BaseMapper<EhsdPurchaseProduct> {

    /**
     * ehsd采购产品表分页
     */
    Page<EhsdPurchaseProductVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<EhsdPurchaseProduct> wrapper);

    /**
     * 查询采购产品总金额，通过数据来源ID
     * @param contractIds
     * @return
     */
    List<EhsdPurchaseProductVo> getGroupSumAmount(List<Long> contractIds);

    /**
     * 根据合同ID查询采购产品列表
     * @param contractId
     * @return
     */
    List<EhsdPurchaseProductVo> getListByContractId(Long contractId);

    boolean updatePurchaseId(@Param("id")Long id ,@Param("newId")Long newId,@Param("userId")Long userId);
}
