<?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="com.goafanti.common.dao.PatentYearPaymentMapper">
  <resultMap id="BaseResultMap" type="com.goafanti.common.model.PatentYearPayment">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Aug 06 15:52:32 CST 2021.
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="type" jdbcType="INTEGER" property="type" />
    <result column="year" jdbcType="INTEGER" property="year" />
    <result column="patent_amount" jdbcType="DECIMAL" property="patentAmount" />
    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
    <result column="reduction_amount" jdbcType="DECIMAL" property="reductionAmount" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Aug 06 15:52:32 CST 2021.
    -->
    id, `type`, `year`, patent_amount, create_time, reduction_amount
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Aug 06 15:52:32 CST 2021.
    -->
    select 
    <include refid="Base_Column_List" />
    from patent_year_payment
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Aug 06 15:52:32 CST 2021.
    -->
    delete from patent_year_payment
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.goafanti.common.model.PatentYearPayment">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Aug 06 15:52:32 CST 2021.
    -->
    insert into patent_year_payment (id, `type`, `year`, 
      patent_amount, create_time, reduction_amount
      )
    values (#{id,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{year,jdbcType=INTEGER}, 
      #{patentAmount,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{reductionAmount,jdbcType=DECIMAL}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.goafanti.common.model.PatentYearPayment">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Aug 06 15:52:32 CST 2021.
    -->
    insert into patent_year_payment
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="type != null">
        `type`,
      </if>
      <if test="year != null">
        `year`,
      </if>
      <if test="patentAmount != null">
        patent_amount,
      </if>
      <if test="createTime != null">
        create_time,
      </if>
      <if test="reductionAmount != null">
        reduction_amount,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=INTEGER},
      </if>
      <if test="type != null">
        #{type,jdbcType=INTEGER},
      </if>
      <if test="year != null">
        #{year,jdbcType=INTEGER},
      </if>
      <if test="patentAmount != null">
        #{patentAmount,jdbcType=DECIMAL},
      </if>
      <if test="createTime != null">
        #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="reductionAmount != null">
        #{reductionAmount,jdbcType=DECIMAL},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.PatentYearPayment">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Aug 06 15:52:32 CST 2021.
    -->
    update patent_year_payment
    <set>
      <if test="type != null">
        `type` = #{type,jdbcType=INTEGER},
      </if>
      <if test="year != null">
        `year` = #{year,jdbcType=INTEGER},
      </if>
      <if test="patentAmount != null">
        patent_amount = #{patentAmount,jdbcType=DECIMAL},
      </if>
      <if test="createTime != null">
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
      <if test="reductionAmount != null">
        reduction_amount = #{reductionAmount,jdbcType=DECIMAL},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.PatentYearPayment">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
      This element was generated on Fri Aug 06 15:52:32 CST 2021.
    -->
    update patent_year_payment
    set `type` = #{type,jdbcType=INTEGER},
      `year` = #{year,jdbcType=INTEGER},
      patent_amount = #{patentAmount,jdbcType=DECIMAL},
      create_time = #{createTime,jdbcType=TIMESTAMP},
      reduction_amount = #{reductionAmount,jdbcType=DECIMAL}
    where id = #{id,jdbcType=INTEGER}
  </update>
  
    <select id="selectAll" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from patent_year_payment
    where 1=1
  </select>
</mapper>