廖井涛
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
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
110
111
112
113
114
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.Modifying;
import org.springframework.data.jpa.repository.Query;
 
import com.northglass.entity.GalssTask2;
import com.northglass.entity.GalssTaskDetails;
 
public interface GalssTaskDao2 extends JpaRepository<GalssTask2, Long>{
 
    @Query("select t from GalssTask2 t where t.workProcedure='测量' and t.groups=?1")
    public List<GalssTask2> findByprocedure(Long groups);
    
    @Query("select t from GalssTask2 t where t.workProcedure='理片' and (t.workState='出库中' or t.workState='进库中' or t.workState='等待中' or t.workState='已出库') and t.groups=?1 ")
    public List<GalssTask2> findByproceduretask(Long groups);
    
    @Query("select t from GalssTask2 t where t.workProcedure='下片' and t.workState=?1 and t.groups=?2")
    public List<GalssTask2> findByCounttask(String state,Long groups);
    
    @Query("select t from GalssTask2 t where t.workProcedure='测量' and t.workState='待识别' and t.groups=?1")
    public List<GalssTask2> findByidentify1(Long groups);
    
    @Query("select t from GalssTask2 t where t.workProcedure='测量' and t.workState='待识别' ")
    public List<GalssTask2> findByidentify();
    
    @Query("select t from GalssTask2 t where t.workProcedure='磨边' and t.workState='已完成' and  t.groups=?1")
    public List<GalssTask2> findTopTenFinshByGaoliweiMachine(Long groups);
    
    @Query("select t from GalssTask2 t where t.workProcedure='磨边' and (t.workState='正在工作' or t.workState='等待中') and  t.groups=?1 order by outRank ")
    public List<GalssTask2> findInWorkgaoliwei(Long groups);
    
    @Query("select t from GalssTask2 t where t.workProcedure='钢化前复合' and t.workState='复合失败' and t.groups=?1")
    public List<GalssTask2> findIncompound(Long groups);
    
    @Query("select t from GalssTask2 t where t.workProcedure='钢化后复合' and t.workState='复合失败' and t.groups=?1")
    public List<GalssTask2> findIncompounds(Long groups);
    
    @Query("select t from GalssTask2 t where t.typeId=?1 ")
    public List<GalssTask2> findbyTypeId(Long id);
    
    @Query("select t.dropFrame from GalssTask2 t where t.groups=?1 group by dropFrame ")
    public List<GalssTask2> findDroplist(Long groups);
    
    @Query("select t from GalssTask2 t where t.dropFrame=?1 and t.groups=?2")
    public List<GalssTask2> findDropframeList(String dropframe,Long groups);
    
    @Query("select t from GalssTask2 t where t.slicecageRank=?1 and t.groups=?2")
    public List<GalssTask2> findslicecagerank(Long slicecagerank,Long groups);
    
    @Query("select t from GalssTask2 t where t.slicecageRank=?1 and t.groups=?2")
    public List<GalssTask2> findslicecagerank2(Long slicecageid,Long groups);
    
    
    @Query("select count(t) from GalssTask2 t where t.dropFrame=?1 and t.groups=?2")
    public int finddropframecount(String dropframe,Long groups);
//    钢化后下片完成
    @Query("select t from GalssTask2 t where t.groups=?1 and t.workProcedure='钢化后下片' and t.workState='已完成' and t.processcardId=?2")
    public List<GalssTask2> findbyFinshsum(Long line,String pro);
    
    @Query("select t from GalssTask2 t where t.groups=?1 order by dropFrame")
    public List<GalssTask2> findbygroups(Long line);
    
    @Query("select t from GalssTask2 t where t.groups=?1   and t.orders is not null and (t.workProcedure='钢化上片' or t.workProcedure='钢化前复合' or t.workProcedure='钢化前摆片' or t.workProcedure='钢化') and t.workState<>'破损' order by t.furnace,t.orders")
    public List<GalssTask2> findbygalsssum(Long line);
    
    @Query("select t from GalssTask2 t "
            + "where t.groups=?1   and t.orders is not null "
            + "and ((t.workProcedure='钢化' and t.workState<>'等待中' ) "
            + "or (t.workProcedure='钢化后摆片' ) or (t.workProcedure='钢化后复合') "
            + "or (t.workProcedure='钢化后下片' and t.workState<>'已完成')) and t.workState<>'破损' "
            + "order by t.furnace,t.grouporder,t.fineThrowing")
    public List<GalssTask2> findbygalsssums(Long line);
    
    @Query("select t from GalssTask2 t where t.groups=?1 and t.workState='破损' order by dropFrame")
    public List<GalssTask2> findbydamagedgroups(Long line);
    
    @Query("select t from GalssTask2 t where t.engineeringId=?1 ")
    public List<GalssTask2> findbyengineering(String engineering);
    
    @Modifying
    @Query("delete from GalssTask2 t where t.engineeringId=?1")
    public void deleteGlassTask(String engineering);
    
    @Query("select count(t) from GalssTask2 t where t.workProcedure='下片' and t.workState='已完成' and t.groups=?1 ")
    public int findByfindcount(Long line);
    
    @Query("select count(t) from GalssTask2 t where t.groups=?1 ")
    public int findBysum(Long line);
    
    @Query("select count(t) from GalssTask2 t where t.workProcedure='测量' and t.workState='待识别' and t.groups=?1 ")
    public int findBycount(Long line);
    
    @Modifying
    @Query("update GalssTask2 t set t.workState='未优化' where t.workProcedure='钢化上片' and t.workState='等待中' and t.processcardId=?1 ")
    public void findupdatestate(String porid);
    
    @Modifying
    @Query("delete from GalssTask2 t where  t.processcardId =?1 and t.groups=?2")
    public void deleteprocesscardid(String processcardid,long groups);
    
    @Query("select count(t) from GalssTask2 t where t.processcardId=?1 and t.groups=?2")
    public int findGalssWorking(String porid,long groups);
    
    @Query("select count(t) from GalssTask2 t where t.workProcedure='钢化上片' and t.processcardId=?1 and t.groups=?2")
    public int findGalssTask2Working(String porid,long groups);
    
    @Query("select count(t) from GalssTask2 t where ((t.workProcedure='钢化后下片' and t.workState='已完成') or t.workState='破损') and t.processcardId=?1 and t.groups=?2")
    public int findGalssTask2NotFinsh(String porid,long groups);
    
}