package com.fjhx.purchase.mapper.subscribe;

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.subscribe.po.SubscribeDetail;
import com.fjhx.purchase.entity.subscribe.vo.SubscribeDetailVo;
import com.ruoyi.common.utils.wrapper.IWrapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * <p>
 * 申购单 Mapper 接口
 * </p>
 *
 * @author
 * @since 2023-04-03
 */
@Mapper
public interface SubscribeDetailMapper extends BaseMapper<SubscribeDetail> {

    /**
     * 申购单分页
     */
    Page<SubscribeDetailVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<SubscribeDetail> wrapper);

    /**
     * 根据IDS查询明细
     *
     * @param ids
     * @return
     */
    List<SubscribeDetailVo> getDetail(@Param("ids") List<Long> ids);

    List<SubscribeDetailVo> subscribeStatistics(@Param("ew") QueryWrapper<Object> query);

    /**
     * 根据id获取已采购数量
     */
    List<SubscribeDetail> getPurchaseCountByIds(List<Long> ids);

    List<SubscribeDetailVo> getContractCountByContractIds(List<Long> ids);
}
