package com.sky.ioc.mapper.job;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sky.ioc.entity.QuartzJob;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface QuartzJobMapper extends BaseMapper<QuartzJob> {

    @Select("<script>" +
            " select * from sys_quartz_job where del_flag = 0 " +
            "<if test='name!=null and name!=\"\"'>" +
            " and name like #{name} " +
            "</if>" +
            "<if test='groupType!=null'>" +
            " and group_type = #{groupType} " +
            "</if>" +
            "<if test='status!=null '>" +
            " and status = #{status} " +
            "</if>" +
            " order by id </script>")
    List<QuartzJob> pageList(@Param("name") String name, @Param("groupType") Integer group,
                             @Param("status")  Integer status);


}
