package com.crunii.micro.domain.repo.main;

import com.crunii.micro.domain.common.BaseRepo;
import com.crunii.micro.domain.entity.main.YcqFlowNode;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface YcqActiveFlowNodeRepo extends BaseRepo<YcqFlowNode, Long> {
    List<YcqFlowNode> findByBizId(Long bizId);

    @Query(value = "select  * from  YCQ_ACTIVE_FLOW_NODE where biz_id=?1 and is_restart=0",nativeQuery = true)
    List<YcqFlowNode> findByBizIdAndState(Long bizId);
    List<YcqFlowNode> findByBizIdOrderByCreateTimeDesc(Long bizId);
    List<YcqFlowNode> findByBizIdOrderByIsInitialAsc(Long bizId);
    List<YcqFlowNode> findByBizIdOrderByIsInitialAscCreateTimeAsc(Long bizId);
    List<YcqFlowNode> findByBizIdOrderByIsInitialDescCreateTimeDesc(Long bizId);
    List<YcqFlowNode> findByAuditTimesAndBizId(Integer auditTimes,Long bizId);
}
