package com.fjhx.stock.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fjhx.entity.stock.StockDetail;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

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

/**
 * <p>
 * 物料库存明细 Mapper 接口
 * </p>
 *
 * @author ${author}
 * @since 2022-08-01
 */
public interface StockDetailMapper extends BaseMapper<StockDetail> {

    Map<String, Object> getMaterialInfoByQrCode(@Param("qrCode") String qrCode);

    @InterceptorIgnore(tenantLine = "1")
    List<Map<String, Object>> restrictedPicking(@Param("jobNo") String jobNo, @Param("date") Date date);

    @MapKey("materialCode")
    Map<String, Map<String, BigDecimal>> getMaterialQuantity(@Param("ew") QueryWrapper<Object> wrapper);

    List<Map<String, Object>> selectRecommendMaterial(@Param("materialCode") String materialCode);

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

    @MapKey("jobNo")
    Map<String, Map<String, String>> selectUserByJobNoList(@Param("ew") QueryWrapper<Object> wrapper);

    @MapKey("code")
    List<Map<String, Object>> getPlanListByUser(@Param("ew") QueryWrapper<Object> wrapper, @Param("jobNo") String jobNo);

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

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

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

    @InterceptorIgnore(tenantLine = "1")
    List<Map<String, Object>> selectClaimed(@Param("ew") QueryWrapper<Object> wrapper);

}
