<?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.TestPlanReportMapper">
  <resultMap id="BaseResultMap" type="io.dataease.base.domain.TestPlanReport">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="test_plan_id" jdbcType="VARCHAR" property="testPlanId" />
    <result column="create_time" jdbcType="BIGINT" property="createTime" />
    <result column="update_time" jdbcType="BIGINT" property="updateTime" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="status" jdbcType="VARCHAR" property="status" />
    <result column="trigger_mode" jdbcType="VARCHAR" property="triggerMode" />
    <result column="creator" jdbcType="VARCHAR" property="creator" />
    <result column="start_time" jdbcType="BIGINT" property="startTime" />
    <result column="end_time" jdbcType="BIGINT" property="endTime" />
    <result column="is_api_case_executing" jdbcType="TINYINT" property="isApiCaseExecuting" />
    <result column="is_scenario_executing" jdbcType="TINYINT" property="isScenarioExecuting" />
    <result column="is_performance_executing" jdbcType="TINYINT" property="isPerformanceExecuting" />
    <result column="principal" jdbcType="VARCHAR" property="principal" />
    <result column="components" jdbcType="VARCHAR" property="components" />
  </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, test_plan_id, create_time, update_time, `name`, `status`, trigger_mode, creator,
    start_time, end_time, is_api_case_executing, is_scenario_executing, is_performance_executing,
    principal, components
  </sql>
  <select id="selectByExample" parameterType="io.dataease.base.domain.TestPlanReportExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from test_plan_report
    <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_plan_report
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from test_plan_report
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="io.dataease.base.domain.TestPlanReportExample">
    delete from test_plan_report
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="io.dataease.base.domain.TestPlanReport">
    insert into test_plan_report (id, test_plan_id, create_time,
      update_time, `name`, `status`,
      trigger_mode, creator, start_time,
      end_time, is_api_case_executing, is_scenario_executing,
      is_performance_executing, principal, components
      )
    values (#{id,jdbcType=VARCHAR}, #{testPlanId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT},
      #{updateTime,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
      #{triggerMode,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR}, #{startTime,jdbcType=BIGINT},
      #{endTime,jdbcType=BIGINT}, #{isApiCaseExecuting,jdbcType=TINYINT}, #{isScenarioExecuting,jdbcType=TINYINT},
      #{isPerformanceExecuting,jdbcType=TINYINT}, #{principal,jdbcType=VARCHAR}, #{components,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="io.dataease.base.domain.TestPlanReport">
    insert into test_plan_report
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="testPlanId != null">
        test_plan_id,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="name != null">
        `name`,
      </if>
      <if test="status != null">
        `status`,
      </if>
      <if test="triggerMode != null">
        trigger_mode,
      </if>
      <if test="creator != null">
        creator,
      </if>
      <if test="startTime != null">
        start_time,
      </if>
      <if test="endTime != null">
        end_time,
      </if>
      <if test="isApiCaseExecuting != null">
        is_api_case_executing,
      </if>
      <if test="isScenarioExecuting != null">
        is_scenario_executing,
      </if>
      <if test="isPerformanceExecuting != null">
        is_performance_executing,
      </if>
      <if test="principal != null">
        principal,
      </if>
      <if test="components != null">
        components,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="testPlanId != null">
        #{testPlanId,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=BIGINT},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=BIGINT},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        #{status,jdbcType=VARCHAR},
      </if>
      <if test="triggerMode != null">
        #{triggerMode,jdbcType=VARCHAR},
      </if>
      <if test="creator != null">
        #{creator,jdbcType=VARCHAR},
      </if>
      <if test="startTime != null">
        #{startTime,jdbcType=BIGINT},
      </if>
      <if test="endTime != null">
        #{endTime,jdbcType=BIGINT},
      </if>
      <if test="isApiCaseExecuting != null">
        #{isApiCaseExecuting,jdbcType=TINYINT},
      </if>
      <if test="isScenarioExecuting != null">
        #{isScenarioExecuting,jdbcType=TINYINT},
      </if>
      <if test="isPerformanceExecuting != null">
        #{isPerformanceExecuting,jdbcType=TINYINT},
      </if>
      <if test="principal != null">
        #{principal,jdbcType=VARCHAR},
      </if>
      <if test="components != null">
        #{components,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="io.dataease.base.domain.TestPlanReportExample" resultType="java.lang.Long">
    select count(*) from test_plan_report
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update test_plan_report
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.testPlanId != null">
        test_plan_id = #{record.testPlanId,jdbcType=VARCHAR},
      </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.name != null">
        `name` = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.status != null">
        `status` = #{record.status,jdbcType=VARCHAR},
      </if>
      <if test="record.triggerMode != null">
        trigger_mode = #{record.triggerMode,jdbcType=VARCHAR},
      </if>
      <if test="record.creator != null">
        creator = #{record.creator,jdbcType=VARCHAR},
      </if>
      <if test="record.startTime != null">
        start_time = #{record.startTime,jdbcType=BIGINT},
      </if>
      <if test="record.endTime != null">
        end_time = #{record.endTime,jdbcType=BIGINT},
      </if>
      <if test="record.isApiCaseExecuting != null">
        is_api_case_executing = #{record.isApiCaseExecuting,jdbcType=TINYINT},
      </if>
      <if test="record.isScenarioExecuting != null">
        is_scenario_executing = #{record.isScenarioExecuting,jdbcType=TINYINT},
      </if>
      <if test="record.isPerformanceExecuting != null">
        is_performance_executing = #{record.isPerformanceExecuting,jdbcType=TINYINT},
      </if>
      <if test="record.principal != null">
        principal = #{record.principal,jdbcType=VARCHAR},
      </if>
      <if test="record.components != null">
        components = #{record.components,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update test_plan_report
    set id = #{record.id,jdbcType=VARCHAR},
      test_plan_id = #{record.testPlanId,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=BIGINT},
      update_time = #{record.updateTime,jdbcType=BIGINT},
      `name` = #{record.name,jdbcType=VARCHAR},
      `status` = #{record.status,jdbcType=VARCHAR},
      trigger_mode = #{record.triggerMode,jdbcType=VARCHAR},
      creator = #{record.creator,jdbcType=VARCHAR},
      start_time = #{record.startTime,jdbcType=BIGINT},
      end_time = #{record.endTime,jdbcType=BIGINT},
      is_api_case_executing = #{record.isApiCaseExecuting,jdbcType=TINYINT},
      is_scenario_executing = #{record.isScenarioExecuting,jdbcType=TINYINT},
      is_performance_executing = #{record.isPerformanceExecuting,jdbcType=TINYINT},
      principal = #{record.principal,jdbcType=VARCHAR},
      components = #{record.components,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.TestPlanReport">
    update test_plan_report
    <set>
      <if test="testPlanId != null">
        test_plan_id = #{testPlanId,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=BIGINT},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=BIGINT},
      </if>
      <if test="name != null">
        `name` = #{name,jdbcType=VARCHAR},
      </if>
      <if test="status != null">
        `status` = #{status,jdbcType=VARCHAR},
      </if>
      <if test="triggerMode != null">
        trigger_mode = #{triggerMode,jdbcType=VARCHAR},
      </if>
      <if test="creator != null">
        creator = #{creator,jdbcType=VARCHAR},
      </if>
      <if test="startTime != null">
        start_time = #{startTime,jdbcType=BIGINT},
      </if>
      <if test="endTime != null">
        end_time = #{endTime,jdbcType=BIGINT},
      </if>
      <if test="isApiCaseExecuting != null">
        is_api_case_executing = #{isApiCaseExecuting,jdbcType=TINYINT},
      </if>
      <if test="isScenarioExecuting != null">
        is_scenario_executing = #{isScenarioExecuting,jdbcType=TINYINT},
      </if>
      <if test="isPerformanceExecuting != null">
        is_performance_executing = #{isPerformanceExecuting,jdbcType=TINYINT},
      </if>
      <if test="principal != null">
        principal = #{principal,jdbcType=VARCHAR},
      </if>
      <if test="components != null">
        components = #{components,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.TestPlanReport">
    update test_plan_report
    set test_plan_id = #{testPlanId,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=BIGINT},
      update_time = #{updateTime,jdbcType=BIGINT},
      `name` = #{name,jdbcType=VARCHAR},
      `status` = #{status,jdbcType=VARCHAR},
      trigger_mode = #{triggerMode,jdbcType=VARCHAR},
      creator = #{creator,jdbcType=VARCHAR},
      start_time = #{startTime,jdbcType=BIGINT},
      end_time = #{endTime,jdbcType=BIGINT},
      is_api_case_executing = #{isApiCaseExecuting,jdbcType=TINYINT},
      is_scenario_executing = #{isScenarioExecuting,jdbcType=TINYINT},
      is_performance_executing = #{isPerformanceExecuting,jdbcType=TINYINT},
      principal = #{principal,jdbcType=VARCHAR},
      components = #{components,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>
