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

import org.springframework.data.jpa.repository.Query;

import com.sw.mes.core.base.BaseDao;
import com.sw.mes.yb.production.entity.InspectionRecord;

import java.util.List;

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

	@Query(value = "select * from production_inspection_record where crystal_no=?1 order by id desc limit 1",nativeQuery = true)
	InspectionRecord getLastCrystalNoLog(String crystalNo);


	@Query(value = "select * from production_inspection_record where pail_num=?1 order by id desc",nativeQuery = true)
	List<InspectionRecord> getRecordByPailNum(String pailNum);

    List<InspectionRecord> findTop2ByLongCrystalIdOrderByIdDesc(Long id);

}
