<?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.OutputVATInvoiceItemMapper">
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.OutputVATInvoiceItem">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="ItemID" jdbcType="VARCHAR" property="itemID" />
    <result column="InvoiceID" jdbcType="VARCHAR" property="invoiceID" />
    <result column="CodeVersion" jdbcType="VARCHAR" property="codeVersion" />
    <result column="ProductName" jdbcType="VARCHAR" property="productName" />
    <result column="DocumentNum" jdbcType="VARCHAR" property="documentNum" />
    <result column="ProductStandard" jdbcType="VARCHAR" property="productStandard" />
    <result column="Unit" jdbcType="VARCHAR" property="unit" />
    <result column="Quantity" jdbcType="INTEGER" property="quantity" />
    <result column="UnitPrice" jdbcType="DOUBLE" property="unitPrice" />
    <result column="Amount" jdbcType="DECIMAL" property="amount" />
    <result column="TaxRate" jdbcType="DECIMAL" property="taxRate" />
    <result column="TaxAmount" jdbcType="DECIMAL" property="taxAmount" />
    <result column="SeqNo" jdbcType="INTEGER" property="seqNo" />
    <result column="TaxClassCode" jdbcType="VARCHAR" property="taxClassCode" />
    <result column="CreatorID" jdbcType="VARCHAR" property="creatorID" />
    <result column="CreateTime" jdbcType="TIMESTAMP" property="createTime" />
    <result column="PeriodID" jdbcType="INTEGER" property="periodID" />
  </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.
    -->
    ItemID, InvoiceID, CodeVersion, ProductName, DocumentNum, ProductStandard, Unit, 
    Quantity, UnitPrice, Amount, TaxRate, TaxAmount, SeqNo, TaxClassCode, CreatorID, 
    CreateTime, PeriodID
  </sql>
  <select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoiceItemExample" 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 OutputVATInvoiceItem
    <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 OutputVATInvoiceItem
    where ItemID = #{itemID,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 OutputVATInvoiceItem
    where ItemID = #{itemID,jdbcType=VARCHAR}
  </delete>
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoiceItemExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from OutputVATInvoiceItem
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoiceItem">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into OutputVATInvoiceItem (ItemID, InvoiceID, CodeVersion, 
      ProductName, DocumentNum, ProductStandard, 
      Unit, Quantity, UnitPrice, 
      Amount, TaxRate, TaxAmount, 
      SeqNo, TaxClassCode, CreatorID, 
      CreateTime, PeriodID)
    values (#{itemID,jdbcType=VARCHAR}, #{invoiceID,jdbcType=VARCHAR}, #{codeVersion,jdbcType=VARCHAR}, 
      #{productName,jdbcType=VARCHAR}, #{documentNum,jdbcType=VARCHAR}, #{productStandard,jdbcType=VARCHAR}, 
      #{unit,jdbcType=VARCHAR}, #{quantity,jdbcType=INTEGER}, #{unitPrice,jdbcType=DOUBLE}, 
      #{amount,jdbcType=DECIMAL}, #{taxRate,jdbcType=DECIMAL}, #{taxAmount,jdbcType=DECIMAL}, 
      #{seqNo,jdbcType=INTEGER}, #{taxClassCode,jdbcType=VARCHAR}, #{creatorID,jdbcType=VARCHAR}, 
      #{createTime,jdbcType=TIMESTAMP}, #{periodID,jdbcType=INTEGER})
  </insert>
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoiceItem">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into OutputVATInvoiceItem
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="itemID != null">
        ItemID,
      </if>
      <if test="invoiceID != null">
        InvoiceID,
      </if>
      <if test="codeVersion != null">
        CodeVersion,
      </if>
      <if test="productName != null">
        ProductName,
      </if>
      <if test="documentNum != null">
        DocumentNum,
      </if>
      <if test="productStandard != null">
        ProductStandard,
      </if>
      <if test="unit != null">
        Unit,
      </if>
      <if test="quantity != null">
        Quantity,
      </if>
      <if test="unitPrice != null">
        UnitPrice,
      </if>
      <if test="amount != null">
        Amount,
      </if>
      <if test="taxRate != null">
        TaxRate,
      </if>
      <if test="taxAmount != null">
        TaxAmount,
      </if>
      <if test="seqNo != null">
        SeqNo,
      </if>
      <if test="taxClassCode != null">
        TaxClassCode,
      </if>
      <if test="creatorID != null">
        CreatorID,
      </if>
      <if test="createTime != null">
        CreateTime,
      </if>
      <if test="periodID != null">
        PeriodID,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="itemID != null">
        #{itemID,jdbcType=VARCHAR},
      </if>
      <if test="invoiceID != null">
        #{invoiceID,jdbcType=VARCHAR},
      </if>
      <if test="codeVersion != null">
        #{codeVersion,jdbcType=VARCHAR},
      </if>
      <if test="productName != null">
        #{productName,jdbcType=VARCHAR},
      </if>
      <if test="documentNum != null">
        #{documentNum,jdbcType=VARCHAR},
      </if>
      <if test="productStandard != null">
        #{productStandard,jdbcType=VARCHAR},
      </if>
      <if test="unit != null">
        #{unit,jdbcType=VARCHAR},
      </if>
      <if test="quantity != null">
        #{quantity,jdbcType=INTEGER},
      </if>
      <if test="unitPrice != null">
        #{unitPrice,jdbcType=DOUBLE},
      </if>
      <if test="amount != null">
        #{amount,jdbcType=DECIMAL},
      </if>
      <if test="taxRate != null">
        #{taxRate,jdbcType=DECIMAL},
      </if>
      <if test="taxAmount != null">
        #{taxAmount,jdbcType=DECIMAL},
      </if>
      <if test="seqNo != null">
        #{seqNo,jdbcType=INTEGER},
      </if>
      <if test="taxClassCode != null">
        #{taxClassCode,jdbcType=VARCHAR},
      </if>
      <if test="creatorID != null">
        #{creatorID,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="periodID != null">
        #{periodID,jdbcType=INTEGER},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoiceItemExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from OutputVATInvoiceItem
    <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 OutputVATInvoiceItem
    <set>
      <if test="record.itemID != null">
        ItemID = #{record.itemID,jdbcType=VARCHAR},
      </if>
      <if test="record.invoiceID != null">
        InvoiceID = #{record.invoiceID,jdbcType=VARCHAR},
      </if>
      <if test="record.codeVersion != null">
        CodeVersion = #{record.codeVersion,jdbcType=VARCHAR},
      </if>
      <if test="record.productName != null">
        ProductName = #{record.productName,jdbcType=VARCHAR},
      </if>
      <if test="record.documentNum != null">
        DocumentNum = #{record.documentNum,jdbcType=VARCHAR},
      </if>
      <if test="record.productStandard != null">
        ProductStandard = #{record.productStandard,jdbcType=VARCHAR},
      </if>
      <if test="record.unit != null">
        Unit = #{record.unit,jdbcType=VARCHAR},
      </if>
      <if test="record.quantity != null">
        Quantity = #{record.quantity,jdbcType=INTEGER},
      </if>
      <if test="record.unitPrice != null">
        UnitPrice = #{record.unitPrice,jdbcType=DOUBLE},
      </if>
      <if test="record.amount != null">
        Amount = #{record.amount,jdbcType=DECIMAL},
      </if>
      <if test="record.taxRate != null">
        TaxRate = #{record.taxRate,jdbcType=DECIMAL},
      </if>
      <if test="record.taxAmount != null">
        TaxAmount = #{record.taxAmount,jdbcType=DECIMAL},
      </if>
      <if test="record.seqNo != null">
        SeqNo = #{record.seqNo,jdbcType=INTEGER},
      </if>
      <if test="record.taxClassCode != null">
        TaxClassCode = #{record.taxClassCode,jdbcType=VARCHAR},
      </if>
      <if test="record.creatorID != null">
        CreatorID = #{record.creatorID,jdbcType=VARCHAR},
      </if>
      <if test="record.createTime != null">
        CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="record.periodID != null">
        PeriodID = #{record.periodID,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 OutputVATInvoiceItem
    set ItemID = #{record.itemID,jdbcType=VARCHAR},
      InvoiceID = #{record.invoiceID,jdbcType=VARCHAR},
      CodeVersion = #{record.codeVersion,jdbcType=VARCHAR},
      ProductName = #{record.productName,jdbcType=VARCHAR},
      DocumentNum = #{record.documentNum,jdbcType=VARCHAR},
      ProductStandard = #{record.productStandard,jdbcType=VARCHAR},
      Unit = #{record.unit,jdbcType=VARCHAR},
      Quantity = #{record.quantity,jdbcType=INTEGER},
      UnitPrice = #{record.unitPrice,jdbcType=DOUBLE},
      Amount = #{record.amount,jdbcType=DECIMAL},
      TaxRate = #{record.taxRate,jdbcType=DECIMAL},
      TaxAmount = #{record.taxAmount,jdbcType=DECIMAL},
      SeqNo = #{record.seqNo,jdbcType=INTEGER},
      TaxClassCode = #{record.taxClassCode,jdbcType=VARCHAR},
      CreatorID = #{record.creatorID,jdbcType=VARCHAR},
      CreateTime = #{record.createTime,jdbcType=TIMESTAMP},
      PeriodID = #{record.periodID,jdbcType=INTEGER}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <update id="updateByPrimaryKeySelective" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoiceItem">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update OutputVATInvoiceItem
    <set>
      <if test="invoiceID != null">
        InvoiceID = #{invoiceID,jdbcType=VARCHAR},
      </if>
      <if test="codeVersion != null">
        CodeVersion = #{codeVersion,jdbcType=VARCHAR},
      </if>
      <if test="productName != null">
        ProductName = #{productName,jdbcType=VARCHAR},
      </if>
      <if test="documentNum != null">
        DocumentNum = #{documentNum,jdbcType=VARCHAR},
      </if>
      <if test="productStandard != null">
        ProductStandard = #{productStandard,jdbcType=VARCHAR},
      </if>
      <if test="unit != null">
        Unit = #{unit,jdbcType=VARCHAR},
      </if>
      <if test="quantity != null">
        Quantity = #{quantity,jdbcType=INTEGER},
      </if>
      <if test="unitPrice != null">
        UnitPrice = #{unitPrice,jdbcType=DOUBLE},
      </if>
      <if test="amount != null">
        Amount = #{amount,jdbcType=DECIMAL},
      </if>
      <if test="taxRate != null">
        TaxRate = #{taxRate,jdbcType=DECIMAL},
      </if>
      <if test="taxAmount != null">
        TaxAmount = #{taxAmount,jdbcType=DECIMAL},
      </if>
      <if test="seqNo != null">
        SeqNo = #{seqNo,jdbcType=INTEGER},
      </if>
      <if test="taxClassCode != null">
        TaxClassCode = #{taxClassCode,jdbcType=VARCHAR},
      </if>
      <if test="creatorID != null">
        CreatorID = #{creatorID,jdbcType=VARCHAR},
      </if>
      <if test="createTime != null">
        CreateTime = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="periodID != null">
        PeriodID = #{periodID,jdbcType=INTEGER},
      </if>
    </set>
    where ItemID = #{itemID,jdbcType=VARCHAR}
  </update>
  <update id="updateByPrimaryKey" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoiceItem">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update OutputVATInvoiceItem
    set InvoiceID = #{invoiceID,jdbcType=VARCHAR},
      CodeVersion = #{codeVersion,jdbcType=VARCHAR},
      ProductName = #{productName,jdbcType=VARCHAR},
      DocumentNum = #{documentNum,jdbcType=VARCHAR},
      ProductStandard = #{productStandard,jdbcType=VARCHAR},
      Unit = #{unit,jdbcType=VARCHAR},
      Quantity = #{quantity,jdbcType=INTEGER},
      UnitPrice = #{unitPrice,jdbcType=DOUBLE},
      Amount = #{amount,jdbcType=DECIMAL},
      TaxRate = #{taxRate,jdbcType=DECIMAL},
      TaxAmount = #{taxAmount,jdbcType=DECIMAL},
      SeqNo = #{seqNo,jdbcType=INTEGER},
      TaxClassCode = #{taxClassCode,jdbcType=VARCHAR},
      CreatorID = #{creatorID,jdbcType=VARCHAR},
      CreateTime = #{createTime,jdbcType=TIMESTAMP},
      PeriodID = #{periodID,jdbcType=INTEGER}
    where ItemID = #{itemID,jdbcType=VARCHAR}
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.OutputVATInvoiceItemExample" 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 OutputVATInvoiceItem
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>