czt
2025-06-11 283da741b2429cf5a53786e5ee1b5528b757fdf6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.fzzy.igds.grain.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<Grain, String>, JpaSpecificationExecutor<Grain> {
 
    /**
     * 根据组织编码和库区编码获取信息
     *
     * @param companyId
     * @param depotId
     * @return
     */
    @Query("from Grain where companyId =:companyId and depotId =:depotId order by batchId DESC")
    List<Grain> listGrain(@Param("companyId") String companyId, @Param("depotId") String depotId);
 
}