package com.prolog.eis.dao.out;


import com.prolog.eis.dto.strategy.ContainerInfoDto;
import com.prolog.eis.model.container.ContainerInfo;
import com.prolog.eis.model.led.LedC;
import com.prolog.framework.dao.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface ContainerInfoMapper extends BaseMapper<ContainerInfo> {

    List<ContainerInfoDto> getContainerInfoDto(@Param("warehouseArea") String warehouseArea);

    List<ContainerInfoDto> getAllStock(@Param("warehouseArea") Integer warehouseArea);

    List<ContainerInfoDto> getContainerInfo();



    /**
     * 查询不合格产品
     *
     * @param warehouseArea
     * @return
     */
    List<ContainerInfoDto> getContainerInfoDtoByFail(@Param("warehouseArea") String warehouseArea);

    @Select("select id,container_no containerNo,container_type containerType,create_time createTime,update_time updateTime,task_type taskType from container_info where task_type in(10,20,30,40,50,60)")
    List<ContainerInfo> findtest();


    @Select("SELECT\n" +
            "\tbiz_inbound_task.* \n" +
            "FROM\n" +
            "\tbiz_inbound_task\n" +
            "\tINNER JOIN biz_inbound_task_detail ON biz_inbound_task.id = biz_inbound_task_detail.inbound_id\n" +
            "\tINNER JOIN goods_info ON biz_inbound_task_detail.item_id = goods_info.item_id \n" +
            "WHERE\n" +
            "\tbiz_inbound_task.container_no = #{stockId}")
    LedC findContainerInfo(String stockId);

    List<ContainerInfoDto> findAGVLContainerInfo(@Param("warehouseArea") String warehouseArea);
}
