<?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="cn.superdesk.uniorder.dao.mapper.scheduler.SysQuartzLogMapper">
  <resultMap id="BaseResultMap" type="cn.superdesk.uniorder.dao.entity.scheduler.SysQuartzLog">

    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="baen_name" jdbcType="VARCHAR" property="baenName" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="cron_expression" jdbcType="VARCHAR" property="cronExpression" />
    <result column="is_success" jdbcType="TINYINT" property="isSuccess" />
    <result column="job_name" jdbcType="VARCHAR" property="jobName" />
    <result column="method_name" jdbcType="VARCHAR" property="methodName" />
    <result column="params" jdbcType="VARCHAR" property="params" />
    <result column="time" jdbcType="BIGINT" property="time" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="cn.superdesk.uniorder.dao.entity.scheduler.SysQuartzLog">

    <result column="exception_detail" jdbcType="LONGVARCHAR" property="exceptionDetail" />
  </resultMap>
  <sql id="Example_Where_Clause">

    <where>
      <foreach collection="oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Update_By_Example_Where_Clause">

    <where>
      <foreach collection="example.oredCriteria" item="criteria" separator="or">
        <if test="criteria.valid">
          <trim prefix="(" prefixOverrides="and" suffix=")">
            <foreach collection="criteria.criteria" item="criterion">
              <choose>
                <when test="criterion.noValue">
                  and ${criterion.condition}
                </when>
                <when test="criterion.singleValue">
                  and ${criterion.condition} #{criterion.value}
                </when>
                <when test="criterion.betweenValue">
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                </when>
                <when test="criterion.listValue">
                  and ${criterion.condition}
                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
                    #{listItem}
                  </foreach>
                </when>
              </choose>
            </foreach>
          </trim>
        </if>
      </foreach>
    </where>
  </sql>
  <sql id="Base_Column_List">

    id, baen_name, create_time, cron_expression, is_success, job_name, method_name, params, 
    time
  </sql>
  <sql id="Blob_Column_List">

    exception_detail
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="cn.superdesk.uniorder.dao.entity.scheduler.SysQuartzLogExample" resultMap="ResultMapWithBLOBs">

    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from sys_quartz_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="cn.superdesk.uniorder.dao.entity.scheduler.SysQuartzLogExample" resultMap="BaseResultMap">

    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from sys_quartz_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">

    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from sys_quartz_log
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">

    delete from sys_quartz_log
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="cn.superdesk.uniorder.dao.entity.scheduler.SysQuartzLogExample">

    delete from sys_quartz_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="cn.superdesk.uniorder.dao.entity.scheduler.SysQuartzLog">

    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into sys_quartz_log (baen_name, create_time, cron_expression, 
      is_success, job_name, method_name, 
      params, time, exception_detail
      )
    values (#{baenName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{cronExpression,jdbcType=VARCHAR}, 
      #{isSuccess,jdbcType=TINYINT}, #{jobName,jdbcType=VARCHAR}, #{methodName,jdbcType=VARCHAR}, 
      #{params,jdbcType=VARCHAR}, #{time,jdbcType=BIGINT}, #{exceptionDetail,jdbcType=LONGVARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="cn.superdesk.uniorder.dao.entity.scheduler.SysQuartzLog">

    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into sys_quartz_log
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="baenName != null">
        baen_name,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="cronExpression != null">
        cron_expression,
      </if>
      <if test="isSuccess != null">
        is_success,
      </if>
      <if test="jobName != null">
        job_name,
      </if>
      <if test="methodName != null">
        method_name,
      </if>
      <if test="params != null">
        params,
      </if>
      <if test="time != null">
        time,
      </if>
      <if test="exceptionDetail != null">
        exception_detail,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="baenName != null">
        #{baenName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="cronExpression != null">
        #{cronExpression,jdbcType=VARCHAR},
      </if>
      <if test="isSuccess != null">
        #{isSuccess,jdbcType=TINYINT},
      </if>
      <if test="jobName != null">
        #{jobName,jdbcType=VARCHAR},
      </if>
      <if test="methodName != null">
        #{methodName,jdbcType=VARCHAR},
      </if>
      <if test="params != null">
        #{params,jdbcType=VARCHAR},
      </if>
      <if test="time != null">
        #{time,jdbcType=BIGINT},
      </if>
      <if test="exceptionDetail != null">
        #{exceptionDetail,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="cn.superdesk.uniorder.dao.entity.scheduler.SysQuartzLogExample" resultType="java.lang.Long">

    select count(*) from sys_quartz_log
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">

    update sys_quartz_log
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.baenName != null">
        baen_name = #{record.baenName,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.cronExpression != null">
        cron_expression = #{record.cronExpression,jdbcType=VARCHAR},
      </if>
      <if test="record.isSuccess != null">
        is_success = #{record.isSuccess,jdbcType=TINYINT},
      </if>
      <if test="record.jobName != null">
        job_name = #{record.jobName,jdbcType=VARCHAR},
      </if>
      <if test="record.methodName != null">
        method_name = #{record.methodName,jdbcType=VARCHAR},
      </if>
      <if test="record.params != null">
        params = #{record.params,jdbcType=VARCHAR},
      </if>
      <if test="record.time != null">
        time = #{record.time,jdbcType=BIGINT},
      </if>
      <if test="record.exceptionDetail != null">
        exception_detail = #{record.exceptionDetail,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">

    update sys_quartz_log
    set id = #{record.id,jdbcType=BIGINT},
      baen_name = #{record.baenName,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      cron_expression = #{record.cronExpression,jdbcType=VARCHAR},
      is_success = #{record.isSuccess,jdbcType=TINYINT},
      job_name = #{record.jobName,jdbcType=VARCHAR},
      method_name = #{record.methodName,jdbcType=VARCHAR},
      params = #{record.params,jdbcType=VARCHAR},
      time = #{record.time,jdbcType=BIGINT},
      exception_detail = #{record.exceptionDetail,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">

    update sys_quartz_log
    set id = #{record.id,jdbcType=BIGINT},
      baen_name = #{record.baenName,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      cron_expression = #{record.cronExpression,jdbcType=VARCHAR},
      is_success = #{record.isSuccess,jdbcType=TINYINT},
      job_name = #{record.jobName,jdbcType=VARCHAR},
      method_name = #{record.methodName,jdbcType=VARCHAR},
      params = #{record.params,jdbcType=VARCHAR},
      time = #{record.time,jdbcType=BIGINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="cn.superdesk.uniorder.dao.entity.scheduler.SysQuartzLog">

    update sys_quartz_log
    <set>
      <if test="baenName != null">
        baen_name = #{baenName,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="cronExpression != null">
        cron_expression = #{cronExpression,jdbcType=VARCHAR},
      </if>
      <if test="isSuccess != null">
        is_success = #{isSuccess,jdbcType=TINYINT},
      </if>
      <if test="jobName != null">
        job_name = #{jobName,jdbcType=VARCHAR},
      </if>
      <if test="methodName != null">
        method_name = #{methodName,jdbcType=VARCHAR},
      </if>
      <if test="params != null">
        params = #{params,jdbcType=VARCHAR},
      </if>
      <if test="time != null">
        time = #{time,jdbcType=BIGINT},
      </if>
      <if test="exceptionDetail != null">
        exception_detail = #{exceptionDetail,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="cn.superdesk.uniorder.dao.entity.scheduler.SysQuartzLog">

    update sys_quartz_log
    set baen_name = #{baenName,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      cron_expression = #{cronExpression,jdbcType=VARCHAR},
      is_success = #{isSuccess,jdbcType=TINYINT},
      job_name = #{jobName,jdbcType=VARCHAR},
      method_name = #{methodName,jdbcType=VARCHAR},
      params = #{params,jdbcType=VARCHAR},
      time = #{time,jdbcType=BIGINT},
      exception_detail = #{exceptionDetail,jdbcType=LONGVARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="cn.superdesk.uniorder.dao.entity.scheduler.SysQuartzLog">

    update sys_quartz_log
    set baen_name = #{baenName,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      cron_expression = #{cronExpression,jdbcType=VARCHAR},
      is_success = #{isSuccess,jdbcType=TINYINT},
      job_name = #{jobName,jdbcType=VARCHAR},
      method_name = #{methodName,jdbcType=VARCHAR},
      params = #{params,jdbcType=VARCHAR},
      time = #{time,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>