廖井涛
2025-05-26 3a975df5b368bc68ee7a81d34920b209f2ff607b
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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;
 
public interface RawFileDao extends JpaRepository<RawFile, 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<RawFile> findMachineDispose();
    
    //找到对应产线的状态为已领取的对象
    @Query("select t from RawFile t where t.state = '已领取' and t.operator=?1")
    public RawFile findAcceptedByGroup(Long operator);
    
    @Query("select t from RawFile t where  t.id=?1")
    public RawFile findAcceptedByGroup2(Long id);
    
    @Query("select t from RawFile t where t.state = '已下发' and (t.operator=?1 or t.operator=0)")
    public List<RawFile> findAcceptedByGroups(Long operator);
    
  //找到对应产线的状态为已领取的对象
    @Query("select t from RawFile t where t.state = '已领取' and t.operator=?1")
    public RawFile findIdGroup(Long operator);
    
    @Query("select t from RawFile t where t.state = '正在切割' and t.operator=?1")
    public RawFile findIdGroup1(Long operator);
    
  //找到对应产线的状态为已领取的对象
    @Query("select t from RawFile t where (t.state = '已下发' or t.state = '中断') and (t.operator=?1 or t.operator=0)")
    public List<RawFile> findTasks(Long operator);
    
 
    @Query("select t from RawFile t where t.state = '中断' and t.operator=?1")
    public List<RawFile> findInterruptTasks(Long operator);
    
    @Query("select t from RawFile t where t.state = '已领取' and t.fileName=?1")
    public RawFile findfileName(String fileName);
    
    @Query("select t from RawFile t where  t.fileName=?1 ")
    public List<RawFile> findfileNamelist(String fileName);
    
    @Query(nativeQuery=true,value="select * from gmms_raw_file where  state='已完成' and file_name like '%P%' order by receive_time desc limit 0,50")
    public List<RawFile> findfileNameall();
    
    @Query(nativeQuery=true,value="select * from gmms_raw_file where  state='已完成' and file_name like '%P%' and receive_time>=?1 and receive_time<=?2 order by receive_time ")
       public List<RawFile> findalltime(Date create_time,Date end_time);
    
    @Query(nativeQuery=true,value="select * from gmms_raw_file where  state='已完成' and file_name like '%P%' and operator!=0  group by operator")
    public List<RawFile> findfileNamealls();
    
    @Query(nativeQuery=true,value="select sum(galssmeasure) from gmms_raw_file where  state='已完成' and file_name like '%P%' and operator=?1  group by operator")
    public String findfileNameall1(Long groups);
    
    @Query(nativeQuery=true,value="select sum(patternmeasure) from gmms_raw_file where  state='已完成' and file_name like '%P%' and operator=?1  group by operator")
    public String findfileNameall2(Long groups);
    
    @Query(nativeQuery=true,value="select sum(galssmeasure) from gmms_raw_file where  state='已完成' and file_name like '%P%' and operator=?3 and receive_time>=?1 and receive_time<=?2  group by operator")
    public String findfileNameall3(Date create_time,Date end_time,Long groups);
    
    @Query(nativeQuery=true,value="select sum(patternmeasure) from gmms_raw_file where  state='已完成' and file_name like '%P%' and operator=?3 and receive_time>=?1 and receive_time<=?2  group by operator")
    public String findfileNameall4(Date create_time,Date end_time,Long groups);
    
    /*@Query("select t from RawFile t where  t.createTime>=?1 and t.fileName like '%P%'")
    public List<RawFile> findfileNameall(Date time);*/
    
  //流程卡报表
    @Query("select t from RawFile t where  t.fileName=?1 ")
    public RawFile GetGongChengByGCH(String fileName);
    
  //获取除未领取工程的其他所有工程//v_completedtasks
    @Query(nativeQuery = true,value="SELECT * FROM v_completedtasks")
    public List<RawFile> GeOverStatetasks();
}