TaskRepo
Functions
Link copied to clipboard
@Query(value = "select count(*) from TaskEntity t where t.parentTask.id = :taskId")
Link copied to clipboard
@Query(value = "select count(*) from TaskEntity t where t.parentTask.id = :taskId and t.id != :exceptTaskId and t.runningStatus < 40")
Link copied to clipboard
@Query(value = "
select count(*)
from task t
join task_type tt on tt.id = t.type_id
where
t.pipeline_task_id = :pipelineTaskId and
tt.category = 10 and
t.running_status < 50
", nativeQuery = true)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Query(value = "select o from TaskEntity o where o.executor.id = :execId")
Link copied to clipboard
@Query(value = "select t from TaskEntity t where t.hid = :hid and t.ownerTenantId = :tenantId")
Link copied to clipboard
Link copied to clipboard
@Lock(value = LockModeType.PESSIMISTIC_WRITE)
@Query(value = "select t from TaskEntity t where t.id = :taskId")
Link copied to clipboard
@Query(value = "select t from TaskEntity t where t.type = :type and t.ownerTenantId = :tenantId")
Link copied to clipboard
@Query(value = "
select
t.id
from task t
join task_type tt on tt.id = t.type_id
where
t.is_cancelled = true and
t.running_status < 50 and
t.update_time <= :cancelledBefore and
tt.category = 10
order by
t.id
limit :limit
for update of t skip locked
", nativeQuery = true)
Link copied to clipboard
@Query(value = "
select t
from TaskEntity t
where
t.pipelineTask.id = :pipelineTaskId and
t.runningStatus = 50
")
@Query(value = "
select t
from TaskEntity t
where
t.pipelineTask.id = :pipelineTaskId and
t.runningStatus = 50 and
t.type.hid in :taskTypeHids
")
Link copied to clipboard
Link copied to clipboard
@Query(value = "
select
pipeline.id
from task pipeline
join task_type pipeline_type on pipeline_type.id = pipeline.type_id
where
pipeline_type.category = 20 and
pipeline.running_status < 50 and
pipeline.finishing_state is not null and
not exists (
select 1
from task child
join task_type child_type on child_type.id = child.type_id
where
child.pipeline_task_id = pipeline.id and
child_type.category = 10 and
child.running_status < 50
)
order by
pipeline.id
for update of pipeline skip locked
", nativeQuery = true)
Link copied to clipboard
@Query(value = "
select
candidate.id
from task_executor_type tet
join task_executor_type_to_task_type tcon on tcon.task_executor_type_id = tet.id
join task_type tt on tt.id = tcon.task_type_id
join lateral (
select
t.id
from task t
where
t.type_id = tt.id and
t.running_status = 20 and
t.is_cancelled = false and
(
not tt.ordered or
(
t.order_key is not null and
not exists (
select 1
from task older
where
older.type_id = t.type_id and
older.order_key = t.order_key and
older.running_status = 20 and
older.is_cancelled = false and
older.id < t.id
) and
not exists (
select 1
from task running
where
running.type_id = t.type_id and
running.order_key = t.order_key and
running.running_status = 30
)
)
)
order by
t.id
limit 1
for update of t skip locked
) candidate on true
where
tet.hid = :executorTypeHid
order by
candidate.id
limit 1
", nativeQuery = true)
Link copied to clipboard
Link copied to clipboard
@Query(value = "select t from TaskEntity t where t.parentTask.id = :parentTaskId")
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Query(value = "select t from TaskEntity t where t.id = :taskId and t.ownerTenantId = :tenantId")
Link copied to clipboard
Link copied to clipboard