<?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="io.dataease.base.mapper.MessageTaskMapper">
  <resultMap id="BaseResultMap" type="io.dataease.base.domain.MessageTask">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="type" jdbcType="VARCHAR" property="type" />
    <result column="event" jdbcType="VARCHAR" property="event" />
    <result column="user_id" jdbcType="VARCHAR" property="userId" />
    <result column="task_type" jdbcType="VARCHAR" property="taskType" />
    <result column="webhook" jdbcType="VARCHAR" property="webhook" />
    <result column="identification" jdbcType="VARCHAR" property="identification" />
    <result column="is_set" jdbcType="BIT" property="isSet" />
    <result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
    <result column="test_id" jdbcType="VARCHAR" property="testId" />
    <result column="create_time" jdbcType="BIGINT" property="createTime" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.base.domain.MessageTask">
    <result column="template" jdbcType="LONGVARCHAR" property="template" />
  </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, `type`, event, user_id, task_type, webhook, identification, is_set, organization_id,
    test_id, create_time
  </sql>
  <sql id="Blob_Column_List">
    `template`
  </sql>
  <select id="selectByExampleWithBLOBs" parameterType="io.dataease.base.domain.MessageTaskExample" resultMap="ResultMapWithBLOBs">
    SELECT
    <if test="distinct">
      DISTINCT
    </if>
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    FROM message_task
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      ORDER BY ${orderByClause}
    </if>
  </select>
  <select id="selectByExample" parameterType="io.dataease.base.domain.MessageTaskExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from message_task
    <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.String" resultMap="ResultMapWithBLOBs">
    select
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from message_task
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from message_task
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="io.dataease.base.domain.MessageTaskExample">
    delete from message_task
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="io.dataease.base.domain.MessageTask">
    INSERT INTO message_task (id, `type`, event,
      user_id, task_type, webhook,
      identification, is_set, organization_id,
      test_id, create_time, `template`
      )
    VALUES (#{id,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{event,jdbcType=VARCHAR},
      #{userId,jdbcType=VARCHAR}, #{taskType,jdbcType=VARCHAR}, #{webhook,jdbcType=VARCHAR},
      #{identification,jdbcType=VARCHAR}, #{isSet,jdbcType=BIT}, #{organizationId,jdbcType=VARCHAR},
      #{testId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{template,jdbcType=LONGVARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="io.dataease.base.domain.MessageTask">
    insert into message_task
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="type != null">
        `type`,
      </if>
      <if test="event != null">
        event,
      </if>
      <if test="userId != null">
        user_id,
      </if>
      <if test="taskType != null">
        task_type,
      </if>
      <if test="webhook != null">
        webhook,
      </if>
      <if test="identification != null">
        identification,
      </if>
      <if test="isSet != null">
        is_set,
      </if>
      <if test="organizationId != null">
        organization_id,
      </if>
      <if test="testId != null">
        test_id,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="template != null">
        `template`,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="event != null">
        #{event,jdbcType=VARCHAR},
      </if>
      <if test="userId != null">
        #{userId,jdbcType=VARCHAR},
      </if>
      <if test="taskType != null">
        #{taskType,jdbcType=VARCHAR},
      </if>
      <if test="webhook != null">
        #{webhook,jdbcType=VARCHAR},
      </if>
      <if test="identification != null">
        #{identification,jdbcType=VARCHAR},
      </if>
      <if test="isSet != null">
        #{isSet,jdbcType=BIT},
      </if>
      <if test="organizationId != null">
        #{organizationId,jdbcType=VARCHAR},
      </if>
      <if test="testId != null">
        #{testId,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=BIGINT},
      </if>
      <if test="template != null">
        #{template,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="io.dataease.base.domain.MessageTaskExample" resultType="java.lang.Long">
    select count(*) from message_task
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update message_task
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.type != null">
        `type` = #{record.type,jdbcType=VARCHAR},
      </if>
      <if test="record.event != null">
        event = #{record.event,jdbcType=VARCHAR},
      </if>
      <if test="record.userId != null">
        user_id = #{record.userId,jdbcType=VARCHAR},
      </if>
      <if test="record.taskType != null">
        task_type = #{record.taskType,jdbcType=VARCHAR},
      </if>
      <if test="record.webhook != null">
        webhook = #{record.webhook,jdbcType=VARCHAR},
      </if>
      <if test="record.identification != null">
        identification = #{record.identification,jdbcType=VARCHAR},
      </if>
      <if test="record.isSet != null">
        is_set = #{record.isSet,jdbcType=BIT},
      </if>
      <if test="record.organizationId != null">
        organization_id = #{record.organizationId,jdbcType=VARCHAR},
      </if>
      <if test="record.testId != null">
        test_id = #{record.testId,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=BIGINT},
      </if>
      <if test="record.template != null">
        `template` = #{record.template,jdbcType=LONGVARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExampleWithBLOBs" parameterType="map">
    UPDATE message_task
    SET id = #{record.id,jdbcType=VARCHAR},
      `type` = #{record.type,jdbcType=VARCHAR},
      event = #{record.event,jdbcType=VARCHAR},
      user_id = #{record.userId,jdbcType=VARCHAR},
      task_type = #{record.taskType,jdbcType=VARCHAR},
      webhook = #{record.webhook,jdbcType=VARCHAR},
      identification = #{record.identification,jdbcType=VARCHAR},
      is_set = #{record.isSet,jdbcType=BIT},
      organization_id = #{record.organizationId,jdbcType=VARCHAR},
      test_id = #{record.testId,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=BIGINT},
      `template` = #{record.template,jdbcType=LONGVARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update message_task
    set id = #{record.id,jdbcType=VARCHAR},
      `type` = #{record.type,jdbcType=VARCHAR},
      event = #{record.event,jdbcType=VARCHAR},
      user_id = #{record.userId,jdbcType=VARCHAR},
      task_type = #{record.taskType,jdbcType=VARCHAR},
      webhook = #{record.webhook,jdbcType=VARCHAR},
      identification = #{record.identification,jdbcType=VARCHAR},
      is_set = #{record.isSet,jdbcType=BIT},
      organization_id = #{record.organizationId,jdbcType=VARCHAR},
      test_id = #{record.testId,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=BIGINT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.MessageTask">
    update message_task
    <set>
      <if test="type != null">
        `type` = #{type,jdbcType=VARCHAR},
      </if>
      <if test="event != null">
        event = #{event,jdbcType=VARCHAR},
      </if>
      <if test="userId != null">
        user_id = #{userId,jdbcType=VARCHAR},
      </if>
      <if test="taskType != null">
        task_type = #{taskType,jdbcType=VARCHAR},
      </if>
      <if test="webhook != null">
        webhook = #{webhook,jdbcType=VARCHAR},
      </if>
      <if test="identification != null">
        identification = #{identification,jdbcType=VARCHAR},
      </if>
      <if test="isSet != null">
        is_set = #{isSet,jdbcType=BIT},
      </if>
      <if test="organizationId != null">
        organization_id = #{organizationId,jdbcType=VARCHAR},
      </if>
      <if test="testId != null">
        test_id = #{testId,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=BIGINT},
      </if>
      <if test="template != null">
        `template` = #{template,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="io.dataease.base.domain.MessageTask">
    UPDATE message_task
    SET `type` = #{type,jdbcType=VARCHAR},
      event = #{event,jdbcType=VARCHAR},
      user_id = #{userId,jdbcType=VARCHAR},
      task_type = #{taskType,jdbcType=VARCHAR},
      webhook = #{webhook,jdbcType=VARCHAR},
      identification = #{identification,jdbcType=VARCHAR},
      is_set = #{isSet,jdbcType=BIT},
      organization_id = #{organizationId,jdbcType=VARCHAR},
      test_id = #{testId,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=BIGINT},
      `template` = #{template,jdbcType=LONGVARCHAR}
    WHERE id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.MessageTask">
    UPDATE message_task
    SET `type` = #{type,jdbcType=VARCHAR},
      event = #{event,jdbcType=VARCHAR},
      user_id = #{userId,jdbcType=VARCHAR},
      task_type = #{taskType,jdbcType=VARCHAR},
      webhook = #{webhook,jdbcType=VARCHAR},
      identification = #{identification,jdbcType=VARCHAR},
      is_set = #{isSet,jdbcType=BIT},
      organization_id = #{organizationId,jdbcType=VARCHAR},
      test_id = #{testId,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=BIGINT}
    WHERE id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>
