<?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.huatek.busi.mapper.ScheduleJobMapper">
      <resultMap id="BaseResultMap" type="com.huatek.busi.entity.ScheduleJob">
        <result column="id" property="id"/>
        <result column="bean_name" property="beanName"/>
        <result column="method_name" property="methodName"/>
        <result column="params" property="params"/>
         <result column="cron_expression" property="cronExpression"/>
        <result column="status" property="status"/>
        <result column="remark" property="remark"/>
        <result column="create_time" property="createTime"/>
    </resultMap>
    <resultMap id="BaseVoResultMap" type="com.huatek.busi.vo.ScheduleJobVo">
        <result column="id" property="id"/>
        <result column="bean_name" property="beanName"/>
        <result column="method_name" property="methodName"/>
        <result column="params" property="params"/>
         <result column="cron_expression" property="cronExpression"/>
        <result column="status" property="status"/>
        <result column="remark" property="remark"/>
        <result column="create_time" property="createTime"/>
    </resultMap>
    <sql id="Base_Column_List">
    	id, bean_name, method_name, params, cron_expression,status,remark,create_time
  	</sql>
    <select id="findAll" resultMap="BaseResultMap">
	    SELECT
		<include refid="Base_Column_List" />
		FROM
			schedule_job
		WHERE status <![CDATA[!= ]]> '1'
    </select>
    <select id="findScheduleJobPage" parameterType="com.huatek.busi.dto.ScheduleJobDto" resultMap="BaseVoResultMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM
        schedule_job j
        WHERE 1=1
        <if test="beanName != null and beanName != ''">
             and j.bean_name like concat('%', #{beanName}, '%')
        </if>
        order by j.bean_name asc
    </select>
</mapper>