/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.modules.quartz.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.quartz.entity.Job;
import org.springblade.modules.quartz.vo.JobVO;

import java.util.List;

/**
 * 定时任务调度表 Mapper 接口
 *
 * @author BladeX
 * @since 2023-02-17
 */
public interface JobMapper extends BaseMapper<Job> {

	/**
	 * 自定义分页
	 *
	 * @param page
	 * @param job
	 * @return
	 */
	List<JobVO> selectJobPage(IPage page, JobVO job);

	/**
	 * 查询调度任务日志集合
	 *
	 * @param job 调度信息
	 * @return 操作日志集合
	 */
	List<Job> selectJobList(Job job);

	/**
	 * 查询所有调度任务
	 *
	 * @return 调度任务列表
	 */
	List<Job> selectJobAll();

	/**
	 * 通过调度ID查询调度任务信息
	 *
	 * @param jobId 调度ID
	 * @return 角色对象信息
	 */
	Job selectJobById(Long jobId);

	/**
	 * 通过调度ID删除调度任务信息
	 *
	 * @param jobId 调度ID
	 * @return 结果
	 */
	int deleteJobById(Long jobId);

	/**
	 * 批量删除调度任务信息
	 *
	 * @param ids 需要删除的数据ID
	 * @return 结果
	 */
	int deleteJobByIds(Long[] ids);

	/**
	 * 修改调度任务信息
	 *
	 * @param job 调度任务信息
	 * @return 结果
	 */
	int updateJob(Job job);

	/**
	 * 新增调度任务信息
	 *
	 * @param job 调度任务信息
	 * @return 结果
	 */
	int insertJob(Job job);
}
