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.ShelfTask; public interface ShelfTaskDao 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 ShelfTask t where t.taskId = ?1") public ShelfTask findtaskid(long taskid); @Query("select t from ShelfTask t where t.taskState = '等待中'") public List findWaitingTasks(); @Query("select count(t) from ShelfTask 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 ShelfTask t where t.taskState = '已完成'") public List findCompletedTasks(); @Query("select t from ShelfTask t where t.taskState = '正在工作'") public List findInWorkTask1(); @Query("select t from ShelfTask t where t.taskState = '正在工作' ") public ShelfTask findInWorkTask(); @Query("select t from ShelfTask t where t.rawFile.id = ?1") public ShelfTask findbyfile(long id); @Query("select t from ShelfTask t where t.rawFile.id = ?1") public List findbyfilelist(long id); @Query("select t from ShelfTask t where t.taskState='等待中' and t.groups is not null") public List findWaitingTasksByFlag(); @Query("select t from ShelfTask t where t.taskState='正在工作' and t.groups is not null") public ShelfTask findInWorkTasksByFlag(); @Query("select t from ShelfTask t where (t.taskType = '从吊装位到仓位' or t.taskType = '从仓位到吊装位') and t.taskState = '等待中'") public List findShelfTaskFromShelfRackToHoist(); @Query("select t from ShelfTask t where (t.taskState = '等待中' or t.taskState = '正在工作') and t.loadRack= ?1") public List selectloadMachineId(String id); @Query("select max(t.taskId) from ShelfTask t ") public Long findtaskid(); }