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

import cn.reghao.bnt.web.devops.app.model.po.log.BuildLog;
import cn.reghao.bnt.web.devops.app.model.po.log.DeployLog;
import cn.reghao.bnt.web.devops.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;

/**
 * @author reghao
 * @date 2020-01-21 14:53:03
 */
public interface DeployLogRepository extends JpaRepository<DeployLog, String>, JpaSpecificationExecutor<DeployLog> {
    void deleteByBuildLog_BuildLogId(String buildLogId);
    void deleteByMachineHost(MachineHost machineHost);
    void deleteByMachineHost_MachineId(String machineId);

    Page<DeployLog> findByBuildLogAndMachineHost(BuildLog buildLog, MachineHost machineHost, Pageable pageable);
}
