package com.sw.mes.sap.dao;

import java.util.List;

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

import com.sw.mes.core.base.BaseDao;
import com.sw.mes.sap.entity.ReportSapMblnrQuery;

/**
 * 物料凭证查询接口Dao接口
 * 
 * @author liru
 * @date 2024-04-15
 */
public interface ReportSapMblnrQueryDao extends BaseDao<ReportSapMblnrQuery, Long> {

	List<ReportSapMblnrQuery> findByMblnr(String mblnr);

	@Query(value = "SELECT t.*,f.mblnr mesmblnr FROM jinko_mes.report_sap_mblnr_query t left join jinko_mes.report_sap_goodsmvt f ON t.mblnr = f.mblnr where t.usnam_mkpf='JIP_RFC' and (t.umlgo='' or t.umlgo is null or LEFT(t.umlgo,1)='P') having f.mblnr is null order by budat_mkpf", nativeQuery = true)
	List<ReportSapMblnrQuery> contrastGoodsmvt();

	List<ReportSapMblnrQuery> findBySyned(Boolean syned);

}