TaskInfoDao.java 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package com.xt.jygl.workflow.dao;
  2. import java.util.List;
  3. import org.springframework.data.jpa.repository.Query;
  4. import com.xt.jygl.workflow.entity.TaskInfoEntity;
  5. import com.xtframe.sec.common.SecRepository;
  6. /**
  7. * 任务信息Dao
  8. *
  9. */
  10. public interface TaskInfoDao extends SecRepository<TaskInfoEntity, String> {
  11. public TaskInfoEntity getByTaskId(String taskId);
  12. /**
  13. * 根据业务主键和业务类型查询
  14. *
  15. * @param busId
  16. * @param busKey
  17. * @return
  18. */
  19. public List<TaskInfoEntity> findByBusIdAndBusKey(String busId, String busKey);
  20. /**
  21. * 根据业务主键和业务类型查询
  22. *
  23. * @param busId
  24. * @param busKey
  25. * @return
  26. */
  27. public List<TaskInfoEntity> findByBusIdAndBusKeyOrderByIdAsc(String busId, String busKey);
  28. public List<TaskInfoEntity> findByBusKeyAndRunnerIdOrderByIdAsc(String busKey, String runnerId);
  29. public List<TaskInfoEntity> findByRunnerIdAndStateOrderByIdAsc(String runnerId, String state);
  30. @Query("from TaskInfoEntity where busId = ?1 and busKey = ?2 and state = 3")
  31. public List<TaskInfoEntity> findByBusIdAndBusKeyAndRecordStatus(String busId, String busKey);
  32. @Query(value = "select t.* from GK_OPERATION_JSJY_TASK t where t.bus_id = ?1 and t.bus_key = ?2 and t.step = (select max(to_number(step)) from GK_OPERATION_JSJY_TASK where bus_id = ?1 and bus_key = ?2)", nativeQuery = true)
  33. public TaskInfoEntity findByStep(String busId, String busKey);
  34. @Query("from TaskInfoEntity where busId = ?1 and taskKey = ?2 and sfth is null")
  35. public List<TaskInfoEntity> findByBusIdAndTaskKey(String busId, String taskKey);
  36. @Query("from TaskInfoEntity where busId = ?1 and taskKey = ?2 and sfth = ?3")
  37. public List<TaskInfoEntity> findByBusIdAndTaskKeyAndSfth(String busId, String taskKey, String sfth);
  38. }