<?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.metersphere.system.mapper.TestResourcePoolMapper">
  <resultMap id="BaseResultMap" type="io.metersphere.system.domain.TestResourcePool">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="type" jdbcType="VARCHAR" property="type" />
    <result column="description" jdbcType="VARCHAR" property="description" />
    <result column="enable" jdbcType="BIT" property="enable" />
    <result column="create_time" jdbcType="BIGINT" property="createTime" />
    <result column="update_time" jdbcType="BIGINT" property="updateTime" />
    <result column="load_test_image" jdbcType="VARCHAR" property="loadTestImage" />
    <result column="load_test_heap" jdbcType="VARCHAR" property="loadTestHeap" />
    <result column="create_user" jdbcType="VARCHAR" property="createUser" />
    <result column="api_test" jdbcType="BIT" property="apiTest" />
    <result column="load_test" jdbcType="BIT" property="loadTest" />
    <result column="ui_test" jdbcType="BIT" property="uiTest" />
    <result column="grid" jdbcType="VARCHAR" property="grid" />
    <result column="server_url" jdbcType="VARCHAR" property="serverUrl" />
    <result column="deleted" jdbcType="BIT" property="deleted" />
  </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, `name`, `type`, description, `enable`, create_time, update_time, load_test_image, 
    load_test_heap, create_user, api_test, load_test, ui_test, grid, server_url, deleted
  </sql>
  <select id="selectByExample" parameterType="io.metersphere.system.domain.TestResourcePoolExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from test_resource_pool
    <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="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from test_resource_pool
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from test_resource_pool
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="io.metersphere.system.domain.TestResourcePoolExample">
    delete from test_resource_pool
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="io.metersphere.system.domain.TestResourcePool">
    insert into test_resource_pool (id, `name`, `type`, 
      description, `enable`, create_time, 
      update_time, load_test_image, load_test_heap, 
      create_user, api_test, load_test, 
      ui_test, grid, server_url, 
      deleted)
    values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, 
      #{description,jdbcType=VARCHAR}, #{enable,jdbcType=BIT}, #{createTime,jdbcType=BIGINT}, 
      #{updateTime,jdbcType=BIGINT}, #{loadTestImage,jdbcType=VARCHAR}, #{loadTestHeap,jdbcType=VARCHAR}, 
      #{createUser,jdbcType=VARCHAR}, #{apiTest,jdbcType=BIT}, #{loadTest,jdbcType=BIT}, 
      #{uiTest,jdbcType=BIT}, #{grid,jdbcType=VARCHAR}, #{serverUrl,jdbcType=VARCHAR}, 
      #{deleted,jdbcType=BIT})
  </insert>
  <insert id="insertSelective" parameterType="io.metersphere.system.domain.TestResourcePool">
    insert into test_resource_pool
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="name != null">
        `name`,
      </if>
      <if test="type != null">
        `type`,
      </if>
      <if test="description != null">
        description,
      </if>
      <if test="enable != null">
        `enable`,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="loadTestImage != null">
        load_test_image,
      </if>
      <if test="loadTestHeap != null">
        load_test_heap,
      </if>
      <if test="createUser != null">
        create_user,
      </if>
      <if test="apiTest != null">
        api_test,
      </if>
      <if test="loadTest != null">
        load_test,
      </if>
      <if test="uiTest != null">
        ui_test,
      </if>
      <if test="grid != null">
        grid,
      </if>
      <if test="serverUrl != null">
        server_url,
      </if>
      <if test="deleted != null">
        deleted,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        #{type,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        #{description,jdbcType=VARCHAR},
      </if>
      <if test="enable != null">
        #{enable,jdbcType=BIT},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=BIGINT},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=BIGINT},
      </if>
      <if test="loadTestImage != null">
        #{loadTestImage,jdbcType=VARCHAR},
      </if>
      <if test="loadTestHeap != null">
        #{loadTestHeap,jdbcType=VARCHAR},
      </if>
      <if test="createUser != null">
        #{createUser,jdbcType=VARCHAR},
      </if>
      <if test="apiTest != null">
        #{apiTest,jdbcType=BIT},
      </if>
      <if test="loadTest != null">
        #{loadTest,jdbcType=BIT},
      </if>
      <if test="uiTest != null">
        #{uiTest,jdbcType=BIT},
      </if>
      <if test="grid != null">
        #{grid,jdbcType=VARCHAR},
      </if>
      <if test="serverUrl != null">
        #{serverUrl,jdbcType=VARCHAR},
      </if>
      <if test="deleted != null">
        #{deleted,jdbcType=BIT},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="io.metersphere.system.domain.TestResourcePoolExample" resultType="java.lang.Long">
    select count(*) from test_resource_pool
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update test_resource_pool
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.name != null">
        `name` = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.type != null">
        `type` = #{record.type,jdbcType=VARCHAR},
      </if>
      <if test="record.description != null">
        description = #{record.description,jdbcType=VARCHAR},
      </if>
      <if test="record.enable != null">
        `enable` = #{record.enable,jdbcType=BIT},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=BIGINT},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=BIGINT},
      </if>
      <if test="record.loadTestImage != null">
        load_test_image = #{record.loadTestImage,jdbcType=VARCHAR},
      </if>
      <if test="record.loadTestHeap != null">
        load_test_heap = #{record.loadTestHeap,jdbcType=VARCHAR},
      </if>
      <if test="record.createUser != null">
        create_user = #{record.createUser,jdbcType=VARCHAR},
      </if>
      <if test="record.apiTest != null">
        api_test = #{record.apiTest,jdbcType=BIT},
      </if>
      <if test="record.loadTest != null">
        load_test = #{record.loadTest,jdbcType=BIT},
      </if>
      <if test="record.uiTest != null">
        ui_test = #{record.uiTest,jdbcType=BIT},
      </if>
      <if test="record.grid != null">
        grid = #{record.grid,jdbcType=VARCHAR},
      </if>
      <if test="record.serverUrl != null">
        server_url = #{record.serverUrl,jdbcType=VARCHAR},
      </if>
      <if test="record.deleted != null">
        deleted = #{record.deleted,jdbcType=BIT},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update test_resource_pool
    set id = #{record.id,jdbcType=VARCHAR},
      `name` = #{record.name,jdbcType=VARCHAR},
      `type` = #{record.type,jdbcType=VARCHAR},
      description = #{record.description,jdbcType=VARCHAR},
      `enable` = #{record.enable,jdbcType=BIT},
      create_time = #{record.createTime,jdbcType=BIGINT},
      update_time = #{record.updateTime,jdbcType=BIGINT},
      load_test_image = #{record.loadTestImage,jdbcType=VARCHAR},
      load_test_heap = #{record.loadTestHeap,jdbcType=VARCHAR},
      create_user = #{record.createUser,jdbcType=VARCHAR},
      api_test = #{record.apiTest,jdbcType=BIT},
      load_test = #{record.loadTest,jdbcType=BIT},
      ui_test = #{record.uiTest,jdbcType=BIT},
      grid = #{record.grid,jdbcType=VARCHAR},
      server_url = #{record.serverUrl,jdbcType=VARCHAR},
      deleted = #{record.deleted,jdbcType=BIT}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="io.metersphere.system.domain.TestResourcePool">
    update test_resource_pool
    <set>
      <if test="name != null">
        `name` = #{name,jdbcType=VARCHAR},
      </if>
      <if test="type != null">
        `type` = #{type,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        description = #{description,jdbcType=VARCHAR},
      </if>
      <if test="enable != null">
        `enable` = #{enable,jdbcType=BIT},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=BIGINT},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=BIGINT},
      </if>
      <if test="loadTestImage != null">
        load_test_image = #{loadTestImage,jdbcType=VARCHAR},
      </if>
      <if test="loadTestHeap != null">
        load_test_heap = #{loadTestHeap,jdbcType=VARCHAR},
      </if>
      <if test="createUser != null">
        create_user = #{createUser,jdbcType=VARCHAR},
      </if>
      <if test="apiTest != null">
        api_test = #{apiTest,jdbcType=BIT},
      </if>
      <if test="loadTest != null">
        load_test = #{loadTest,jdbcType=BIT},
      </if>
      <if test="uiTest != null">
        ui_test = #{uiTest,jdbcType=BIT},
      </if>
      <if test="grid != null">
        grid = #{grid,jdbcType=VARCHAR},
      </if>
      <if test="serverUrl != null">
        server_url = #{serverUrl,jdbcType=VARCHAR},
      </if>
      <if test="deleted != null">
        deleted = #{deleted,jdbcType=BIT},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="io.metersphere.system.domain.TestResourcePool">
    update test_resource_pool
    set `name` = #{name,jdbcType=VARCHAR},
      `type` = #{type,jdbcType=VARCHAR},
      description = #{description,jdbcType=VARCHAR},
      `enable` = #{enable,jdbcType=BIT},
      create_time = #{createTime,jdbcType=BIGINT},
      update_time = #{updateTime,jdbcType=BIGINT},
      load_test_image = #{loadTestImage,jdbcType=VARCHAR},
      load_test_heap = #{loadTestHeap,jdbcType=VARCHAR},
      create_user = #{createUser,jdbcType=VARCHAR},
      api_test = #{apiTest,jdbcType=BIT},
      load_test = #{loadTest,jdbcType=BIT},
      ui_test = #{uiTest,jdbcType=BIT},
      grid = #{grid,jdbcType=VARCHAR},
      server_url = #{serverUrl,jdbcType=VARCHAR},
      deleted = #{deleted,jdbcType=BIT}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>