package com.qqchen.deploy.backend.deploy.repository;

import com.qqchen.deploy.backend.deploy.entity.ExternalSystem;
import com.qqchen.deploy.backend.system.enums.ExternalSystemTypeEnum;
import com.qqchen.deploy.backend.framework.repository.IBaseRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface IExternalSystemRepository extends IBaseRepository<ExternalSystem, Long> {
    
    /**
     * 检查系统名称是否存在
     */
    boolean existsByNameAndDeletedFalse(String name);
    
    /**
     * 检查系统类型和URL组合是否存在
     */
    boolean existsByTypeAndUrlAndDeletedFalse(ExternalSystemTypeEnum type, String url);
    
    /**
     * 查询所有未删除的系统，按排序字段排序
     */
    List<ExternalSystem> findByDeletedFalseOrderBySort();
} 