package com.sw.mes.sap.dao;

import java.util.List;

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

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


/**
 * 对账数据
 * @author liru
 */
public interface MesReconciliationDao extends BaseDao<MesReconciliation, Long>
{

	@Modifying
    @Query(value = "update mes_reconciliation r,log_sap_stock s set s.reconciliation_id=r.id where r.sku=s.matnr and r.lot = s.charg", nativeQuery = true)
	void buildSAPStockAndReconciliation();

	List<MesReconciliation> findByLotAndSku(String lotatt04, String sku);

}
