廖井涛
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
package com.northglass.repository;
 
import java.util.List;
 
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
 
import com.northglass.constants.ShelfTaskType;
import com.northglass.constants.StateConstants.ShelfTaskState;
import com.northglass.entity.ShelfTask2;
 
public interface ShelfTaskDao2 extends JpaRepository<ShelfTask2, 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 t from ShelfTask2 t where t.taskState != '已下车'")
    public List<ShelfTask2> findWaitingTasks();
    
    @Query("select t from ShelfTask2 t where t.taskState = '正在上车' or t.taskState = '正在下车'")
    public List<ShelfTask2> findWorkingTasks();
    
    @Query("select count(t) from ShelfTask2 t where (t.taskState = '等待中' or t.taskState = '正在工作') and t.loadRack=?1 and t.shelfRack.id=?2 and t.taskType='从仓位到上片位'")
    public int pandian(String loadid,Long shelfranid);
    
    @Query("select t from ShelfTask2 t where t.taskState = '已完成' and t.line=?1")
    public List<ShelfTask2> findCompletedTasks(Long line);
 
    @Query("select t from ShelfTask2 t where t.taskState = '正在工作' and t.line=?1")
    public List<ShelfTask2> findInWorkTask1(Long line);
    
    @Query("select t from ShelfTask2 t where t.taskState = '正在工作' ")
    public ShelfTask2 findInWorkTask();
    
 
    
    @Query("select t from ShelfTask2 t where t.taskState='等待中' and t.groups is not null")
    public List<ShelfTask2> findWaitingTasksByFlag();
    
    @Query("select t from ShelfTask2 t where t.taskState='正在工作' and t.groups is not null")
    public ShelfTask2 findInWorkTasksByFlag();
    
    @Query("select t from ShelfTask2 t where (t.taskType = '从吊装位到仓位' or t.taskType = '从仓位到吊装位') and t.taskState = '等待中'")
    public List<ShelfTask2> findShelfTask2FromShelfRackToHoist();
    
    @Query("select t from ShelfTask2 t where  (t.taskState = '等待中' or t.taskState = '正在工作') and t.loadRack= ?1")
    public List<ShelfTask2> selectloadMachineId(String id);
    
 
}