廖井涛
2025-05-27 084f17d969edbcc1a7dcf536a5555025372bae9c
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
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.GalssTaskDetails;
import com.northglass.entity.PatternTask;
 
public interface PatternTaskDao extends JpaRepository<PatternTask, Long>{
 
    /*@Query("select t from RawPackage 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<RawPackage> findMachineDispose();*/
    
    @Query("select count(t) from PatternTask t where t.workState='已完成' and t.rawFile.id=?1")
    public int findcount(Long rawid);
    
    @Query("select count(t) from PatternTask t where  t.rawFile.id=?1")
    public int findsum(Long rawid);
    
    @Query("select t from PatternTask t where t.workState='正在工作' and  t.rawFile.id=?1")
    public PatternTask findbyword(Long rawid);
    
    
    @Query("select t from PatternTask t where  t.rawFile.id=?1")
    public List<PatternTask> findbygroup(Long rawid);
    
    @Query("select t from PatternTask t where t.workState='已完成' and  t.groups=?1")
    public List<PatternTask> findbygroups(Long groups);
    
    
    @Query("select t from PatternTask t where t.workState='已完成' and  t.groups=?1 and t.rawFile.id=?2")
    public List<PatternTask> findbygroups2(Long groups,Long id);
    
    
    @Query("select t from PatternTask t where  t.groups=?1")
    public List<PatternTask> findIdGroup(Long groups);
    
    @Query("select t from PatternTask t where  t.groups=?1 group by t.rawWidth,t.rawHeight,t.rawThickness,t.color")
    public List<PatternTask> findIdGroupby(Long groups);
    
    
    @Modifying
    @Query("delete from PatternTask t where  t.rawFile.id=?1")
    public void deletepatternTask(Long rawid);
    
    
    @Query(nativeQuery=true,value="select * from gmms_pattern_task where flag=0 and groups=?1 ")
    public List<PatternTask> findbygroups3(Long groups);
    
    @Query(nativeQuery=true,value="select * from gmms_pattern_task where flag=0 and work_state='已完成' and groups=?1 order by rank limit 0,1")
    public PatternTask findbygroups2(Long groups);
    
    @Query(nativeQuery=true,value="select * from gmms_pattern_task where flag=1 and work_state='已完成' and groups=?1 order by rank desc limit 0,1")
    public PatternTask findbygroupsfalg(Long groups);
    
    
    
    
}