package com.fizz.business.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

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

@Mapper
public interface L3PickupRecommendMapper {

    @Select("SELECT action_id, coil_id, current_coil_no, priority, scan_time " +
            "FROM wms_coil_pending_action " +
            "WHERE action_type = 501 AND action_status = 0 AND del_flag = 0 " +
            "ORDER BY priority DESC, scan_time ASC, action_id ASC LIMIT #{limit}")
    List<Map<String, Object>> selectPendingActions(@Param("limit") Integer limit);

    @Select("SELECT coil_id, enter_coil_no FROM wms_material_coil WHERE coil_id = #{coilId} LIMIT 1")
    Map<String, Object> selectMaterialByCoilId(@Param("coilId") Long coilId);
}
