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

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

import java.util.List;

public interface ProductionMaterialReturnRecordDao extends BaseDao<ProductionMaterialReturnRecord, Long>{


    @Query(value = "select * from production_material_return_record where again_num= ?1 and batch_no = ?2", nativeQuery = true)
    List<ProductionMaterialReturnRecord> findByAgainNumAndBatchNo(Integer againNum, String batchNo);
    @Query(value = "select * from production_material_return_record where again_num= ?1 and batch_no = ?2 and lot_no = ?3", nativeQuery = true)
    List<ProductionMaterialReturnRecord> findByAgainNumAndBatchNoAndLotNo(Integer againNum, String batchNo, String lotNo);
}
