package com.salpa.subject.mapper;

import com.salpa.subject.domain.MonitorProjectSyncRule;
import com.salpa.subject.domain.MonitorProjectSyncTask;
import com.salpa.subject.domain.vo.ProjectSyncRule;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Arrays;
import java.util.List;

/**
 * @author zhuff
 */
@Mapper
public interface ProjectSyncRuleMapper {

    void addProjectSyncRule(@Param("projectSyncRule") ProjectSyncRule monitorProjectSyncRule, @Param("tableName") String ignoreTableNameRegex, @Param("columnName") String ignoreColumnNameRegex);

    MonitorProjectSyncRule selectByProjectId(Integer id);

    void deletProjectSyncRule(Integer id);

    List<MonitorProjectSyncRule> selectByIsAutoSyncAndNotInProjectIds(@Param("autoSync") boolean autoSync, @Param("list") List<Integer> projectIds);

    boolean existsByProjectIdAndCron(@Param("projectId") int projectId, @Param("cron") String cron);

    List<MonitorProjectSyncRule> selectByIsAutoSyncAndProjectIds(@Param("autoSync") boolean autoSync, @Param("list") List<Integer> projectIds);
}
