廖井涛
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package com.northglass.repository;
 
import java.util.List;
 
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
 
import com.northglass.entity.GalssTask;
 
public interface GalssTaskDao extends JpaRepository<GalssTask, Long>{
 
    /*@Query("select min(t.patternTask.rank) from GalssTask t where t.workProcedure='测量' and t.workState='待识别' and t.patternTask.groups=?1 order by t.patternTask.rank")
    public Long findBypatternTask(Long groups);
    
    @Query("select t from GalssTask t where t.patternTask.groups=?1 and t.patternTask.rank=?2 order by t.patternTask.rank")
    public List<GalssTask> findBypatternTask(Long groups,Long rank);*/
    
    @Query("select t from GalssTask t where t.workProcedure='测量' and t.patternTask.groups=?1")
    public List<GalssTask> findByprocedure(Long groups);
    
    @Query("select t from GalssTask t where t.workProcedure='理片' and (t.workState='出库中' or t.workState='进库中' or t.workState='等待中' or t.workState='已出库' or t.workState='直通') and t.patternTask.groups=?1 ")
    public List<GalssTask> findByproceduretask(Long groups);
    
    @Query("select count(t) from GalssTask t where t.workProcedure='理片'  and t.patternTask.groups=?1 ")
    public int finlipian(Long groups);
    
    @Query("select count(t) from GalssTask t where t.workProcedure='理片'  and t.engineeringId=?1 ")
    public int finlipian2(String engineeringId);
    
    @Query("select t from GalssTask t where t.workProcedure='下片' and t.workState=?1 and t.patternTask.groups=?2")
    public List<GalssTask> findByCounttask(String state,Long groups);
    
    @Query("select t from GalssTask t where t.workProcedure='测量' and t.workState='待识别' and t.patternTask.groups=?1 order by t.patternTask.id")
    public List<GalssTask> findByidentify1(Long groups);
    
    @Query("select t from GalssTask t where t.workProcedure='测量' and t.workState='待识别' and t.patternTask.groups=?1 and (((t.width<=?3 and t.width>=?2) and (t.height<=?5 and t.height>=?4)) or ((t.width<=?5 and t.width>=?4) and (t.height<=?3 and t.height>=?2))) order by t.patternTask.id")
    public List<GalssTask> findByidentify2(Long groups,Double minwidth,Double maxwidth,Double minheigth,Double maxheigth);
    
    @Query("select t from GalssTask t where t.workProcedure='测量' and t.workState='待识别' ")
    public List<GalssTask> findByidentify();
    
    @Query("select t from GalssTask t where t.workProcedure='磨边' and t.workState='已完成' and  t.patternTask.groups=?1")
    public List<GalssTask> findTopTenFinshByGaoliweiMachine(Long groups);
    
    @Query("select t from GalssTask t where t.workProcedure='磨边' and (t.workState='正在工作' or t.workState='等待中') and  t.patternTask.groups=?1 order by outRank ")
    public List<GalssTask> findInWorkgaoliwei(Long groups);
    
    @Query("select t from GalssTask t where t.workProcedure='复合' and t.workState='复合失败' and t.patternTask.groups=?1")
    public List<GalssTask> findIncompound(Long groups);
    
    @Query("select t from GalssTask t where t.typeId=?1 and t.patternTask.groups=?2")
    public List<GalssTask> findbyTypeId(Long id,Long groups);
    
    @Query("select t from GalssTask t where t.patternTask.id=?1")
    public List<GalssTask> findpattern(Long id);
    
    @Query("select t from GalssTask t where t.patternTask.id=?1 and t.workState='待识别' and t.workProcedure='测量'")
    public List<GalssTask> findpattern1(Long id);
    
    @Query("select t from GalssTask t where t.typeId=?1 ")
    public List<GalssTask> findbyTypeId1(Long id);
    
    @Query("select t.dropFrame from GalssTask t where t.patternTask.groups=?1 group by dropFrame ")
    public List<GalssTask> findDroplist(Long groups);
    
    @Query("select t from GalssTask t where t.dropFrame=?1 and t.patternTask.groups=?2")
    public List<GalssTask> findDropframeList(String dropframe,Long groups);
    
    @Query("select t from GalssTask t where t.slicecageRank=?1 and t.patternTask.groups=?2")
    public List<GalssTask> findslicecagerank(Long slicecagerank,Long groups);
    
    @Query("select t from GalssTask t where t.slicecageRank=?1 and t.patternTask.groups=?2")
    public List<GalssTask> findslicecagerank2(Long slicecageid,Long groups);
    
    
    @Query("select count(t) from GalssTask t where t.dropFrame=?1 and t.patternTask.groups=?2")
    public int finddropframecount(String dropframe,Long groups);
    
    
    @Query("select t from GalssTask t where t.patternTask.groups=?1 order by dropFrame")
    public List<GalssTask> findbygroups(Long line);
    
    @Query("select t from GalssTask t where t.patternTask.groups=?1 and t.workProcedure<>'测量' and t.workState<>'已进库' and t.workState<>'进库中' and t.workState<>'出库中' and t.workState<>'破损' and t.workState<>'已完成'  and t.outRank<>0 order by outRank desc")
    public List<GalssTask> findbygalsssum(Long line);
    
    @Query("select t from GalssTask t where t.patternTask.groups=?1 and t.workState='破损' order by dropFrame")
    public List<GalssTask> findbydamagedgroups(Long line);
    
    @Query("select t from GalssTask t where t.engineeringId=?1 ")
    public List<GalssTask> findbyengineering(String engineering);
    
    @Modifying
    @Query("delete from GalssTask t where t.engineeringId=?1")
    public void deleteGlassTask(String engineering);
    
    @Query("select count(t) from GalssTask t where t.workProcedure='下片' and t.workState='已完成' and t.patternTask.groups=?1 ")
    public int findByfindcount(Long line);
    
    @Query("select count(t) from GalssTask t where t.patternTask.groups=?1 ")
    public int findBysum(Long line);
    
    @Query("select count(t) from GalssTask t where t.workProcedure='测量' and t.workState='待识别' and t.patternTask.groups=?1 ")
    public int findBycount(Long line);
    
    @Query("select max(t.typeId) from GalssTask t where t.patternTask.id=?1")
    public int finmaxtypeid(Long id);
    
}