<?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.project.mapper.ProjectExtendMapper">
  <resultMap id="BaseResultMap" type="io.metersphere.project.domain.ProjectExtend">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="tapd_id" jdbcType="VARCHAR" property="tapdId" />
    <result column="jira_key" jdbcType="VARCHAR" property="jiraKey" />
    <result column="zentao_id" jdbcType="VARCHAR" property="zentaoId" />
    <result column="azure_devops_id" jdbcType="VARCHAR" property="azureDevopsId" />
    <result column="case_template_id" jdbcType="VARCHAR" property="caseTemplateId" />
    <result column="azure_filter_id" jdbcType="VARCHAR" property="azureFilterId" />
    <result column="platform" jdbcType="VARCHAR" property="platform" />
    <result column="third_part_template" jdbcType="BIT" property="thirdPartTemplate" />
    <result column="version_enable" jdbcType="BIT" property="versionEnable" />
    <result column="issue_config" jdbcType="VARCHAR" property="issueConfig" />
    <result column="api_template_id" jdbcType="VARCHAR" property="apiTemplateId" />
  </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, tapd_id, jira_key, zentao_id, azure_devops_id, case_template_id, azure_filter_id, 
    platform, third_part_template, version_enable, issue_config, api_template_id
  </sql>
  <select id="selectByExample" parameterType="io.metersphere.project.domain.ProjectExtendExample" resultMap="BaseResultMap">
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from project_extend
    <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 project_extend
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    delete from project_extend
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="io.metersphere.project.domain.ProjectExtendExample">
    delete from project_extend
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="io.metersphere.project.domain.ProjectExtend">
    insert into project_extend (id, tapd_id, jira_key, 
      zentao_id, azure_devops_id, case_template_id, 
      azure_filter_id, platform, third_part_template, 
      version_enable, issue_config, api_template_id
      )
    values (#{id,jdbcType=VARCHAR}, #{tapdId,jdbcType=VARCHAR}, #{jiraKey,jdbcType=VARCHAR}, 
      #{zentaoId,jdbcType=VARCHAR}, #{azureDevopsId,jdbcType=VARCHAR}, #{caseTemplateId,jdbcType=VARCHAR}, 
      #{azureFilterId,jdbcType=VARCHAR}, #{platform,jdbcType=VARCHAR}, #{thirdPartTemplate,jdbcType=BIT}, 
      #{versionEnable,jdbcType=BIT}, #{issueConfig,jdbcType=VARCHAR}, #{apiTemplateId,jdbcType=VARCHAR}
      )
  </insert>
  <insert id="insertSelective" parameterType="io.metersphere.project.domain.ProjectExtend">
    insert into project_extend
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="tapdId != null">
        tapd_id,
      </if>
      <if test="jiraKey != null">
        jira_key,
      </if>
      <if test="zentaoId != null">
        zentao_id,
      </if>
      <if test="azureDevopsId != null">
        azure_devops_id,
      </if>
      <if test="caseTemplateId != null">
        case_template_id,
      </if>
      <if test="azureFilterId != null">
        azure_filter_id,
      </if>
      <if test="platform != null">
        platform,
      </if>
      <if test="thirdPartTemplate != null">
        third_part_template,
      </if>
      <if test="versionEnable != null">
        version_enable,
      </if>
      <if test="issueConfig != null">
        issue_config,
      </if>
      <if test="apiTemplateId != null">
        api_template_id,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="tapdId != null">
        #{tapdId,jdbcType=VARCHAR},
      </if>
      <if test="jiraKey != null">
        #{jiraKey,jdbcType=VARCHAR},
      </if>
      <if test="zentaoId != null">
        #{zentaoId,jdbcType=VARCHAR},
      </if>
      <if test="azureDevopsId != null">
        #{azureDevopsId,jdbcType=VARCHAR},
      </if>
      <if test="caseTemplateId != null">
        #{caseTemplateId,jdbcType=VARCHAR},
      </if>
      <if test="azureFilterId != null">
        #{azureFilterId,jdbcType=VARCHAR},
      </if>
      <if test="platform != null">
        #{platform,jdbcType=VARCHAR},
      </if>
      <if test="thirdPartTemplate != null">
        #{thirdPartTemplate,jdbcType=BIT},
      </if>
      <if test="versionEnable != null">
        #{versionEnable,jdbcType=BIT},
      </if>
      <if test="issueConfig != null">
        #{issueConfig,jdbcType=VARCHAR},
      </if>
      <if test="apiTemplateId != null">
        #{apiTemplateId,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="io.metersphere.project.domain.ProjectExtendExample" resultType="java.lang.Long">
    select count(*) from project_extend
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    update project_extend
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.tapdId != null">
        tapd_id = #{record.tapdId,jdbcType=VARCHAR},
      </if>
      <if test="record.jiraKey != null">
        jira_key = #{record.jiraKey,jdbcType=VARCHAR},
      </if>
      <if test="record.zentaoId != null">
        zentao_id = #{record.zentaoId,jdbcType=VARCHAR},
      </if>
      <if test="record.azureDevopsId != null">
        azure_devops_id = #{record.azureDevopsId,jdbcType=VARCHAR},
      </if>
      <if test="record.caseTemplateId != null">
        case_template_id = #{record.caseTemplateId,jdbcType=VARCHAR},
      </if>
      <if test="record.azureFilterId != null">
        azure_filter_id = #{record.azureFilterId,jdbcType=VARCHAR},
      </if>
      <if test="record.platform != null">
        platform = #{record.platform,jdbcType=VARCHAR},
      </if>
      <if test="record.thirdPartTemplate != null">
        third_part_template = #{record.thirdPartTemplate,jdbcType=BIT},
      </if>
      <if test="record.versionEnable != null">
        version_enable = #{record.versionEnable,jdbcType=BIT},
      </if>
      <if test="record.issueConfig != null">
        issue_config = #{record.issueConfig,jdbcType=VARCHAR},
      </if>
      <if test="record.apiTemplateId != null">
        api_template_id = #{record.apiTemplateId,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    update project_extend
    set id = #{record.id,jdbcType=VARCHAR},
      tapd_id = #{record.tapdId,jdbcType=VARCHAR},
      jira_key = #{record.jiraKey,jdbcType=VARCHAR},
      zentao_id = #{record.zentaoId,jdbcType=VARCHAR},
      azure_devops_id = #{record.azureDevopsId,jdbcType=VARCHAR},
      case_template_id = #{record.caseTemplateId,jdbcType=VARCHAR},
      azure_filter_id = #{record.azureFilterId,jdbcType=VARCHAR},
      platform = #{record.platform,jdbcType=VARCHAR},
      third_part_template = #{record.thirdPartTemplate,jdbcType=BIT},
      version_enable = #{record.versionEnable,jdbcType=BIT},
      issue_config = #{record.issueConfig,jdbcType=VARCHAR},
      api_template_id = #{record.apiTemplateId,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="io.metersphere.project.domain.ProjectExtend">
    update project_extend
    <set>
      <if test="tapdId != null">
        tapd_id = #{tapdId,jdbcType=VARCHAR},
      </if>
      <if test="jiraKey != null">
        jira_key = #{jiraKey,jdbcType=VARCHAR},
      </if>
      <if test="zentaoId != null">
        zentao_id = #{zentaoId,jdbcType=VARCHAR},
      </if>
      <if test="azureDevopsId != null">
        azure_devops_id = #{azureDevopsId,jdbcType=VARCHAR},
      </if>
      <if test="caseTemplateId != null">
        case_template_id = #{caseTemplateId,jdbcType=VARCHAR},
      </if>
      <if test="azureFilterId != null">
        azure_filter_id = #{azureFilterId,jdbcType=VARCHAR},
      </if>
      <if test="platform != null">
        platform = #{platform,jdbcType=VARCHAR},
      </if>
      <if test="thirdPartTemplate != null">
        third_part_template = #{thirdPartTemplate,jdbcType=BIT},
      </if>
      <if test="versionEnable != null">
        version_enable = #{versionEnable,jdbcType=BIT},
      </if>
      <if test="issueConfig != null">
        issue_config = #{issueConfig,jdbcType=VARCHAR},
      </if>
      <if test="apiTemplateId != null">
        api_template_id = #{apiTemplateId,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="io.metersphere.project.domain.ProjectExtend">
    update project_extend
    set tapd_id = #{tapdId,jdbcType=VARCHAR},
      jira_key = #{jiraKey,jdbcType=VARCHAR},
      zentao_id = #{zentaoId,jdbcType=VARCHAR},
      azure_devops_id = #{azureDevopsId,jdbcType=VARCHAR},
      case_template_id = #{caseTemplateId,jdbcType=VARCHAR},
      azure_filter_id = #{azureFilterId,jdbcType=VARCHAR},
      platform = #{platform,jdbcType=VARCHAR},
      third_part_template = #{thirdPartTemplate,jdbcType=BIT},
      version_enable = #{versionEnable,jdbcType=BIT},
      issue_config = #{issueConfig,jdbcType=VARCHAR},
      api_template_id = #{apiTemplateId,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
</mapper>