<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.yifu.cloud.plus.v1.job.mapper.SysScheduleJobMapper">

    <resultMap id="sysScheduleJobMap" type="com.yifu.cloud.plus.v1.job.entity.SysScheduleJob">
        <id property="id" column="ID"/>
        <result property="jobId" column="JOB_ID"/>
        <result property="beanName" column="BEAN_NAME"/>
        <result property="methodName" column="METHOD_NAME"/>
        <result property="params" column="PARAMS"/>
        <result property="status" column="STATUS"/>
        <result property="cronExpression" column="CRON_EXPRESSION"/>
        <result property="remark" column="REMARK"/>
        <result property="createtime" column="CREATETIME"/>
    </resultMap>

    <!--sysScheduleJob简单分页查询-->
    <select id="getSysScheduleJobPage" resultMap="sysScheduleJobMap">
        SELECT
        ID,
        JOB_ID,
        BEAN_NAME,
        METHOD_NAME,
        PARAMS,
        STATUS,
        CRON_EXPRESSION,
        REMARK,
        CREATETIME
        FROM sys_schedule_job
        <where>1=1
            <if test="sysScheduleJob.id != null and sysScheduleJob.id.trim() != ''">
                AND ID = #{sysScheduleJob.id}
            </if>
            <if test="sysScheduleJob.jobId != null and sysScheduleJob.jobId.trim() != ''">
                AND JOB_ID = #{sysScheduleJob.jobId}
            </if>
            <if test="sysScheduleJob.beanName != null and sysScheduleJob.beanName.trim() != ''">
                AND BEAN_NAME = #{sysScheduleJob.beanName}
            </if>
            <if test="sysScheduleJob.methodName != null and sysScheduleJob.methodName.trim() != ''">
                AND METHOD_NAME = #{sysScheduleJob.methodName}
            </if>
            <if test="sysScheduleJob.params != null and sysScheduleJob.params.trim() != ''">
                AND PARAMS = #{sysScheduleJob.params}
            </if>
            <if test="sysScheduleJob.status != null and sysScheduleJob.status.trim() != ''">
                AND STATUS = #{sysScheduleJob.status}
            </if>
            <if test="sysScheduleJob.cronExpression != null and sysScheduleJob.cronExpression.trim() != ''">
                AND CRON_EXPRESSION = #{sysScheduleJob.cronExpression}
            </if>
            <if test="sysScheduleJob.remark != null and sysScheduleJob.remark.trim() != ''">
                AND REMARK = #{sysScheduleJob.remark}
            </if>
            <if test="sysScheduleJob.createtime != null and sysScheduleJob.createtime.trim() != ''">
                AND CREATETIME = #{sysScheduleJob.createtime}
            </if>
        </where>
    </select>


</mapper>
