package cn.reghao.devops.web.mgr.machine.db.repository;

import cn.reghao.devops.web.mgr.machine.model.po.MachineHost;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
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 MachineHostRepository
        extends JpaRepository<MachineHost, Integer>, JpaSpecificationExecutor<MachineHost> {
    void deleteByMachineId(String machineId);

    MachineHost findByMachineId(String machineId);
    MachineHost findByMachineIpv4(String machineIpv4);
    Page<MachineHost> findByEnv(String env, Pageable pageable);
    List<MachineHost> findByEnv(String env);
}
