<?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.PeriodEnterpriseAccountMapper">
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccount">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="acct_code" jdbcType="VARCHAR" property="acctCode" />
    <result column="name" jdbcType="VARCHAR" property="name" />
    <result column="parent_code" jdbcType="VARCHAR" property="parentCode" />
    <result column="full_name" jdbcType="VARCHAR" property="fullName" />
    <result column="acct_prop" jdbcType="INTEGER" property="acctProp" />
    <result column="sub_prop" jdbcType="INTEGER" property="subProp" />
    <result column="acct_level" jdbcType="INTEGER" property="acctLevel" />
    <result column="direction" jdbcType="INTEGER" property="direction" />
    <result column="is_leaf" jdbcType="BIT" property="isLeaf" />
    <result column="is_active" jdbcType="BIT" property="isActive" />
    <result column="english_name" jdbcType="VARCHAR" property="englishName" />
    <result column="std_code" jdbcType="VARCHAR" property="stdCode" />
    <result column="enterprise_account_set_id" jdbcType="VARCHAR" property="enterpriseAccountSetId" />
    <result column="is_dummy" jdbcType="INTEGER" property="isDummy" />
    <result column="is_in_voucher" jdbcType="INTEGER" property="isInVoucher" />
    <result column="creator_id" jdbcType="VARCHAR" property="creatorId" />
    <result column="updator_id" jdbcType="VARCHAR" property="updatorId" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="project_id" jdbcType="VARCHAR" property="projectId" />
    <result column="period" jdbcType="INTEGER" property="period" />
  </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, acct_code, `name`, parent_code, full_name, acct_prop, sub_prop, acct_level, direction, 
    is_leaf, is_active, english_name, std_code, enterprise_account_set_id, is_dummy, 
    is_in_voucher, creator_id, updator_id, create_time, update_time, project_id, period
  </sql>
  <select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccountExample" 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 period_enterprise_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 period_enterprise_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 period_enterprise_account
    where id = #{id,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccountExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from period_enterprise_account
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccount">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into period_enterprise_account (id, acct_code, `name`, 
      parent_code, full_name, acct_prop, 
      sub_prop, acct_level, direction, 
      is_leaf, is_active, english_name, 
      std_code, enterprise_account_set_id, is_dummy, 
      is_in_voucher, creator_id, updator_id, 
      create_time, update_time, project_id, 
      period)
    values (#{id,jdbcType=VARCHAR}, #{acctCode,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=BIT}, #{isActive,jdbcType=BIT}, #{englishName,jdbcType=VARCHAR}, 
      #{stdCode,jdbcType=VARCHAR}, #{enterpriseAccountSetId,jdbcType=VARCHAR}, #{isDummy,jdbcType=INTEGER}, 
      #{isInVoucher,jdbcType=INTEGER}, #{creatorId,jdbcType=VARCHAR}, #{updatorId,jdbcType=VARCHAR}, 
      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{projectId,jdbcType=VARCHAR}, 
      #{period,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccount">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into period_enterprise_account
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="acctCode != null">
        acct_code,
      </if>
      <if test="name != null">
        `name`,
      </if>
      <if test="parentCode != null">
        parent_code,
      </if>
      <if test="fullName != null">
        full_name,
      </if>
      <if test="acctProp != null">
        acct_prop,
      </if>
      <if test="subProp != null">
        sub_prop,
      </if>
      <if test="acctLevel != null">
        acct_level,
      </if>
      <if test="direction != null">
        direction,
      </if>
      <if test="isLeaf != null">
        is_leaf,
      </if>
      <if test="isActive != null">
        is_active,
      </if>
      <if test="englishName != null">
        english_name,
      </if>
      <if test="stdCode != null">
        std_code,
      </if>
      <if test="enterpriseAccountSetId != null">
        enterprise_account_set_id,
      </if>
      <if test="isDummy != null">
        is_dummy,
      </if>
      <if test="isInVoucher != null">
        is_in_voucher,
      </if>
      <if test="creatorId != null">
        creator_id,
      </if>
      <if test="updatorId != null">
        updator_id,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="projectId != null">
        project_id,
      </if>
      <if test="period != null">
        period,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=VARCHAR},
      </if>
      <if test="acctCode != null">
        #{acctCode,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=BIT},
      </if>
      <if test="isActive != null">
        #{isActive,jdbcType=BIT},
      </if>
      <if test="englishName != null">
        #{englishName,jdbcType=VARCHAR},
      </if>
      <if test="stdCode != null">
        #{stdCode,jdbcType=VARCHAR},
      </if>
      <if test="enterpriseAccountSetId != null">
        #{enterpriseAccountSetId,jdbcType=VARCHAR},
      </if>
      <if test="isDummy != null">
        #{isDummy,jdbcType=INTEGER},
      </if>
      <if test="isInVoucher != null">
        #{isInVoucher,jdbcType=INTEGER},
      </if>
      <if test="creatorId != null">
        #{creatorId,jdbcType=VARCHAR},
      </if>
      <if test="updatorId != null">
        #{updatorId,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="projectId != null">
        #{projectId,jdbcType=VARCHAR},
      </if>
      <if test="period != null">
        #{period,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccountExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from period_enterprise_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 period_enterprise_account
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=VARCHAR},
      </if>
      <if test="record.acctCode != null">
        acct_code = #{record.acctCode,jdbcType=VARCHAR},
      </if>
      <if test="record.name != null">
        `name` = #{record.name,jdbcType=VARCHAR},
      </if>
      <if test="record.parentCode != null">
        parent_code = #{record.parentCode,jdbcType=VARCHAR},
      </if>
      <if test="record.fullName != null">
        full_name = #{record.fullName,jdbcType=VARCHAR},
      </if>
      <if test="record.acctProp != null">
        acct_prop = #{record.acctProp,jdbcType=INTEGER},
      </if>
      <if test="record.subProp != null">
        sub_prop = #{record.subProp,jdbcType=INTEGER},
      </if>
      <if test="record.acctLevel != null">
        acct_level = #{record.acctLevel,jdbcType=INTEGER},
      </if>
      <if test="record.direction != null">
        direction = #{record.direction,jdbcType=INTEGER},
      </if>
      <if test="record.isLeaf != null">
        is_leaf = #{record.isLeaf,jdbcType=BIT},
      </if>
      <if test="record.isActive != null">
        is_active = #{record.isActive,jdbcType=BIT},
      </if>
      <if test="record.englishName != null">
        english_name = #{record.englishName,jdbcType=VARCHAR},
      </if>
      <if test="record.stdCode != null">
        std_code = #{record.stdCode,jdbcType=VARCHAR},
      </if>
      <if test="record.enterpriseAccountSetId != null">
        enterprise_account_set_id = #{record.enterpriseAccountSetId,jdbcType=VARCHAR},
      </if>
      <if test="record.isDummy != null">
        is_dummy = #{record.isDummy,jdbcType=INTEGER},
      </if>
      <if test="record.isInVoucher != null">
        is_in_voucher = #{record.isInVoucher,jdbcType=INTEGER},
      </if>
      <if test="record.creatorId != null">
        creator_id = #{record.creatorId,jdbcType=VARCHAR},
      </if>
      <if test="record.updatorId != null">
        updator_id = #{record.updatorId,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        create_time = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.updateTime != null">
        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.projectId != null">
        project_id = #{record.projectId,jdbcType=VARCHAR},
      </if>
      <if test="record.period != null">
        period = #{record.period,jdbcType=INTEGER},
      </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 period_enterprise_account
    set id = #{record.id,jdbcType=VARCHAR},
      acct_code = #{record.acctCode,jdbcType=VARCHAR},
      `name` = #{record.name,jdbcType=VARCHAR},
      parent_code = #{record.parentCode,jdbcType=VARCHAR},
      full_name = #{record.fullName,jdbcType=VARCHAR},
      acct_prop = #{record.acctProp,jdbcType=INTEGER},
      sub_prop = #{record.subProp,jdbcType=INTEGER},
      acct_level = #{record.acctLevel,jdbcType=INTEGER},
      direction = #{record.direction,jdbcType=INTEGER},
      is_leaf = #{record.isLeaf,jdbcType=BIT},
      is_active = #{record.isActive,jdbcType=BIT},
      english_name = #{record.englishName,jdbcType=VARCHAR},
      std_code = #{record.stdCode,jdbcType=VARCHAR},
      enterprise_account_set_id = #{record.enterpriseAccountSetId,jdbcType=VARCHAR},
      is_dummy = #{record.isDummy,jdbcType=INTEGER},
      is_in_voucher = #{record.isInVoucher,jdbcType=INTEGER},
      creator_id = #{record.creatorId,jdbcType=VARCHAR},
      updator_id = #{record.updatorId,jdbcType=VARCHAR},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      project_id = #{record.projectId,jdbcType=VARCHAR},
      period = #{record.period,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccount">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update period_enterprise_account
    <set>
      <if test="acctCode != null">
        acct_code = #{acctCode,jdbcType=VARCHAR},
      </if>
      <if test="name != null">
        `name` = #{name,jdbcType=VARCHAR},
      </if>
      <if test="parentCode != null">
        parent_code = #{parentCode,jdbcType=VARCHAR},
      </if>
      <if test="fullName != null">
        full_name = #{fullName,jdbcType=VARCHAR},
      </if>
      <if test="acctProp != null">
        acct_prop = #{acctProp,jdbcType=INTEGER},
      </if>
      <if test="subProp != null">
        sub_prop = #{subProp,jdbcType=INTEGER},
      </if>
      <if test="acctLevel != null">
        acct_level = #{acctLevel,jdbcType=INTEGER},
      </if>
      <if test="direction != null">
        direction = #{direction,jdbcType=INTEGER},
      </if>
      <if test="isLeaf != null">
        is_leaf = #{isLeaf,jdbcType=BIT},
      </if>
      <if test="isActive != null">
        is_active = #{isActive,jdbcType=BIT},
      </if>
      <if test="englishName != null">
        english_name = #{englishName,jdbcType=VARCHAR},
      </if>
      <if test="stdCode != null">
        std_code = #{stdCode,jdbcType=VARCHAR},
      </if>
      <if test="enterpriseAccountSetId != null">
        enterprise_account_set_id = #{enterpriseAccountSetId,jdbcType=VARCHAR},
      </if>
      <if test="isDummy != null">
        is_dummy = #{isDummy,jdbcType=INTEGER},
      </if>
      <if test="isInVoucher != null">
        is_in_voucher = #{isInVoucher,jdbcType=INTEGER},
      </if>
      <if test="creatorId != null">
        creator_id = #{creatorId,jdbcType=VARCHAR},
      </if>
      <if test="updatorId != null">
        updator_id = #{updatorId,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="projectId != null">
        project_id = #{projectId,jdbcType=VARCHAR},
      </if>
      <if test="period != null">
        period = #{period,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccount">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update period_enterprise_account
    set acct_code = #{acctCode,jdbcType=VARCHAR},
      `name` = #{name,jdbcType=VARCHAR},
      parent_code = #{parentCode,jdbcType=VARCHAR},
      full_name = #{fullName,jdbcType=VARCHAR},
      acct_prop = #{acctProp,jdbcType=INTEGER},
      sub_prop = #{subProp,jdbcType=INTEGER},
      acct_level = #{acctLevel,jdbcType=INTEGER},
      direction = #{direction,jdbcType=INTEGER},
      is_leaf = #{isLeaf,jdbcType=BIT},
      is_active = #{isActive,jdbcType=BIT},
      english_name = #{englishName,jdbcType=VARCHAR},
      std_code = #{stdCode,jdbcType=VARCHAR},
      enterprise_account_set_id = #{enterpriseAccountSetId,jdbcType=VARCHAR},
      is_dummy = #{isDummy,jdbcType=INTEGER},
      is_in_voucher = #{isInVoucher,jdbcType=INTEGER},
      creator_id = #{creatorId,jdbcType=VARCHAR},
      updator_id = #{updatorId,jdbcType=VARCHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      project_id = #{projectId,jdbcType=VARCHAR},
      period = #{period,jdbcType=INTEGER}
    where id = #{id,jdbcType=VARCHAR}
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.PeriodEnterpriseAccountExample" 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 period_enterprise_account
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>