package com.sw.mes.yb.turnstore.dao;

import com.sw.mes.core.base.BaseDao;
import com.sw.mes.yb.turnstore.entity.TurnstoreOut;
import org.springframework.data.jpa.repository.Query;

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

/**
* @Author
* @Description：
* @Date:
* @Modified By:
*/
public interface TurnstoreOutDao extends BaseDao<TurnstoreOut, Integer> {
    @Query(value="SELECT IFNULL(MAX(sort),0) AS maxSort FROM zhxx_turnstore_out WHERE date=?1",nativeQuery = true)
    Integer getMaxSortByDate(String date);

    @Query(value="SELECT section_no AS sectionNo,inspector AS inspector,re_check_type AS reCheckType FROM yb_inspect_data WHERE section_no IN (?1)",nativeQuery = true)
    List<Map<String,Object>> getInspectBySectionNos(List<String> sectionNos);

    @Query(value="SELECT section_no AS sectionNo,re_check_type AS reCheckType,fine_diameter as fineDiameter," +
            " remark FROM yb_inspect_data WHERE section_no IN (?1)",nativeQuery = true)
    List<Map<String,Object>> getInfoBySectionNos(List<String> sectionNos);
}
