<?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.TpBillOrderMapper" >
  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpBillOrder" >
    <id column="id" property="id" jdbcType="INTEGER" />
    <result column="community_id" property="communityId" jdbcType="INTEGER" />
    <result column="tp_bill_id" property="tpBillId" jdbcType="INTEGER" />
    <result column="tp_bill_invoice_id" property="tpBillInvoiceId" jdbcType="INTEGER" />
    <result column="order_bumber" property="orderBumber" jdbcType="VARCHAR" />
    <result column="create_user" property="createUser" jdbcType="INTEGER" />
    <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
    <result column="update_user" property="updateUser" jdbcType="INTEGER" />
    <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
    <result column="order_status" property="orderStatus" jdbcType="CHAR" />
    <result column="pay_phone" property="payPhone" jdbcType="VARCHAR" />
  </resultMap>
  <sql id="Base_Column_List" >
    id, community_id, tp_bill_id, tp_bill_invoice_id, order_bumber, create_user, create_date,
    update_user, update_date, order_status, pay_phone
  </sql>
  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
    select
    <include refid="Base_Column_List" />
    from tp_bill_order
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from tp_bill_order
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.community.huiju.model.TpBillOrder" >
    insert into tp_bill_order (id, community_id, tp_bill_id,
      tp_bill_invoice_id, order_bumber, create_user,
      create_date, update_user, update_date,
      order_status, pay_phone)
    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{tpBillId,jdbcType=INTEGER},
      #{tpBillInvoiceId,jdbcType=INTEGER}, #{orderBumber,jdbcType=VARCHAR}, #{createUser,jdbcType=INTEGER},
      #{createDate,jdbcType=TIMESTAMP}, #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP},
      #{orderStatus,jdbcType=CHAR}, #{payPhone,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.community.huiju.model.TpBillOrder" >
    insert into tp_bill_order
    <trim prefix="(" suffix=")" suffixOverrides="," >
      <if test="id != null" >
        id,
      </if>
      <if test="communityId != null" >
        community_id,
      </if>
      <if test="tpBillId != null" >
        tp_bill_id,
      </if>
      <if test="tpBillInvoiceId != null" >
        tp_bill_invoice_id,
      </if>
      <if test="orderBumber != null" >
        order_bumber,
      </if>
      <if test="createUser != null" >
        create_user,
      </if>
      <if test="createDate != null" >
        create_date,
      </if>
      <if test="updateUser != null" >
        update_user,
      </if>
      <if test="updateDate != null" >
        update_date,
      </if>
      <if test="orderStatus != null" >
        order_status,
      </if>
      <if test="payPhone != null" >
        pay_phone,
      </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="tpBillId != null" >
        #{tpBillId,jdbcType=INTEGER},
      </if>
      <if test="tpBillInvoiceId != null" >
        #{tpBillInvoiceId,jdbcType=INTEGER},
      </if>
      <if test="orderBumber != null" >
        #{orderBumber,jdbcType=VARCHAR},
      </if>
      <if test="createUser != null" >
        #{createUser,jdbcType=INTEGER},
      </if>
      <if test="createDate != null" >
        #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUser != null" >
        #{updateUser,jdbcType=INTEGER},
      </if>
      <if test="updateDate != null" >
        #{updateDate,jdbcType=TIMESTAMP},
      </if>
      <if test="orderStatus != null" >
        #{orderStatus,jdbcType=CHAR},
      </if>
      <if test="payPhone != null" >
        #{payPhone,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpBillOrder" >
    update tp_bill_order
    <set >
      <if test="communityId != null" >
        community_id = #{communityId,jdbcType=INTEGER},
      </if>
      <if test="tpBillId != null" >
        tp_bill_id = #{tpBillId,jdbcType=INTEGER},
      </if>
      <if test="tpBillInvoiceId != null" >
        tp_bill_invoice_id = #{tpBillInvoiceId,jdbcType=INTEGER},
      </if>
      <if test="orderBumber != null" >
        order_bumber = #{orderBumber,jdbcType=VARCHAR},
      </if>
      <if test="createUser != null" >
        create_user = #{createUser,jdbcType=INTEGER},
      </if>
      <if test="createDate != null" >
        create_date = #{createDate,jdbcType=TIMESTAMP},
      </if>
      <if test="updateUser != null" >
        update_user = #{updateUser,jdbcType=INTEGER},
      </if>
      <if test="updateDate != null" >
        update_date = #{updateDate,jdbcType=TIMESTAMP},
      </if>
      <if test="orderStatus != null" >
        order_status = #{orderStatus,jdbcType=CHAR},
      </if>
      <if test="payPhone != null" >
        pay_phone = #{payPhone,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpBillOrder" >
    update tp_bill_order
    set community_id = #{communityId,jdbcType=INTEGER},
      tp_bill_id = #{tpBillId,jdbcType=INTEGER},
      tp_bill_invoice_id = #{tpBillInvoiceId,jdbcType=INTEGER},
      order_bumber = #{orderBumber,jdbcType=VARCHAR},
      create_user = #{createUser,jdbcType=INTEGER},
      create_date = #{createDate,jdbcType=TIMESTAMP},
      update_user = #{updateUser,jdbcType=INTEGER},
      update_date = #{updateDate,jdbcType=TIMESTAMP},
      order_status = #{orderStatus,jdbcType=CHAR},
      pay_phone = #{payPhone,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
  <insert id="batchInsertSelective" parameterType="list" >
    insert into tp_bill_order
    values
    <foreach collection="list" index="index" item="item"  separator="," >
        <trim suffixOverrides="," suffix="(" prefix=")">
          <if test="item.id != null">
            #{item.id,jdbcType=INTEGER},
          </if>
          <if test="item.communityId != null">
            #{item.communityId,jdbcType=INTEGER},
          </if>
          <if test="item.tpBillId != null">
            #{item.tpBillId,jdbcType=INTEGER},
          </if>
          <if test="item.tpBillInvoiceId != null">
            #{item.tpBillInvoiceId,jdbcType=INTEGER},
          </if>
          <if test="item.orderBumber != null">
            #{item.orderBumber,jdbcType=VARCHAR},
          </if>
          <if test="item.createUser != null">
            #{item.createUser,jdbcType=INTEGER},
          </if>
          <if test="item.createDate != null">
            #{item.createDate,jdbcType=TIMESTAMP},
          </if>
          <if test="item.updateUser != null">
            #{item.updateUser,jdbcType=INTEGER},
          </if>
          <if test="item.updateDate != null">
            #{item.updateDate,jdbcType=TIMESTAMP},
          </if>
          <if test="orderStatus != null">
            #{orderStatus,jdbcType=VARCHAR},
          </if>
          <if test="payPhone != null">
            #{payPhone,jdbcType=VARCHAR}
          </if>
        </trim>
    </foreach>
  </insert>
</mapper>