廖井涛
2025-06-11 42154214c5698326710edf336b3148830b646bb2
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
41
42
43
44
45
46
47
48
49
50
package com.northglass.repository;
 
import java.util.Date;
import java.util.List;
 
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
 
import com.northglass.constants.StateConstants.RawPackageTxtState;
import com.northglass.entity.GalssTaskDetails;
import com.northglass.entity.Rank;
import com.northglass.entity.RawFile;
import com.northglass.entity.RawFile2;
 
public interface RawFileDao2 extends JpaRepository<RawFile2, Long>{
 
    @Query("select t from RawFile t where t.fileName = '052-123' and t.fileUrl = '1' and t.state = '已下发' and t.operator = '1' and t.createTime = '2021-09-22 13:22:18' and t.receiveTime = '2021-09-22 13:22:21' ")
    public List<RawFile2> findMachineDispose();
    
    //找到对应产线的状态为已领取的对象
    @Query("select t from RawFile2 t where t.state = '已领取' and t.operator=?1 and t.jiakong=0")
    public RawFile2 findAcceptedByGroup(Long operator);
    
    @Query("select t from RawFile2 t where t.state = '未领取' and (t.operator=?1 or t.operator=0) and t.jiakong=0")
    public List<RawFile2> findAcceptedByGroups(Long operator);
    
  //找到对应产线的状态为已领取的对象
    @Query("select t from RawFile2 t where t.state = '已领取' and t.operator=?1 and t.jiakong=0")
    public RawFile2 findIdGroup(Long operator);
    
  //找到对应产线的状态为已领取的对象
    @Query("select t from RawFile2 t where t.state = '未领取'  and (t.operator=?1 or t.operator=0) and t.jiakong=0")
    public List<RawFile2> findTasks(Long operator);
    
    @Query("select t from RawFile2 t where t.state = '未领取'  and t.operator=0 and t.jiakong=1")
    public List<RawFile2> findTasks1();
    
 
    @Query("select t from RawFile2 t where t.state = '中断' and t.operator=?1 and t.jiakong=0")
    public List<RawFile2> findInterruptTasks(Long operator);
    
    @Query("select t from RawFile2 t where t.state = '已领取' and t.fileName=?1 and t.jiakong=0")
    public RawFile2 findfileName(String fileName);
    
    @Query("select t from RawFile2 t where  t.fileName=?1 ")
    public List<RawFile2> findfileNamelist(String fileName);
    
    
 
}