package com.xt.jygl.workflow.dao; import java.util.List; import org.springframework.data.jpa.repository.Query; import com.xt.jygl.workflow.entity.TaskInfoEntity; import com.xtframe.sec.common.SecRepository; /** * 任务信息Dao * */ public interface TaskInfoDao extends SecRepository { public TaskInfoEntity getByTaskId(String taskId); /** * 根据业务主键和业务类型查询 * * @param busId * @param busKey * @return */ public List findByBusIdAndBusKey(String busId, String busKey); /** * 根据业务主键和业务类型查询 * * @param busId * @param busKey * @return */ public List findByBusIdAndBusKeyOrderByIdAsc(String busId, String busKey); public List findByBusKeyAndRunnerIdOrderByIdAsc(String busKey, String runnerId); public List findByRunnerIdAndStateOrderByIdAsc(String runnerId, String state); @Query("from TaskInfoEntity where busId = ?1 and busKey = ?2 and state = 3") public List findByBusIdAndBusKeyAndRecordStatus(String busId, String busKey); @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) public TaskInfoEntity findByStep(String busId, String busKey); @Query("from TaskInfoEntity where busId = ?1 and taskKey = ?2 and sfth is null") public List findByBusIdAndTaskKey(String busId, String taskKey); @Query("from TaskInfoEntity where busId = ?1 and taskKey = ?2 and sfth = ?3") public List findByBusIdAndTaskKeyAndSfth(String busId, String taskKey, String sfth); }