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{ /*@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 findMachineDispose();*/ @Query("select t from ShelfTask2 t where t.taskState != '已下车'") public List findWaitingTasks(); @Query("select t from ShelfTask2 t where t.taskState = '正在上车' or t.taskState = '正在下车'") public List 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 findCompletedTasks(Long line); @Query("select t from ShelfTask2 t where t.taskState = '正在工作' and t.line=?1") public List 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 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 findShelfTask2FromShelfRackToHoist(); @Query("select t from ShelfTask2 t where (t.taskState = '等待中' or t.taskState = '正在工作') and t.loadRack= ?1") public List selectloadMachineId(String id); }