<?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.vat.dao.AccountMapper">
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.Account">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="ID" jdbcType="VARCHAR" property="ID" />
    <result column="Code" jdbcType="VARCHAR" property="code" />
    <result column="Name" jdbcType="VARCHAR" property="name" />
    <result column="ParentCode" jdbcType="VARCHAR" property="parentCode" />
    <result column="FullName" jdbcType="VARCHAR" property="fullName" />
    <result column="AcctProp" jdbcType="INTEGER" property="acctProp" />
    <result column="SubProp" jdbcType="INTEGER" property="subProp" />
    <result column="AcctLevel" jdbcType="INTEGER" property="acctLevel" />
    <result column="Direction" jdbcType="INTEGER" property="direction" />
    <result column="IsLeaf" jdbcType="SMALLINT" property="isLeaf" />
    <result column="RuleType" jdbcType="INTEGER" property="ruleType" />
    <result column="IsActive" jdbcType="SMALLINT" property="isActive" />
    <result column="EnglishName" jdbcType="VARCHAR" property="englishName" />
    <result column="IndustryID" jdbcType="VARCHAR" property="industryID" />
  </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, Code, `Name`, ParentCode, FullName, AcctProp, SubProp, AcctLevel, Direction, 
    IsLeaf, RuleType, IsActive, EnglishName, IndustryID
  </sql>
  <select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.AccountExample" 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 Account
    <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 Account
    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 Account
    where ID = #{ID,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.AccountExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from Account
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="pwc.taxtech.atms.vat.entity.Account">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into Account (ID, Code, `Name`, 
      ParentCode, FullName, AcctProp, 
      SubProp, AcctLevel, Direction, 
      IsLeaf, RuleType, IsActive, 
      EnglishName, IndustryID)
    values (#{ID,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
      #{parentCode,jdbcType=VARCHAR}, #{fullName,jdbcType=VARCHAR}, #{acctProp,jdbcType=INTEGER}, 
      #{subProp,jdbcType=INTEGER}, #{acctLevel,jdbcType=INTEGER}, #{direction,jdbcType=INTEGER}, 
      #{isLeaf,jdbcType=SMALLINT}, #{ruleType,jdbcType=INTEGER}, #{isActive,jdbcType=SMALLINT}, 
      #{englishName,jdbcType=VARCHAR}, #{industryID,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.Account">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into Account
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="ID != null">
        ID,
      </if>
      <if test="code != null">
        Code,
      </if>
      <if test="name != null">
        `Name`,
      </if>
      <if test="parentCode != null">
        ParentCode,
      </if>
      <if test="fullName != null">
        FullName,
      </if>
      <if test="acctProp != null">
        AcctProp,
      </if>
      <if test="subProp != null">
        SubProp,
      </if>
      <if test="acctLevel != null">
        AcctLevel,
      </if>
      <if test="direction != null">
        Direction,
      </if>
      <if test="isLeaf != null">
        IsLeaf,
      </if>
      <if test="ruleType != null">
        RuleType,
      </if>
      <if test="isActive != null">
        IsActive,
      </if>
      <if test="englishName != null">
        EnglishName,
      </if>
      <if test="industryID != null">
        IndustryID,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="ID != null">
        #{ID,jdbcType=VARCHAR},
      </if>
      <if test="code != null">
        #{code,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        #{name,jdbcType=VARCHAR},
      </if>
      <if test="parentCode != null">
        #{parentCode,jdbcType=VARCHAR},
      </if>
      <if test="fullName != null">
        #{fullName,jdbcType=VARCHAR},
      </if>
      <if test="acctProp != null">
        #{acctProp,jdbcType=INTEGER},
      </if>
      <if test="subProp != null">
        #{subProp,jdbcType=INTEGER},
      </if>
      <if test="acctLevel != null">
        #{acctLevel,jdbcType=INTEGER},
      </if>
      <if test="direction != null">
        #{direction,jdbcType=INTEGER},
      </if>
      <if test="isLeaf != null">
        #{isLeaf,jdbcType=SMALLINT},
      </if>
      <if test="ruleType != null">
        #{ruleType,jdbcType=INTEGER},
      </if>
      <if test="isActive != null">
        #{isActive,jdbcType=SMALLINT},
      </if>
      <if test="englishName != null">
        #{englishName,jdbcType=VARCHAR},
      </if>
      <if test="industryID != null">
        #{industryID,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.AccountExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from Account
    <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 Account
    <set>
      <if test="record.ID != null">
        ID = #{record.ID,jdbcType=VARCHAR},
      </if>
      <if test="record.code != null">
        Code = #{record.code,jdbcType=VARCHAR},
      </if>
      <if test="record.name != null">
        `Name` = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.parentCode != null">
        ParentCode = #{record.parentCode,jdbcType=VARCHAR},
      </if>
      <if test="record.fullName != null">
        FullName = #{record.fullName,jdbcType=VARCHAR},
      </if>
      <if test="record.acctProp != null">
        AcctProp = #{record.acctProp,jdbcType=INTEGER},
      </if>
      <if test="record.subProp != null">
        SubProp = #{record.subProp,jdbcType=INTEGER},
      </if>
      <if test="record.acctLevel != null">
        AcctLevel = #{record.acctLevel,jdbcType=INTEGER},
      </if>
      <if test="record.direction != null">
        Direction = #{record.direction,jdbcType=INTEGER},
      </if>
      <if test="record.isLeaf != null">
        IsLeaf = #{record.isLeaf,jdbcType=SMALLINT},
      </if>
      <if test="record.ruleType != null">
        RuleType = #{record.ruleType,jdbcType=INTEGER},
      </if>
      <if test="record.isActive != null">
        IsActive = #{record.isActive,jdbcType=SMALLINT},
      </if>
      <if test="record.englishName != null">
        EnglishName = #{record.englishName,jdbcType=VARCHAR},
      </if>
      <if test="record.industryID != null">
        IndustryID = #{record.industryID,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 Account
    set ID = #{record.ID,jdbcType=VARCHAR},
      Code = #{record.code,jdbcType=VARCHAR},
      `Name` = #{record.name,jdbcType=VARCHAR},
      ParentCode = #{record.parentCode,jdbcType=VARCHAR},
      FullName = #{record.fullName,jdbcType=VARCHAR},
      AcctProp = #{record.acctProp,jdbcType=INTEGER},
      SubProp = #{record.subProp,jdbcType=INTEGER},
      AcctLevel = #{record.acctLevel,jdbcType=INTEGER},
      Direction = #{record.direction,jdbcType=INTEGER},
      IsLeaf = #{record.isLeaf,jdbcType=SMALLINT},
      RuleType = #{record.ruleType,jdbcType=INTEGER},
      IsActive = #{record.isActive,jdbcType=SMALLINT},
      EnglishName = #{record.englishName,jdbcType=VARCHAR},
      IndustryID = #{record.industryID,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.vat.entity.Account">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update Account
    <set>
      <if test="code != null">
        Code = #{code,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        `Name` = #{name,jdbcType=VARCHAR},
      </if>
      <if test="parentCode != null">
        ParentCode = #{parentCode,jdbcType=VARCHAR},
      </if>
      <if test="fullName != null">
        FullName = #{fullName,jdbcType=VARCHAR},
      </if>
      <if test="acctProp != null">
        AcctProp = #{acctProp,jdbcType=INTEGER},
      </if>
      <if test="subProp != null">
        SubProp = #{subProp,jdbcType=INTEGER},
      </if>
      <if test="acctLevel != null">
        AcctLevel = #{acctLevel,jdbcType=INTEGER},
      </if>
      <if test="direction != null">
        Direction = #{direction,jdbcType=INTEGER},
      </if>
      <if test="isLeaf != null">
        IsLeaf = #{isLeaf,jdbcType=SMALLINT},
      </if>
      <if test="ruleType != null">
        RuleType = #{ruleType,jdbcType=INTEGER},
      </if>
      <if test="isActive != null">
        IsActive = #{isActive,jdbcType=SMALLINT},
      </if>
      <if test="englishName != null">
        EnglishName = #{englishName,jdbcType=VARCHAR},
      </if>
      <if test="industryID != null">
        IndustryID = #{industryID,jdbcType=VARCHAR},
      </if>
    </set>
    where ID = #{ID,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.vat.entity.Account">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update Account
    set Code = #{code,jdbcType=VARCHAR},
      `Name` = #{name,jdbcType=VARCHAR},
      ParentCode = #{parentCode,jdbcType=VARCHAR},
      FullName = #{fullName,jdbcType=VARCHAR},
      AcctProp = #{acctProp,jdbcType=INTEGER},
      SubProp = #{subProp,jdbcType=INTEGER},
      AcctLevel = #{acctLevel,jdbcType=INTEGER},
      Direction = #{direction,jdbcType=INTEGER},
      IsLeaf = #{isLeaf,jdbcType=SMALLINT},
      RuleType = #{ruleType,jdbcType=INTEGER},
      IsActive = #{isActive,jdbcType=SMALLINT},
      EnglishName = #{englishName,jdbcType=VARCHAR},
      IndustryID = #{industryID,jdbcType=VARCHAR}
    where ID = #{ID,jdbcType=VARCHAR}
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.AccountExample" 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 Account
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>