<?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.invoice.InputInvoiceDetailMapper">
  <resultMap id="BaseResultMap" type="pwc.taxtech.atms.vat.entity.InputInvoiceDetail">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <result column="ID" jdbcType="VARCHAR" property="ID" />
    <result column="FPDM" jdbcType="VARCHAR" property="FPDM" />
    <result column="FPHM" jdbcType="VARCHAR" property="FPHM" />
    <result column="SPMC" jdbcType="VARCHAR" property="SPMC" />
    <result column="GGXH" jdbcType="VARCHAR" property="GGXH" />
    <result column="DW" jdbcType="VARCHAR" property="DW" />
    <result column="DJ" jdbcType="VARCHAR" property="DJ" />
    <result column="SPSL" jdbcType="VARCHAR" property="SPSL" />
    <result column="JE" jdbcType="VARCHAR" property="JE" />
    <result column="SLV" jdbcType="VARCHAR" property="SLV" />
    <result column="SE" jdbcType="VARCHAR" property="SE" />
    <result column="FPID" jdbcType="VARCHAR" property="FPID" />
  </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, FPDM, FPHM, SPMC, GGXH, DW, DJ, SPSL, JE, SLV, SE, FPID
  </sql>
  <select id="selectByExample" parameterType="pwc.taxtech.atms.vat.entity.InputInvoiceDetailExample" 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 INPUT_INVOICE_DETAIL
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
  <delete id="deleteByExample" parameterType="pwc.taxtech.atms.vat.entity.InputInvoiceDetailExample">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from INPUT_INVOICE_DETAIL
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
  </delete>
  <insert id="insert" parameterType="pwc.taxtech.atms.vat.entity.InputInvoiceDetail">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into INPUT_INVOICE_DETAIL (ID, FPDM, FPHM, 
      SPMC, GGXH, DW, DJ, 
      SPSL, JE, SLV, SE, 
      FPID)
    values (#{ID,jdbcType=VARCHAR}, #{FPDM,jdbcType=VARCHAR}, #{FPHM,jdbcType=VARCHAR}, 
      #{SPMC,jdbcType=VARCHAR}, #{GGXH,jdbcType=VARCHAR}, #{DW,jdbcType=VARCHAR}, #{DJ,jdbcType=VARCHAR}, 
      #{SPSL,jdbcType=VARCHAR}, #{JE,jdbcType=VARCHAR}, #{SLV,jdbcType=VARCHAR}, #{SE,jdbcType=VARCHAR}, 
      #{FPID,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="pwc.taxtech.atms.vat.entity.InputInvoiceDetail">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    insert into INPUT_INVOICE_DETAIL
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="ID != null">
        ID,
      </if>
      <if test="FPDM != null">
        FPDM,
      </if>
      <if test="FPHM != null">
        FPHM,
      </if>
      <if test="SPMC != null">
        SPMC,
      </if>
      <if test="GGXH != null">
        GGXH,
      </if>
      <if test="DW != null">
        DW,
      </if>
      <if test="DJ != null">
        DJ,
      </if>
      <if test="SPSL != null">
        SPSL,
      </if>
      <if test="JE != null">
        JE,
      </if>
      <if test="SLV != null">
        SLV,
      </if>
      <if test="SE != null">
        SE,
      </if>
      <if test="FPID != null">
        FPID,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="ID != null">
        #{ID,jdbcType=VARCHAR},
      </if>
      <if test="FPDM != null">
        #{FPDM,jdbcType=VARCHAR},
      </if>
      <if test="FPHM != null">
        #{FPHM,jdbcType=VARCHAR},
      </if>
      <if test="SPMC != null">
        #{SPMC,jdbcType=VARCHAR},
      </if>
      <if test="GGXH != null">
        #{GGXH,jdbcType=VARCHAR},
      </if>
      <if test="DW != null">
        #{DW,jdbcType=VARCHAR},
      </if>
      <if test="DJ != null">
        #{DJ,jdbcType=VARCHAR},
      </if>
      <if test="SPSL != null">
        #{SPSL,jdbcType=VARCHAR},
      </if>
      <if test="JE != null">
        #{JE,jdbcType=VARCHAR},
      </if>
      <if test="SLV != null">
        #{SLV,jdbcType=VARCHAR},
      </if>
      <if test="SE != null">
        #{SE,jdbcType=VARCHAR},
      </if>
      <if test="FPID != null">
        #{FPID,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <select id="countByExample" parameterType="pwc.taxtech.atms.vat.entity.InputInvoiceDetailExample" resultType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select count(*) from INPUT_INVOICE_DETAIL
    <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 INPUT_INVOICE_DETAIL
    <set>
      <if test="record.ID != null">
        ID = #{record.ID,jdbcType=VARCHAR},
      </if>
      <if test="record.FPDM != null">
        FPDM = #{record.FPDM,jdbcType=VARCHAR},
      </if>
      <if test="record.FPHM != null">
        FPHM = #{record.FPHM,jdbcType=VARCHAR},
      </if>
      <if test="record.SPMC != null">
        SPMC = #{record.SPMC,jdbcType=VARCHAR},
      </if>
      <if test="record.GGXH != null">
        GGXH = #{record.GGXH,jdbcType=VARCHAR},
      </if>
      <if test="record.DW != null">
        DW = #{record.DW,jdbcType=VARCHAR},
      </if>
      <if test="record.DJ != null">
        DJ = #{record.DJ,jdbcType=VARCHAR},
      </if>
      <if test="record.SPSL != null">
        SPSL = #{record.SPSL,jdbcType=VARCHAR},
      </if>
      <if test="record.JE != null">
        JE = #{record.JE,jdbcType=VARCHAR},
      </if>
      <if test="record.SLV != null">
        SLV = #{record.SLV,jdbcType=VARCHAR},
      </if>
      <if test="record.SE != null">
        SE = #{record.SE,jdbcType=VARCHAR},
      </if>
      <if test="record.FPID != null">
        FPID = #{record.FPID,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 INPUT_INVOICE_DETAIL
    set ID = #{record.ID,jdbcType=VARCHAR},
      FPDM = #{record.FPDM,jdbcType=VARCHAR},
      FPHM = #{record.FPHM,jdbcType=VARCHAR},
      SPMC = #{record.SPMC,jdbcType=VARCHAR},
      GGXH = #{record.GGXH,jdbcType=VARCHAR},
      DW = #{record.DW,jdbcType=VARCHAR},
      DJ = #{record.DJ,jdbcType=VARCHAR},
      SPSL = #{record.SPSL,jdbcType=VARCHAR},
      JE = #{record.JE,jdbcType=VARCHAR},
      SLV = #{record.SLV,jdbcType=VARCHAR},
      SE = #{record.SE,jdbcType=VARCHAR},
      FPID = #{record.FPID,jdbcType=VARCHAR}
    <if test="_parameter != null">
      <include refid="Update_By_Example_Where_Clause" />
    </if>
  </update>
  <select id="selectByExampleWithRowbounds" parameterType="pwc.taxtech.atms.vat.entity.InputInvoiceDetailExample" 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 INPUT_INVOICE_DETAIL
    <if test="_parameter != null">
      <include refid="Example_Where_Clause" />
    </if>
    <if test="orderByClause != null">
      order by ${orderByClause}
    </if>
  </select>
</mapper>