vince
2024-01-27 facc0ea3fa37091a98aa1e0a0d1081fd32fba28e
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
31
32
33
34
35
36
37
38
39
40
package com.fzzy.async.fzzy40.repository;
 
import com.fzzy.async.fzzy40.entity.Fz40Grain;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
 
import java.util.Date;
import java.util.List;
 
/**
 * 查询粮情检测数据
 *
 * @author chen
 * @date 2022-09-07 14:35
 */
public interface Fzzy40Sync1302Rep extends JpaRepository<Fz40Grain, String> {
 
    /**
     * 根据时间段查询粮情数据
     *
     * @param start
     * @param end
     * @return
     */
    @Query("from Fz40Grain where receiveDate >=:start and receiveDate <:end order by receiveDate ")
    List<Fz40Grain> findByReceiveDate(@Param("start") Date start, @Param("end") Date end);
 
 
    /**
     * 根据时间段查询粮情数据
     *
     * @param depotId
     * @param start
     * @param end
     * @return
     */
    @Query("from Fz40Grain where depotId =:depotId and receiveDate >=:start and receiveDate <:end order by receiveDate desc ")
    List<Fz40Grain> findByReceiveDate(@Param("depotId") String depotId, @Param("start") Date start, @Param("end") Date end);
}