<?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="pwc.taxtech.atms.dao.KeyValueConfigMapper">
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.entity.KeyValueConfig">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="key_code" jdbcType="VARCHAR" property="keyCode" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="key_value_type" jdbcType="INTEGER" property="keyValueType" />
    <result column="formula" jdbcType="VARCHAR" property="formula" />
    <result column="is_constant" jdbcType="INTEGER" property="isConstant" />
    <result column="calculate_status" jdbcType="INTEGER" property="calculateStatus" />
    <result column="result_type" jdbcType="INTEGER" property="resultType" />
    <result column="service_type_ids" jdbcType="VARCHAR" property="serviceTypeIds" />
    <result column="industry_ids" jdbcType="VARCHAR" property="industryIds" />
    <result column="description" jdbcType="VARCHAR" property="description" />
    <result column="creator" jdbcType="VARCHAR" property="creator" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="updator" jdbcType="VARCHAR" property="updator" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="data_source" jdbcType="VARCHAR" property="dataSource" />
  </resultMap>
  <sql id="Example_Where_Clause">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <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">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <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">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    id, key_code, name, key_value_type, formula, is_constant, calculate_status, result_type, 
    service_type_ids, industry_ids, description, creator, create_time, updator, update_time, 
    data_source
  </sql>
  <select id="selectByExample" parameterType="pwc.taxtech.atms.entity.KeyValueConfigExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from key_value_config
    <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">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from key_value_config
    where id = #{id,jdbcType=VARCHAR}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from key_value_config
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.entity.KeyValueConfigExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from key_value_config
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="pwc.taxtech.atms.entity.KeyValueConfig">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into key_value_config (id, key_code, name, 
      key_value_type, formula, is_constant, 
      calculate_status, result_type, service_type_ids, 
      industry_ids, description, creator, 
      create_time, updator, update_time, 
      data_source)
    values (#{id,jdbcType=VARCHAR}, #{keyCode,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
      #{keyValueType,jdbcType=INTEGER}, #{formula,jdbcType=VARCHAR}, #{isConstant,jdbcType=INTEGER}, 
      #{calculateStatus,jdbcType=INTEGER}, #{resultType,jdbcType=INTEGER}, #{serviceTypeIds,jdbcType=VARCHAR}, 
      #{industryIds,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR}, 
      #{createTime,jdbcType=TIMESTAMP}, #{updator,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, 
      #{dataSource,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.entity.KeyValueConfig">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into key_value_config
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="keyCode != null">
        key_code,
      </if>
      <if test="name != null">
        name,
      </if>
      <if test="keyValueType != null">
        key_value_type,
      </if>
      <if test="formula != null">
        formula,
      </if>
      <if test="isConstant != null">
        is_constant,
      </if>
      <if test="calculateStatus != null">
        calculate_status,
      </if>
      <if test="resultType != null">
        result_type,
      </if>
      <if test="serviceTypeIds != null">
        service_type_ids,
      </if>
      <if test="industryIds != null">
        industry_ids,
      </if>
      <if test="description != null">
        description,
      </if>
      <if test="creator != null">
        creator,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updator != null">
        updator,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="dataSource != null">
        data_source,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="keyCode != null">
        #{keyCode,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="keyValueType != null">
        #{keyValueType,jdbcType=INTEGER},
      </if>
      <if test="formula != null">
        #{formula,jdbcType=VARCHAR},
      </if>
      <if test="isConstant != null">
        #{isConstant,jdbcType=INTEGER},
      </if>
      <if test="calculateStatus != null">
        #{calculateStatus,jdbcType=INTEGER},
      </if>
      <if test="resultType != null">
        #{resultType,jdbcType=INTEGER},
      </if>
      <if test="serviceTypeIds != null">
        #{serviceTypeIds,jdbcType=VARCHAR},
      </if>
      <if test="industryIds != null">
        #{industryIds,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        #{description,jdbcType=VARCHAR},
      </if>
      <if test="creator != null">
        #{creator,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updator != null">
        #{updator,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="dataSource != null">
        #{dataSource,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="pwc.taxtech.atms.entity.KeyValueConfigExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from key_value_config
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </select>
  <update id="updateByExampleSelective" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update key_value_config
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.keyCode != null">
        key_code = #{record.keyCode,jdbcType=VARCHAR},
      </if>
      <if test="record.name != null">
        name = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.keyValueType != null">
        key_value_type = #{record.keyValueType,jdbcType=INTEGER},
      </if>
      <if test="record.formula != null">
        formula = #{record.formula,jdbcType=VARCHAR},
      </if>
      <if test="record.isConstant != null">
        is_constant = #{record.isConstant,jdbcType=INTEGER},
      </if>
      <if test="record.calculateStatus != null">
        calculate_status = #{record.calculateStatus,jdbcType=INTEGER},
      </if>
      <if test="record.resultType != null">
        result_type = #{record.resultType,jdbcType=INTEGER},
      </if>
      <if test="record.serviceTypeIds != null">
        service_type_ids = #{record.serviceTypeIds,jdbcType=VARCHAR},
      </if>
      <if test="record.industryIds != null">
        industry_ids = #{record.industryIds,jdbcType=VARCHAR},
      </if>
      <if test="record.description != null">
        description = #{record.description,jdbcType=VARCHAR},
      </if>
      <if test="record.creator != null">
        creator = #{record.creator,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updator != null">
        updator = #{record.updator,jdbcType=VARCHAR},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.dataSource != null">
        data_source = #{record.dataSource,jdbcType=VARCHAR},
      </if>
    </set>
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByExample" parameterType="map">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update key_value_config
    set id = #{record.id,jdbcType=VARCHAR},
      key_code = #{record.keyCode,jdbcType=VARCHAR},
      name = #{record.name,jdbcType=VARCHAR},
      key_value_type = #{record.keyValueType,jdbcType=INTEGER},
      formula = #{record.formula,jdbcType=VARCHAR},
      is_constant = #{record.isConstant,jdbcType=INTEGER},
      calculate_status = #{record.calculateStatus,jdbcType=INTEGER},
      result_type = #{record.resultType,jdbcType=INTEGER},
      service_type_ids = #{record.serviceTypeIds,jdbcType=VARCHAR},
      industry_ids = #{record.industryIds,jdbcType=VARCHAR},
      description = #{record.description,jdbcType=VARCHAR},
      creator = #{record.creator,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      updator = #{record.updator,jdbcType=VARCHAR},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      data_source = #{record.dataSource,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.entity.KeyValueConfig">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update key_value_config
    <set>
      <if test="keyCode != null">
        key_code = #{keyCode,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        name = #{name,jdbcType=VARCHAR},
      </if>
      <if test="keyValueType != null">
        key_value_type = #{keyValueType,jdbcType=INTEGER},
      </if>
      <if test="formula != null">
        formula = #{formula,jdbcType=VARCHAR},
      </if>
      <if test="isConstant != null">
        is_constant = #{isConstant,jdbcType=INTEGER},
      </if>
      <if test="calculateStatus != null">
        calculate_status = #{calculateStatus,jdbcType=INTEGER},
      </if>
      <if test="resultType != null">
        result_type = #{resultType,jdbcType=INTEGER},
      </if>
      <if test="serviceTypeIds != null">
        service_type_ids = #{serviceTypeIds,jdbcType=VARCHAR},
      </if>
      <if test="industryIds != null">
        industry_ids = #{industryIds,jdbcType=VARCHAR},
      </if>
      <if test="description != null">
        description = #{description,jdbcType=VARCHAR},
      </if>
      <if test="creator != null">
        creator = #{creator,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updator != null">
        updator = #{updator,jdbcType=VARCHAR},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="dataSource != null">
        data_source = #{dataSource,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.entity.KeyValueConfig">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update key_value_config
    set key_code = #{keyCode,jdbcType=VARCHAR},
      name = #{name,jdbcType=VARCHAR},
      key_value_type = #{keyValueType,jdbcType=INTEGER},
      formula = #{formula,jdbcType=VARCHAR},
      is_constant = #{isConstant,jdbcType=INTEGER},
      calculate_status = #{calculateStatus,jdbcType=INTEGER},
      result_type = #{resultType,jdbcType=INTEGER},
      service_type_ids = #{serviceTypeIds,jdbcType=VARCHAR},
      industry_ids = #{industryIds,jdbcType=VARCHAR},
      description = #{description,jdbcType=VARCHAR},
      creator = #{creator,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      updator = #{updator,jdbcType=VARCHAR},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      data_source = #{dataSource,jdbcType=VARCHAR}
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.entity.KeyValueConfigExample" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select
    <if test="distinct">
      distinct
    </if>
    <include refid="Base_Column_List" />
    from key_value_config
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>