<?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.community.huiju.dao.TpBillStatementMapper" >
  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpBillStatement" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="community_id" property="communityId" jdbcType="INTEGER" />
    <result column="bill_invoice_id" property="billInvoiceId" jdbcType="INTEGER" />
    <result column="ta_user_id" property="taUserId" jdbcType="INTEGER" />
    <result column="pay_price" property="payPrice" jdbcType="INTEGER" />
    <result column="pay_name" property="payName" jdbcType="VARCHAR" />
    <result column="pay_remark" property="payRemark" jdbcType="VARCHAR" />
    <result column="pay_type" property="payType" jdbcType="CHAR" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, community_id, bill_invoice_id, ta_user_id, pay_price, pay_name, pay_remark, pay_type, 
    create_time
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select 
    <include refid="Base_Column_List" />
    from tp_bill_statement
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from tp_bill_statement
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.community.huiju.model.TpBillStatement" useGeneratedKeys="true" keyColumn="id" keyProperty="id" >
    insert into tp_bill_statement (id, community_id, bill_invoice_id, 
      ta_user_id, pay_price, pay_name, 
      pay_remark, pay_type, create_time
      )
    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{billInvoiceId,jdbcType=INTEGER}, 
      #{taUserId,jdbcType=INTEGER}, #{payPrice,jdbcType=INTEGER}, #{payName,jdbcType=VARCHAR}, 
      #{payRemark,jdbcType=VARCHAR}, #{payType,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.community.huiju.model.TpBillStatement" >
    insert into tp_bill_statement
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="communityId != null" >
        community_id,
      </if>
      <if test="billInvoiceId != null" >
        bill_invoice_id,
      </if>
      <if test="taUserId != null" >
        ta_user_id,
      </if>
      <if test="payPrice != null" >
        pay_price,
      </if>
      <if test="payName != null" >
        pay_name,
      </if>
      <if test="payRemark != null" >
        pay_remark,
      </if>
      <if test="payType != null" >
        pay_type,
      </if>
      <if test="createTime != null" >
        create_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        #{id,jdbcType=INTEGER},
      </if>
      <if test="communityId != null" >
        #{communityId,jdbcType=INTEGER},
      </if>
      <if test="billInvoiceId != null" >
        #{billInvoiceId,jdbcType=INTEGER},
      </if>
      <if test="taUserId != null" >
        #{taUserId,jdbcType=INTEGER},
      </if>
      <if test="payPrice != null" >
        #{payPrice,jdbcType=INTEGER},
      </if>
      <if test="payName != null" >
        #{payName,jdbcType=VARCHAR},
      </if>
      <if test="payRemark != null" >
        #{payRemark,jdbcType=VARCHAR},
      </if>
      <if test="payType != null" >
        #{payType,jdbcType=CHAR},
      </if>
      <if test="createTime != null" >
        #{createTime,jdbcType=TIMESTAMP},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpBillStatement" >
    update tp_bill_statement
    <set >
      <if test="communityId != null" >
        community_id = #{communityId,jdbcType=INTEGER},
      </if>
      <if test="billInvoiceId != null" >
        bill_invoice_id = #{billInvoiceId,jdbcType=INTEGER},
      </if>
      <if test="taUserId != null" >
        ta_user_id = #{taUserId,jdbcType=INTEGER},
      </if>
      <if test="payPrice != null" >
        pay_price = #{payPrice,jdbcType=INTEGER},
      </if>
      <if test="payName != null" >
        pay_name = #{payName,jdbcType=VARCHAR},
      </if>
      <if test="payRemark != null" >
        pay_remark = #{payRemark,jdbcType=VARCHAR},
      </if>
      <if test="payType != null" >
        pay_type = #{payType,jdbcType=CHAR},
      </if>
      <if test="createTime != null" >
        create_time = #{createTime,jdbcType=TIMESTAMP},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpBillStatement" >
    update tp_bill_statement
    set community_id = #{communityId,jdbcType=INTEGER},
      bill_invoice_id = #{billInvoiceId,jdbcType=INTEGER},
      ta_user_id = #{taUserId,jdbcType=INTEGER},
      pay_price = #{payPrice,jdbcType=INTEGER},
      pay_name = #{payName,jdbcType=VARCHAR},
      pay_remark = #{payRemark,jdbcType=VARCHAR},
      pay_type = #{payType,jdbcType=CHAR},
      create_time = #{createTime,jdbcType=TIMESTAMP}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>