package cn.reghao.bnt.web.devops.app.db.repository.config;

import cn.reghao.bnt.web.devops.app.model.po.config.AppConfig;
import cn.reghao.bnt.web.devops.app.model.po.config.AppDeployConfig;
import cn.reghao.bnt.web.devops.machine.model.po.MachineHost;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 *
 * @author reghao
 * @date 2020-01-21 14:53:03
 */
public interface AppDeployConfigRepository 
        extends JpaRepository<AppDeployConfig, Integer>, JpaSpecificationExecutor<AppDeployConfig> {
    void deleteById(int appDeployConfigId);
    void deleteByMachineHost(MachineHost machineHost);

    int countByAppConfig(AppConfig appConfig);
    int countByMachineHost(MachineHost machineHost);
    List<AppDeployConfig> findByMachineHost(MachineHost machineHost);
    List<AppDeployConfig> findByAppConfig(AppConfig appConfig);
    List<AppDeployConfig> findByAppConfig_AppId(String appId);
}
