package com.ruoyi.platform.mapper;

import com.ruoyi.platform.domain.Service;
import com.ruoyi.platform.domain.ServiceVersion;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;

import java.util.List;

public interface ServiceDao {

    long countService(@Param("service") com.ruoyi.platform.domain.Service service);

    long countServiceVersion(@Param("serviceVersion") ServiceVersion serviceVersion);

    List<Service> queryByPageService(@Param("service") com.ruoyi.platform.domain.Service service, @Param("pageable") Pageable pageable);

    List<ServiceVersion> queryByPageServiceVersion(@Param("serviceVersion") ServiceVersion serviceVersion, @Param("pageable") Pageable pageable);

    int insertService(@Param("service") com.ruoyi.platform.domain.Service service);

    int insertServiceVersion(@Param("serviceVersion") ServiceVersion serviceVersion);

    int updateService(@Param("service") Service service);

    int updateServiceVersion(@Param("serviceVersion") ServiceVersion serviceVersion);

    int updateRunState(@Param("deploymentName") String deploymentName, @Param("runState") String runState);

    Service getServiceById(@Param("id") Long id);

    ServiceVersion getServiceVersionById(@Param("id") Long id);

    List<ServiceVersion> getServiceVersionList(@Param("serviceId") Long serviceId);

    Service getServiceByName(@Param("serviceName") String serviceName);

    ServiceVersion getSvByVersion(@Param("version") String version, @Param("serviceId") Long serviceId);

    List<ServiceVersion> getRunning();

    List<String> queryByModelId(@Param("modelId") String modelId);

    List<String> queryByImageId(@Param("imageId") String imageId);

    List<String> queryByCodeConfig(@Param("codeConfig") String codeConfig);
}
