<?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.usoft.fin.grpc.dal.mapper.DrawApplyOrderAcceptMapper">
  <resultMap id="BaseResultMap" type="com.usoft.fin.grpc.dal.entity.DrawApplyOrderAccept">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="draw_code" jdbcType="VARCHAR" property="drawCode" />
    <result column="accept_id" jdbcType="INTEGER" property="acceptId" />
    <result column="accept_code" jdbcType="VARCHAR" property="acceptCode" />
    <result column="accept_date" jdbcType="VARCHAR" property="acceptDate" />
    <result column="accept_amount" jdbcType="DOUBLE" property="acceptAmount" />
    <result column="accept_status" jdbcType="VARCHAR" property="acceptStatus" />
    <result column="order_item_id" jdbcType="INTEGER" property="orderItemId" />
    <result column="product_code" jdbcType="VARCHAR" property="productCode" />
    <result column="product_title" jdbcType="VARCHAR" property="productTitle" />
    <result column="product_spec" jdbcType="VARCHAR" property="productSpec" />
    <result column="product_cmpcode" jdbcType="VARCHAR" property="productCmpcode" />
    <result column="order_id" jdbcType="INTEGER" property="orderId" />
    <result column="order_code" jdbcType="VARCHAR" property="orderCode" />
    <result column="cust_name" jdbcType="VARCHAR" property="custName" />
    <result column="order_total" jdbcType="INTEGER" property="orderTotal" />
    <result column="order_date" jdbcType="VARCHAR" property="orderDate" />
  </resultMap>
  <sql id="Base_Column_List">
    id, draw_code, accept_id, accept_code, accept_date, accept_amount, accept_status, 
    order_item_id, product_code, product_title, product_spec, product_cmpcode, order_id, 
    order_code, cust_name, order_total, order_date
  </sql>
  <sql id="Table_Base_Column_List">
    t_draw_apply_order_accept.id, t_draw_apply_order_accept.draw_code, t_draw_apply_order_accept.accept_id, 
    t_draw_apply_order_accept.accept_code, t_draw_apply_order_accept.accept_date, t_draw_apply_order_accept.accept_amount, 
    t_draw_apply_order_accept.accept_status, t_draw_apply_order_accept.order_item_id, 
    t_draw_apply_order_accept.product_code, t_draw_apply_order_accept.product_title, 
    t_draw_apply_order_accept.product_spec, t_draw_apply_order_accept.product_cmpcode, 
    t_draw_apply_order_accept.order_id, t_draw_apply_order_accept.order_code, t_draw_apply_order_accept.cust_name, 
    t_draw_apply_order_accept.order_total, t_draw_apply_order_accept.order_date
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
    select 
    <include refid="Base_Column_List" />
    from t_draw_apply_order_accept
    where id = #{id,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from t_draw_apply_order_accept
    where id = #{id,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.usoft.fin.grpc.dal.entity.DrawApplyOrderAccept">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_draw_apply_order_accept (draw_code, accept_id, accept_code, 
      accept_date, accept_amount, accept_status, 
      order_item_id, product_code, product_title, 
      product_spec, product_cmpcode, order_id, 
      order_code, cust_name, order_total, 
      order_date)
    values (#{drawCode,jdbcType=VARCHAR}, #{acceptId,jdbcType=INTEGER}, #{acceptCode,jdbcType=VARCHAR}, 
      #{acceptDate,jdbcType=VARCHAR}, #{acceptAmount,jdbcType=DOUBLE}, #{acceptStatus,jdbcType=VARCHAR}, 
      #{orderItemId,jdbcType=INTEGER}, #{productCode,jdbcType=VARCHAR}, #{productTitle,jdbcType=VARCHAR}, 
      #{productSpec,jdbcType=VARCHAR}, #{productCmpcode,jdbcType=VARCHAR}, #{orderId,jdbcType=INTEGER}, 
      #{orderCode,jdbcType=VARCHAR}, #{custName,jdbcType=VARCHAR}, #{orderTotal,jdbcType=INTEGER}, 
      #{orderDate,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.usoft.fin.grpc.dal.entity.DrawApplyOrderAccept">
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into t_draw_apply_order_accept
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="drawCode != null">
        draw_code,
      </if>
      <if test="acceptId != null">
        accept_id,
      </if>
      <if test="acceptCode != null">
        accept_code,
      </if>
      <if test="acceptDate != null">
        accept_date,
      </if>
      <if test="acceptAmount != null">
        accept_amount,
      </if>
      <if test="acceptStatus != null">
        accept_status,
      </if>
      <if test="orderItemId != null">
        order_item_id,
      </if>
      <if test="productCode != null">
        product_code,
      </if>
      <if test="productTitle != null">
        product_title,
      </if>
      <if test="productSpec != null">
        product_spec,
      </if>
      <if test="productCmpcode != null">
        product_cmpcode,
      </if>
      <if test="orderId != null">
        order_id,
      </if>
      <if test="orderCode != null">
        order_code,
      </if>
      <if test="custName != null">
        cust_name,
      </if>
      <if test="orderTotal != null">
        order_total,
      </if>
      <if test="orderDate != null">
        order_date,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="drawCode != null">
        #{drawCode,jdbcType=VARCHAR},
      </if>
      <if test="acceptId != null">
        #{acceptId,jdbcType=INTEGER},
      </if>
      <if test="acceptCode != null">
        #{acceptCode,jdbcType=VARCHAR},
      </if>
      <if test="acceptDate != null">
        #{acceptDate,jdbcType=VARCHAR},
      </if>
      <if test="acceptAmount != null">
        #{acceptAmount,jdbcType=DOUBLE},
      </if>
      <if test="acceptStatus != null">
        #{acceptStatus,jdbcType=VARCHAR},
      </if>
      <if test="orderItemId != null">
        #{orderItemId,jdbcType=INTEGER},
      </if>
      <if test="productCode != null">
        #{productCode,jdbcType=VARCHAR},
      </if>
      <if test="productTitle != null">
        #{productTitle,jdbcType=VARCHAR},
      </if>
      <if test="productSpec != null">
        #{productSpec,jdbcType=VARCHAR},
      </if>
      <if test="productCmpcode != null">
        #{productCmpcode,jdbcType=VARCHAR},
      </if>
      <if test="orderId != null">
        #{orderId,jdbcType=INTEGER},
      </if>
      <if test="orderCode != null">
        #{orderCode,jdbcType=VARCHAR},
      </if>
      <if test="custName != null">
        #{custName,jdbcType=VARCHAR},
      </if>
      <if test="orderTotal != null">
        #{orderTotal,jdbcType=INTEGER},
      </if>
      <if test="orderDate != null">
        #{orderDate,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.usoft.fin.grpc.dal.entity.DrawApplyOrderAccept">
    update t_draw_apply_order_accept
    <set>
      <if test="drawCode != null">
        draw_code = #{drawCode,jdbcType=VARCHAR},
      </if>
      <if test="acceptId != null">
        accept_id = #{acceptId,jdbcType=INTEGER},
      </if>
      <if test="acceptCode != null">
        accept_code = #{acceptCode,jdbcType=VARCHAR},
      </if>
      <if test="acceptDate != null">
        accept_date = #{acceptDate,jdbcType=VARCHAR},
      </if>
      <if test="acceptAmount != null">
        accept_amount = #{acceptAmount,jdbcType=DOUBLE},
      </if>
      <if test="acceptStatus != null">
        accept_status = #{acceptStatus,jdbcType=VARCHAR},
      </if>
      <if test="orderItemId != null">
        order_item_id = #{orderItemId,jdbcType=INTEGER},
      </if>
      <if test="productCode != null">
        product_code = #{productCode,jdbcType=VARCHAR},
      </if>
      <if test="productTitle != null">
        product_title = #{productTitle,jdbcType=VARCHAR},
      </if>
      <if test="productSpec != null">
        product_spec = #{productSpec,jdbcType=VARCHAR},
      </if>
      <if test="productCmpcode != null">
        product_cmpcode = #{productCmpcode,jdbcType=VARCHAR},
      </if>
      <if test="orderId != null">
        order_id = #{orderId,jdbcType=INTEGER},
      </if>
      <if test="orderCode != null">
        order_code = #{orderCode,jdbcType=VARCHAR},
      </if>
      <if test="custName != null">
        cust_name = #{custName,jdbcType=VARCHAR},
      </if>
      <if test="orderTotal != null">
        order_total = #{orderTotal,jdbcType=INTEGER},
      </if>
      <if test="orderDate != null">
        order_date = #{orderDate,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.usoft.fin.grpc.dal.entity.DrawApplyOrderAccept">
    update t_draw_apply_order_accept
    set draw_code = #{drawCode,jdbcType=VARCHAR},
      accept_id = #{acceptId,jdbcType=INTEGER},
      accept_code = #{acceptCode,jdbcType=VARCHAR},
      accept_date = #{acceptDate,jdbcType=VARCHAR},
      accept_amount = #{acceptAmount,jdbcType=DOUBLE},
      accept_status = #{acceptStatus,jdbcType=VARCHAR},
      order_item_id = #{orderItemId,jdbcType=INTEGER},
      product_code = #{productCode,jdbcType=VARCHAR},
      product_title = #{productTitle,jdbcType=VARCHAR},
      product_spec = #{productSpec,jdbcType=VARCHAR},
      product_cmpcode = #{productCmpcode,jdbcType=VARCHAR},
      order_id = #{orderId,jdbcType=INTEGER},
      order_code = #{orderCode,jdbcType=VARCHAR},
      cust_name = #{custName,jdbcType=VARCHAR},
      order_total = #{orderTotal,jdbcType=INTEGER},
      order_date = #{orderDate,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
  </update>
</mapper>