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

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

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

/**
 * @Author
 * @Description：
 * @Date:
 * @Modified By:
 */
public interface ZhxxOperateCheckOutDataDao extends BaseDao<FbCheckOutData, Long> {


    @Query(value = "SELECT length AS length ,specification AS specs ,square_rod_remark AS remark,product_level AS type FROM `zhxx_operate_check_out_data` WHERE fb_section_no = ?1", nativeQuery = true)
    Map<String, Object> findFbSectionInfoBySegmentNo(String secitonNoFb);


    @Query(value = "SELECT * FROM `zhxx_operate_check_out_data` WHERE fb_section_no IN ?1 ORDER BY length DESC", nativeQuery = true)
    List<FbCheckOutData> findZhxxOperateCheckOutDataByFbSectionNoIns(List<String> sectionNoFbs);


    @Query(value = "SELECT id FROM `zhxx_operate_check_out_data` WHERE fb_section_no = ?1", nativeQuery = true)
    Long findIdBySectionNoFb(String secitonNoFb);


    @Query(value = "SELECT * FROM `zhxx_operate_check_out_data` WHERE fb_section_no IN ?1", nativeQuery = true)
    List<FbCheckOutData> findListBySectionNoFb(List<String> sectionNoFbs);

    List<FbCheckOutData> findByFbSectionNo(String sectionNoFb);
}
