<?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="DECIMAL" property="keyValueType" />
    <result column="FORMULA" jdbcType="VARCHAR" property="formula" />
    <result column="IS_CONSTANT" jdbcType="DECIMAL" property="isConstant" />
    <result column="CALCULATE_STATUS" jdbcType="DECIMAL" property="calculateStatus" />
    <result column="RESULT_TYPE" jdbcType="DECIMAL" 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=DECIMAL}, #{formula,jdbcType=VARCHAR}, #{isConstant,jdbcType=DECIMAL}, 
      #{calculateStatus,jdbcType=DECIMAL}, #{resultType,jdbcType=DECIMAL}, #{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=DECIMAL},
      </if>
      <if test="formula != null">
        #{formula,jdbcType=VARCHAR},
      </if>
      <if test="isConstant != null">
        #{isConstant,jdbcType=DECIMAL},
      </if>
      <if test="calculateStatus != null">
        #{calculateStatus,jdbcType=DECIMAL},
      </if>
      <if test="resultType != null">
        #{resultType,jdbcType=DECIMAL},
      </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=DECIMAL},
      </if>
      <if test="record.formula != null">
        FORMULA = #{record.formula,jdbcType=VARCHAR},
      </if>
      <if test="record.isConstant != null">
        IS_CONSTANT = #{record.isConstant,jdbcType=DECIMAL},
      </if>
      <if test="record.calculateStatus != null">
        CALCULATE_STATUS = #{record.calculateStatus,jdbcType=DECIMAL},
      </if>
      <if test="record.resultType != null">
        RESULT_TYPE = #{record.resultType,jdbcType=DECIMAL},
      </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=DECIMAL},
      FORMULA = #{record.formula,jdbcType=VARCHAR},
      IS_CONSTANT = #{record.isConstant,jdbcType=DECIMAL},
      CALCULATE_STATUS = #{record.calculateStatus,jdbcType=DECIMAL},
      RESULT_TYPE = #{record.resultType,jdbcType=DECIMAL},
      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=DECIMAL},
      </if>
      <if test="formula != null">
        FORMULA = #{formula,jdbcType=VARCHAR},
      </if>
      <if test="isConstant != null">
        IS_CONSTANT = #{isConstant,jdbcType=DECIMAL},
      </if>
      <if test="calculateStatus != null">
        CALCULATE_STATUS = #{calculateStatus,jdbcType=DECIMAL},
      </if>
      <if test="resultType != null">
        RESULT_TYPE = #{resultType,jdbcType=DECIMAL},
      </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=DECIMAL},
      FORMULA = #{formula,jdbcType=VARCHAR},
      IS_CONSTANT = #{isConstant,jdbcType=DECIMAL},
      CALCULATE_STATUS = #{calculateStatus,jdbcType=DECIMAL},
      RESULT_TYPE = #{resultType,jdbcType=DECIMAL},
      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>