package com.huimv.receiver.farm.dao.repo;

import com.huimv.receiver.farm.dao.entity.ProdBatchWeightEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.Optional;

public interface ProdBatchWeightRepo extends JpaRepository<ProdBatchWeightEntity, Integer>, JpaSpecificationExecutor<ProdBatchWeightEntity> {

    @Query(nativeQuery = true,value = "SELECT * FROM prod_batch_weight WHERE batch_code=?1")
    Optional<ProdBatchWeightEntity> findByBatchCode(String batchCode);
}