package com.fjhx.apply.mapper;

import cn.hutool.core.date.DateTime;
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.entity.apply.ApplyPurchase;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 申购单 Mapper 接口
 * </p>
 *
 * @author ${author}
 * @since 2022-08-04
 */
public interface ApplyPurchaseMapper extends BaseMapper<ApplyPurchase> {

    List<Map<String, Object>> technologyTypeStatistics(@Param("ew") QueryWrapper<Object> wrapper);

    List<Map<String, Object>> numStatistics(@Param("ew") QueryWrapper<Object> wrapper);

    Map<String, Object> totalNumStatistics(@Param("ew") QueryWrapper<Object> wrapper);

    Page<Map<String, Object>> getPage(@Param("page") Page<?> page, @Param("ew") QueryWrapper<Object> wrapper);

    @MapKey("materialCode")
    Map<String, Map<String, Object>> selectDelay(@Param("dateTime") DateTime dateTime, @Param("ew") QueryWrapper<Object> wrapper);

}
