package com.fzzy.igds.dzhwk.service.repository; import com.fzzy.igds.dzhwk.domain.Grain; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Service; import java.util.List; /** * @Description * @Author CZT * @Date 2024/12/21 10:36 */ @Service public interface GrainRepository extends JpaRepository, JpaSpecificationExecutor { /** * 根据组织编码和库区编码获取信息 * * @param companyId * @param depotId * @return */ @Query("from Grain where companyId =:companyId and depotId =:depotId order by batchId DESC") List listGrain(@Param("companyId") String companyId, @Param("depotId") String depotId); }