<?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.AdjustmentTableMapper">
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.AdjustmentTable">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="organization_id" jdbcType="VARCHAR" property="organizationId" />
    <result column="project_id" jdbcType="VARCHAR" property="projectId" />
    <result column="period" jdbcType="INTEGER" property="period" />
    <result column="segment1" jdbcType="VARCHAR" property="segment1" />
    <result column="segment2" jdbcType="VARCHAR" property="segment2" />
    <result column="segment3" jdbcType="VARCHAR" property="segment3" />
    <result column="segment4" jdbcType="VARCHAR" property="segment4" />
    <result column="segment5" jdbcType="VARCHAR" property="segment5" />
    <result column="segment6" jdbcType="VARCHAR" property="segment6" />
    <result column="segment7" jdbcType="VARCHAR" property="segment7" />
    <result column="segment8" jdbcType="VARCHAR" property="segment8" />
    <result column="segment9" jdbcType="VARCHAR" property="segment9" />
    <result column="segment10" jdbcType="VARCHAR" property="segment10" />
    <result column="segment1_name" jdbcType="VARCHAR" property="segment1Name" />
    <result column="segment2_name" jdbcType="VARCHAR" property="segment2Name" />
    <result column="segment3_name" jdbcType="VARCHAR" property="segment3Name" />
    <result column="segment4_name" jdbcType="VARCHAR" property="segment4Name" />
    <result column="segment5_name" jdbcType="VARCHAR" property="segment5Name" />
    <result column="segment6_name" jdbcType="VARCHAR" property="segment6Name" />
    <result column="segment7_name" jdbcType="VARCHAR" property="segment7Name" />
    <result column="segment8_name" jdbcType="VARCHAR" property="segment8Name" />
    <result column="segment9_name" jdbcType="VARCHAR" property="segment9Name" />
    <result column="segment10_name" jdbcType="VARCHAR" property="segment10Name" />
    <result column="period_dr_beq" jdbcType="DECIMAL" property="periodDrBeq" />
    <result column="period_cr_beq" jdbcType="DECIMAL" property="periodCrBeq" />
    <result column="end_bal_beq" jdbcType="DECIMAL" property="endBalBeq" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
    <result column="tms_period" jdbcType="INTEGER" property="tmsPeriod" />
  </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, organization_id, project_id, period, segment1, segment2, segment3, segment4, 
    segment5, segment6, segment7, segment8, segment9, segment10, segment1_name, segment2_name, 
    segment3_name, segment4_name, segment5_name, segment6_name, segment7_name, segment8_name, 
    segment9_name, segment10_name, period_dr_beq, period_cr_beq, end_bal_beq, create_time, 
    update_time, tms_period
  </sql>
  <select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.AdjustmentTableExample" 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 adjustment_table
    <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.Long" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from adjustment_table
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from adjustment_table
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.AdjustmentTableExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from adjustment_table
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="pwc.taxtech.atms.vat.entity.AdjustmentTable">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into adjustment_table (id, organization_id, project_id, 
      period, segment1, segment2, 
      segment3, segment4, segment5, 
      segment6, segment7, segment8, 
      segment9, segment10, segment1_name, 
      segment2_name, segment3_name, segment4_name, 
      segment5_name, segment6_name, segment7_name, 
      segment8_name, segment9_name, segment10_name, 
      period_dr_beq, period_cr_beq, end_bal_beq, 
      create_time, update_time, tms_period
      )
    values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{projectId,jdbcType=VARCHAR}, 
      #{period,jdbcType=INTEGER}, #{segment1,jdbcType=VARCHAR}, #{segment2,jdbcType=VARCHAR}, 
      #{segment3,jdbcType=VARCHAR}, #{segment4,jdbcType=VARCHAR}, #{segment5,jdbcType=VARCHAR}, 
      #{segment6,jdbcType=VARCHAR}, #{segment7,jdbcType=VARCHAR}, #{segment8,jdbcType=VARCHAR}, 
      #{segment9,jdbcType=VARCHAR}, #{segment10,jdbcType=VARCHAR}, #{segment1Name,jdbcType=VARCHAR}, 
      #{segment2Name,jdbcType=VARCHAR}, #{segment3Name,jdbcType=VARCHAR}, #{segment4Name,jdbcType=VARCHAR}, 
      #{segment5Name,jdbcType=VARCHAR}, #{segment6Name,jdbcType=VARCHAR}, #{segment7Name,jdbcType=VARCHAR}, 
      #{segment8Name,jdbcType=VARCHAR}, #{segment9Name,jdbcType=VARCHAR}, #{segment10Name,jdbcType=VARCHAR}, 
      #{periodDrBeq,jdbcType=DECIMAL}, #{periodCrBeq,jdbcType=DECIMAL}, #{endBalBeq,jdbcType=DECIMAL}, 
      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{tmsPeriod,jdbcType=INTEGER}
      )
  </insert>
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.AdjustmentTable">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into adjustment_table
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="organizationId != null">
        organization_id,
      </if>
      <if test="projectId != null">
        project_id,
      </if>
      <if test="period != null">
        period,
      </if>
      <if test="segment1 != null">
        segment1,
      </if>
      <if test="segment2 != null">
        segment2,
      </if>
      <if test="segment3 != null">
        segment3,
      </if>
      <if test="segment4 != null">
        segment4,
      </if>
      <if test="segment5 != null">
        segment5,
      </if>
      <if test="segment6 != null">
        segment6,
      </if>
      <if test="segment7 != null">
        segment7,
      </if>
      <if test="segment8 != null">
        segment8,
      </if>
      <if test="segment9 != null">
        segment9,
      </if>
      <if test="segment10 != null">
        segment10,
      </if>
      <if test="segment1Name != null">
        segment1_name,
      </if>
      <if test="segment2Name != null">
        segment2_name,
      </if>
      <if test="segment3Name != null">
        segment3_name,
      </if>
      <if test="segment4Name != null">
        segment4_name,
      </if>
      <if test="segment5Name != null">
        segment5_name,
      </if>
      <if test="segment6Name != null">
        segment6_name,
      </if>
      <if test="segment7Name != null">
        segment7_name,
      </if>
      <if test="segment8Name != null">
        segment8_name,
      </if>
      <if test="segment9Name != null">
        segment9_name,
      </if>
      <if test="segment10Name != null">
        segment10_name,
      </if>
      <if test="periodDrBeq != null">
        period_dr_beq,
      </if>
      <if test="periodCrBeq != null">
        period_cr_beq,
      </if>
      <if test="endBalBeq != null">
        end_bal_beq,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="updateTime != null">
        update_time,
      </if>
      <if test="tmsPeriod != null">
        tms_period,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="organizationId != null">
        #{organizationId,jdbcType=VARCHAR},
      </if>
      <if test="projectId != null">
        #{projectId,jdbcType=VARCHAR},
      </if>
      <if test="period != null">
        #{period,jdbcType=INTEGER},
      </if>
      <if test="segment1 != null">
        #{segment1,jdbcType=VARCHAR},
      </if>
      <if test="segment2 != null">
        #{segment2,jdbcType=VARCHAR},
      </if>
      <if test="segment3 != null">
        #{segment3,jdbcType=VARCHAR},
      </if>
      <if test="segment4 != null">
        #{segment4,jdbcType=VARCHAR},
      </if>
      <if test="segment5 != null">
        #{segment5,jdbcType=VARCHAR},
      </if>
      <if test="segment6 != null">
        #{segment6,jdbcType=VARCHAR},
      </if>
      <if test="segment7 != null">
        #{segment7,jdbcType=VARCHAR},
      </if>
      <if test="segment8 != null">
        #{segment8,jdbcType=VARCHAR},
      </if>
      <if test="segment9 != null">
        #{segment9,jdbcType=VARCHAR},
      </if>
      <if test="segment10 != null">
        #{segment10,jdbcType=VARCHAR},
      </if>
      <if test="segment1Name != null">
        #{segment1Name,jdbcType=VARCHAR},
      </if>
      <if test="segment2Name != null">
        #{segment2Name,jdbcType=VARCHAR},
      </if>
      <if test="segment3Name != null">
        #{segment3Name,jdbcType=VARCHAR},
      </if>
      <if test="segment4Name != null">
        #{segment4Name,jdbcType=VARCHAR},
      </if>
      <if test="segment5Name != null">
        #{segment5Name,jdbcType=VARCHAR},
      </if>
      <if test="segment6Name != null">
        #{segment6Name,jdbcType=VARCHAR},
      </if>
      <if test="segment7Name != null">
        #{segment7Name,jdbcType=VARCHAR},
      </if>
      <if test="segment8Name != null">
        #{segment8Name,jdbcType=VARCHAR},
      </if>
      <if test="segment9Name != null">
        #{segment9Name,jdbcType=VARCHAR},
      </if>
      <if test="segment10Name != null">
        #{segment10Name,jdbcType=VARCHAR},
      </if>
      <if test="periodDrBeq != null">
        #{periodDrBeq,jdbcType=DECIMAL},
      </if>
      <if test="periodCrBeq != null">
        #{periodCrBeq,jdbcType=DECIMAL},
      </if>
      <if test="endBalBeq != null">
        #{endBalBeq,jdbcType=DECIMAL},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="tmsPeriod != null">
        #{tmsPeriod,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.AdjustmentTableExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from adjustment_table
    <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 adjustment_table
    <set>
      <if test="record.id != null">
        id = #{record.id,jdbcType=BIGINT},
      </if>
      <if test="record.organizationId != null">
        organization_id = #{record.organizationId,jdbcType=VARCHAR},
      </if>
      <if test="record.projectId != null">
        project_id = #{record.projectId,jdbcType=VARCHAR},
      </if>
      <if test="record.period != null">
        period = #{record.period,jdbcType=INTEGER},
      </if>
      <if test="record.segment1 != null">
        segment1 = #{record.segment1,jdbcType=VARCHAR},
      </if>
      <if test="record.segment2 != null">
        segment2 = #{record.segment2,jdbcType=VARCHAR},
      </if>
      <if test="record.segment3 != null">
        segment3 = #{record.segment3,jdbcType=VARCHAR},
      </if>
      <if test="record.segment4 != null">
        segment4 = #{record.segment4,jdbcType=VARCHAR},
      </if>
      <if test="record.segment5 != null">
        segment5 = #{record.segment5,jdbcType=VARCHAR},
      </if>
      <if test="record.segment6 != null">
        segment6 = #{record.segment6,jdbcType=VARCHAR},
      </if>
      <if test="record.segment7 != null">
        segment7 = #{record.segment7,jdbcType=VARCHAR},
      </if>
      <if test="record.segment8 != null">
        segment8 = #{record.segment8,jdbcType=VARCHAR},
      </if>
      <if test="record.segment9 != null">
        segment9 = #{record.segment9,jdbcType=VARCHAR},
      </if>
      <if test="record.segment10 != null">
        segment10 = #{record.segment10,jdbcType=VARCHAR},
      </if>
      <if test="record.segment1Name != null">
        segment1_name = #{record.segment1Name,jdbcType=VARCHAR},
      </if>
      <if test="record.segment2Name != null">
        segment2_name = #{record.segment2Name,jdbcType=VARCHAR},
      </if>
      <if test="record.segment3Name != null">
        segment3_name = #{record.segment3Name,jdbcType=VARCHAR},
      </if>
      <if test="record.segment4Name != null">
        segment4_name = #{record.segment4Name,jdbcType=VARCHAR},
      </if>
      <if test="record.segment5Name != null">
        segment5_name = #{record.segment5Name,jdbcType=VARCHAR},
      </if>
      <if test="record.segment6Name != null">
        segment6_name = #{record.segment6Name,jdbcType=VARCHAR},
      </if>
      <if test="record.segment7Name != null">
        segment7_name = #{record.segment7Name,jdbcType=VARCHAR},
      </if>
      <if test="record.segment8Name != null">
        segment8_name = #{record.segment8Name,jdbcType=VARCHAR},
      </if>
      <if test="record.segment9Name != null">
        segment9_name = #{record.segment9Name,jdbcType=VARCHAR},
      </if>
      <if test="record.segment10Name != null">
        segment10_name = #{record.segment10Name,jdbcType=VARCHAR},
      </if>
      <if test="record.periodDrBeq != null">
        period_dr_beq = #{record.periodDrBeq,jdbcType=DECIMAL},
      </if>
      <if test="record.periodCrBeq != null">
        period_cr_beq = #{record.periodCrBeq,jdbcType=DECIMAL},
      </if>
      <if test="record.endBalBeq != null">
        end_bal_beq = #{record.endBalBeq,jdbcType=DECIMAL},
      </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.tmsPeriod != null">
        tms_period = #{record.tmsPeriod,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 adjustment_table
    set id = #{record.id,jdbcType=BIGINT},
      organization_id = #{record.organizationId,jdbcType=VARCHAR},
      project_id = #{record.projectId,jdbcType=VARCHAR},
      period = #{record.period,jdbcType=INTEGER},
      segment1 = #{record.segment1,jdbcType=VARCHAR},
      segment2 = #{record.segment2,jdbcType=VARCHAR},
      segment3 = #{record.segment3,jdbcType=VARCHAR},
      segment4 = #{record.segment4,jdbcType=VARCHAR},
      segment5 = #{record.segment5,jdbcType=VARCHAR},
      segment6 = #{record.segment6,jdbcType=VARCHAR},
      segment7 = #{record.segment7,jdbcType=VARCHAR},
      segment8 = #{record.segment8,jdbcType=VARCHAR},
      segment9 = #{record.segment9,jdbcType=VARCHAR},
      segment10 = #{record.segment10,jdbcType=VARCHAR},
      segment1_name = #{record.segment1Name,jdbcType=VARCHAR},
      segment2_name = #{record.segment2Name,jdbcType=VARCHAR},
      segment3_name = #{record.segment3Name,jdbcType=VARCHAR},
      segment4_name = #{record.segment4Name,jdbcType=VARCHAR},
      segment5_name = #{record.segment5Name,jdbcType=VARCHAR},
      segment6_name = #{record.segment6Name,jdbcType=VARCHAR},
      segment7_name = #{record.segment7Name,jdbcType=VARCHAR},
      segment8_name = #{record.segment8Name,jdbcType=VARCHAR},
      segment9_name = #{record.segment9Name,jdbcType=VARCHAR},
      segment10_name = #{record.segment10Name,jdbcType=VARCHAR},
      period_dr_beq = #{record.periodDrBeq,jdbcType=DECIMAL},
      period_cr_beq = #{record.periodCrBeq,jdbcType=DECIMAL},
      end_bal_beq = #{record.endBalBeq,jdbcType=DECIMAL},
      create_time = #{record.createTime,jdbcType=TIMESTAMP},
      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
      tms_period = #{record.tmsPeriod,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.vat.entity.AdjustmentTable">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update adjustment_table
    <set>
      <if test="organizationId != null">
        organization_id = #{organizationId,jdbcType=VARCHAR},
      </if>
      <if test="projectId != null">
        project_id = #{projectId,jdbcType=VARCHAR},
      </if>
      <if test="period != null">
        period = #{period,jdbcType=INTEGER},
      </if>
      <if test="segment1 != null">
        segment1 = #{segment1,jdbcType=VARCHAR},
      </if>
      <if test="segment2 != null">
        segment2 = #{segment2,jdbcType=VARCHAR},
      </if>
      <if test="segment3 != null">
        segment3 = #{segment3,jdbcType=VARCHAR},
      </if>
      <if test="segment4 != null">
        segment4 = #{segment4,jdbcType=VARCHAR},
      </if>
      <if test="segment5 != null">
        segment5 = #{segment5,jdbcType=VARCHAR},
      </if>
      <if test="segment6 != null">
        segment6 = #{segment6,jdbcType=VARCHAR},
      </if>
      <if test="segment7 != null">
        segment7 = #{segment7,jdbcType=VARCHAR},
      </if>
      <if test="segment8 != null">
        segment8 = #{segment8,jdbcType=VARCHAR},
      </if>
      <if test="segment9 != null">
        segment9 = #{segment9,jdbcType=VARCHAR},
      </if>
      <if test="segment10 != null">
        segment10 = #{segment10,jdbcType=VARCHAR},
      </if>
      <if test="segment1Name != null">
        segment1_name = #{segment1Name,jdbcType=VARCHAR},
      </if>
      <if test="segment2Name != null">
        segment2_name = #{segment2Name,jdbcType=VARCHAR},
      </if>
      <if test="segment3Name != null">
        segment3_name = #{segment3Name,jdbcType=VARCHAR},
      </if>
      <if test="segment4Name != null">
        segment4_name = #{segment4Name,jdbcType=VARCHAR},
      </if>
      <if test="segment5Name != null">
        segment5_name = #{segment5Name,jdbcType=VARCHAR},
      </if>
      <if test="segment6Name != null">
        segment6_name = #{segment6Name,jdbcType=VARCHAR},
      </if>
      <if test="segment7Name != null">
        segment7_name = #{segment7Name,jdbcType=VARCHAR},
      </if>
      <if test="segment8Name != null">
        segment8_name = #{segment8Name,jdbcType=VARCHAR},
      </if>
      <if test="segment9Name != null">
        segment9_name = #{segment9Name,jdbcType=VARCHAR},
      </if>
      <if test="segment10Name != null">
        segment10_name = #{segment10Name,jdbcType=VARCHAR},
      </if>
      <if test="periodDrBeq != null">
        period_dr_beq = #{periodDrBeq,jdbcType=DECIMAL},
      </if>
      <if test="periodCrBeq != null">
        period_cr_beq = #{periodCrBeq,jdbcType=DECIMAL},
      </if>
      <if test="endBalBeq != null">
        end_bal_beq = #{endBalBeq,jdbcType=DECIMAL},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="updateTime != null">
        update_time = #{updateTime,jdbcType=TIMESTAMP},
      </if>
      <if test="tmsPeriod != null">
        tms_period = #{tmsPeriod,jdbcType=INTEGER},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.vat.entity.AdjustmentTable">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update adjustment_table
    set organization_id = #{organizationId,jdbcType=VARCHAR},
      project_id = #{projectId,jdbcType=VARCHAR},
      period = #{period,jdbcType=INTEGER},
      segment1 = #{segment1,jdbcType=VARCHAR},
      segment2 = #{segment2,jdbcType=VARCHAR},
      segment3 = #{segment3,jdbcType=VARCHAR},
      segment4 = #{segment4,jdbcType=VARCHAR},
      segment5 = #{segment5,jdbcType=VARCHAR},
      segment6 = #{segment6,jdbcType=VARCHAR},
      segment7 = #{segment7,jdbcType=VARCHAR},
      segment8 = #{segment8,jdbcType=VARCHAR},
      segment9 = #{segment9,jdbcType=VARCHAR},
      segment10 = #{segment10,jdbcType=VARCHAR},
      segment1_name = #{segment1Name,jdbcType=VARCHAR},
      segment2_name = #{segment2Name,jdbcType=VARCHAR},
      segment3_name = #{segment3Name,jdbcType=VARCHAR},
      segment4_name = #{segment4Name,jdbcType=VARCHAR},
      segment5_name = #{segment5Name,jdbcType=VARCHAR},
      segment6_name = #{segment6Name,jdbcType=VARCHAR},
      segment7_name = #{segment7Name,jdbcType=VARCHAR},
      segment8_name = #{segment8Name,jdbcType=VARCHAR},
      segment9_name = #{segment9Name,jdbcType=VARCHAR},
      segment10_name = #{segment10Name,jdbcType=VARCHAR},
      period_dr_beq = #{periodDrBeq,jdbcType=DECIMAL},
      period_cr_beq = #{periodCrBeq,jdbcType=DECIMAL},
      end_bal_beq = #{endBalBeq,jdbcType=DECIMAL},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      update_time = #{updateTime,jdbcType=TIMESTAMP},
      tms_period = #{tmsPeriod,jdbcType=INTEGER}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.AdjustmentTableExample" 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 adjustment_table
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>


  <select id="selectBeforeAdjustData" parameterType="java.util.Map" resultType="pwc.taxtech.atms.vat.entity.AdjustmentTable">
      SELECT
      max(CASE #{period}
    WHEN 0 THEN
    0
    ELSE
    (
    t.period_dr_beq - t.period_cr_beq
    ) END )
       periodDrMixCr,
    max(t.period),
    max(t.project_id),
    t.segment3,
    t.segment5,
    t.segment6
FROM
	adjustment_table t
WHERE
    1 = 1
    <if test="projectId!= '' and projectId != null">
     and  t.project_id = #{projectId}
    </if>
    <if test="period !=null and period != '' ">
      AND substring(t.period, -2) = ${period}
    </if>
    group by t.segment3, t.segment5, t.segment6

  </select>

  <select id="selectByCondition" parameterType="pwc.taxtech.atms.vat.dpo.AdjustmentTableCondition" resultMap="BaseResultMap">
    SELECT
    ad.*
    FROM
    adjustment_table ad
    WHERE
    <include refid="QueryCondition"/>
  </select>

</mapper>