<?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.zm.order.tool.server.chen.masterMapper">
  <resultMap id="BaseResultMap" type="com.zm.order.tool.server.model.Master">
    <id column="itemID" jdbcType="INTEGER" property="itemid" />
    <result column="groupID" jdbcType="BIGINT" property="groupid" />
    <result column="brandID" jdbcType="BIGINT" property="brandid" />
    <result column="shopID" jdbcType="BIGINT" property="shopid" />
    <result column="shopName" jdbcType="VARCHAR" property="shopname" />
    <result column="reportDate" jdbcType="DATE" property="reportdate" />
    <result column="saasOrderKey" jdbcType="VARCHAR" property="saasorderkey" />
    <result column="saasOrderNo" jdbcType="VARCHAR" property="saasorderno" />
    <result column="saasDeviceOrderNo" jdbcType="VARCHAR" property="saasdeviceorderno" />
    <result column="timeNameStart" jdbcType="VARCHAR" property="timenamestart" />
    <result column="timeNameCheckout" jdbcType="VARCHAR" property="timenamecheckout" />
    <result column="areaName" jdbcType="VARCHAR" property="areaname" />
    <result column="tableName" jdbcType="VARCHAR" property="tablename" />
    <result column="channelKey" jdbcType="VARCHAR" property="channelkey" />
    <result column="channelName" jdbcType="VARCHAR" property="channelname" />
    <result column="channelOrderKeyTP" jdbcType="VARCHAR" property="channelorderkeytp" />
    <result column="channelOrderNo" jdbcType="VARCHAR" property="channelorderno" />
    <result column="channelOrderKey" jdbcType="VARCHAR" property="channelorderkey" />
    <result column="channelUserID" jdbcType="VARCHAR" property="channeluserid" />
    <result column="channelUserKey" jdbcType="VARCHAR" property="channeluserkey" />
    <result column="channelOrderTime" jdbcType="VARCHAR" property="channelordertime" />
    <result column="orderSubType" jdbcType="TINYINT" property="ordersubtype" />
    <result column="netOrderTypeCode" jdbcType="VARCHAR" property="netordertypecode" />
    <result column="person" jdbcType="INTEGER" property="person" />
    <result column="startTime" jdbcType="TIMESTAMP" property="starttime" />
    <result column="checkoutTime" jdbcType="TIMESTAMP" property="checkouttime" />
    <result column="orderStatus" jdbcType="TINYINT" property="orderstatus" />
    <result column="isTestOrder" jdbcType="TINYINT" property="istestorder" />
    <result column="foodCount" jdbcType="INTEGER" property="foodcount" />
    <result column="foodAmount" jdbcType="DECIMAL" property="foodamount" />
    <result column="sendFoodAmount" jdbcType="DECIMAL" property="sendfoodamount" />
    <result column="sendCouponAmount" jdbcType="DECIMAL" property="sendcouponamount" />
    <result column="sendCouponRemark" jdbcType="VARCHAR" property="sendcouponremark" />
    <result column="cardNo" jdbcType="VARCHAR" property="cardno" />
    <result column="cardKey" jdbcType="VARCHAR" property="cardkey" />
    <result column="cardTransID" jdbcType="VARCHAR" property="cardtransid" />
    <result column="customerName" jdbcType="VARCHAR" property="customername" />
    <result column="cardTransAfterRemark" jdbcType="VARCHAR" property="cardtransafterremark" />
    <result column="discountBy" jdbcType="VARCHAR" property="discountby" />
    <result column="discountWayKey" jdbcType="VARCHAR" property="discountwaykey" />
    <result column="discountWayName" jdbcType="VARCHAR" property="discountwayname" />
    <result column="discountRate" jdbcType="DECIMAL" property="discountrate" />
    <result column="discountRange" jdbcType="TINYINT" property="discountrange" />
    <result column="isVipPrice" jdbcType="TINYINT" property="isvipprice" />
    <result column="specialStatAmount" jdbcType="DECIMAL" property="specialstatamount" />
    <result column="promotionAmount" jdbcType="DECIMAL" property="promotionamount" />
    <result column="promotionDesc" jdbcType="VARCHAR" property="promotiondesc" />
    <result column="paidAmount" jdbcType="DECIMAL" property="paidamount" />
    <result column="saasOrderRemark" jdbcType="VARCHAR" property="saasorderremark" />
    <result column="actionTime" jdbcType="BIGINT" property="actiontime" />
    <result column="createTime" jdbcType="BIGINT" property="createtime" />
    <result column="deliverSource" jdbcType="TINYINT" property="deliversource" />
    <result column="deliverFee" jdbcType="DECIMAL" property="deliverfee" />
    <result column="action" jdbcType="TINYINT" property="action" />
    <result column="orderAbandonReason" jdbcType="VARCHAR" property="orderabandonreason" />
    <result column="userPayFlag" jdbcType="VARCHAR" property="userpayflag" />
    <result column="customerID" jdbcType="BIGINT" property="customerid" />
    <result column="tableLeader" jdbcType="VARCHAR" property="tableleader" />
    <result column="actionstamp" jdbcType="TIMESTAMP" property="actionstamp" />
    <result column="chargeBackFlag" jdbcType="BIT" property="chargebackflag" />
    <result column="parentOrderKey" jdbcType="VARCHAR" property="parentorderkey" />
    <result column="consumptionType" jdbcType="VARCHAR" property="consumptiontype" />
    <result column="isAdd" jdbcType="BIT" property="isadd" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.zm.order.tool.server.model.Master">
    <result column="foodNameDetail" jdbcType="LONGVARCHAR" property="foodnamedetail" />
  </resultMap>
  <sql id="Base_Column_List">
    itemID, groupID, brandID, shopID, shopName, reportDate, saasOrderKey, saasOrderNo, 
    saasDeviceOrderNo, timeNameStart, timeNameCheckout, areaName, tableName, channelKey, 
    channelName, channelOrderKeyTP, channelOrderNo, channelOrderKey, channelUserID, channelUserKey, 
    channelOrderTime, orderSubType, netOrderTypeCode, person, startTime, checkoutTime, 
    orderStatus, isTestOrder, foodCount, foodAmount, sendFoodAmount, sendCouponAmount, 
    sendCouponRemark, cardNo, cardKey, cardTransID, customerName, cardTransAfterRemark, 
    discountBy, discountWayKey, discountWayName, discountRate, discountRange, isVipPrice, 
    specialStatAmount, promotionAmount, promotionDesc, paidAmount, saasOrderRemark, actionTime, 
    createTime, deliverSource, deliverFee, action, orderAbandonReason, userPayFlag, customerID, 
    tableLeader, actionstamp, chargeBackFlag, parentOrderKey, consumptionType, isAdd
  </sql>
  <sql id="Blob_Column_List">
    foodNameDetail
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
    select 
    <include refid="Base_Column_List" />
    ,
    <include refid="Blob_Column_List" />
    from tbl_bill_master
    where itemID = #{itemid,jdbcType=INTEGER}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
    delete from tbl_bill_master
    where itemID = #{itemid,jdbcType=INTEGER}
  </delete>
  <insert id="insert" parameterType="com.zm.order.tool.server.model.Master">
    insert into tbl_bill_master (itemID, groupID, brandID,
      shopID, shopName, reportDate, 
      saasOrderKey, saasOrderNo, saasDeviceOrderNo, 
      timeNameStart, timeNameCheckout, areaName, 
      tableName, channelKey, channelName, 
      channelOrderKeyTP, channelOrderNo, channelOrderKey, 
      channelUserID, channelUserKey, channelOrderTime, 
      orderSubType, netOrderTypeCode, person, 
      startTime, checkoutTime, orderStatus, 
      isTestOrder, foodCount, foodAmount, 
      sendFoodAmount, sendCouponAmount, sendCouponRemark, 
      cardNo, cardKey, cardTransID, 
      customerName, cardTransAfterRemark, discountBy, 
      discountWayKey, discountWayName, discountRate, 
      discountRange, isVipPrice, specialStatAmount, 
      promotionAmount, promotionDesc, paidAmount, 
      saasOrderRemark, actionTime, createTime, 
      deliverSource, deliverFee, action, 
      orderAbandonReason, userPayFlag, customerID, 
      tableLeader, actionstamp, chargeBackFlag, 
      parentOrderKey, consumptionType, isAdd, 
      foodNameDetail)
    values (#{itemid,jdbcType=INTEGER}, #{groupid,jdbcType=BIGINT}, #{brandid,jdbcType=BIGINT}, 
      #{shopid,jdbcType=BIGINT}, #{shopname,jdbcType=VARCHAR}, #{reportdate,jdbcType=DATE}, 
      #{saasorderkey,jdbcType=VARCHAR}, #{saasorderno,jdbcType=VARCHAR}, #{saasdeviceorderno,jdbcType=VARCHAR}, 
      #{timenamestart,jdbcType=VARCHAR}, #{timenamecheckout,jdbcType=VARCHAR}, #{areaname,jdbcType=VARCHAR}, 
      #{tablename,jdbcType=VARCHAR}, #{channelkey,jdbcType=VARCHAR}, #{channelname,jdbcType=VARCHAR}, 
      #{channelorderkeytp,jdbcType=VARCHAR}, #{channelorderno,jdbcType=VARCHAR}, #{channelorderkey,jdbcType=VARCHAR}, 
      #{channeluserid,jdbcType=VARCHAR}, #{channeluserkey,jdbcType=VARCHAR}, #{channelordertime,jdbcType=VARCHAR}, 
      #{ordersubtype,jdbcType=TINYINT}, #{netordertypecode,jdbcType=VARCHAR}, #{person,jdbcType=INTEGER}, 
      #{starttime,jdbcType=TIMESTAMP}, #{checkouttime,jdbcType=TIMESTAMP}, #{orderstatus,jdbcType=TINYINT}, 
      #{istestorder,jdbcType=TINYINT}, #{foodcount,jdbcType=INTEGER}, #{foodamount,jdbcType=DECIMAL}, 
      #{sendfoodamount,jdbcType=DECIMAL}, #{sendcouponamount,jdbcType=DECIMAL}, #{sendcouponremark,jdbcType=VARCHAR}, 
      #{cardno,jdbcType=VARCHAR}, #{cardkey,jdbcType=VARCHAR}, #{cardtransid,jdbcType=VARCHAR}, 
      #{customername,jdbcType=VARCHAR}, #{cardtransafterremark,jdbcType=VARCHAR}, #{discountby,jdbcType=VARCHAR}, 
      #{discountwaykey,jdbcType=VARCHAR}, #{discountwayname,jdbcType=VARCHAR}, #{discountrate,jdbcType=DECIMAL}, 
      #{discountrange,jdbcType=TINYINT}, #{isvipprice,jdbcType=TINYINT}, #{specialstatamount,jdbcType=DECIMAL}, 
      #{promotionamount,jdbcType=DECIMAL}, #{promotiondesc,jdbcType=VARCHAR}, #{paidamount,jdbcType=DECIMAL}, 
      #{saasorderremark,jdbcType=VARCHAR}, #{actiontime,jdbcType=BIGINT}, #{createtime,jdbcType=BIGINT}, 
      #{deliversource,jdbcType=TINYINT}, #{deliverfee,jdbcType=DECIMAL}, #{action,jdbcType=TINYINT}, 
      #{orderabandonreason,jdbcType=VARCHAR}, #{userpayflag,jdbcType=VARCHAR}, #{customerid,jdbcType=BIGINT}, 
      #{tableleader,jdbcType=VARCHAR}, #{actionstamp,jdbcType=TIMESTAMP}, #{chargebackflag,jdbcType=BIT}, 
      #{parentorderkey,jdbcType=VARCHAR}, #{consumptiontype,jdbcType=VARCHAR}, #{isadd,jdbcType=BIT}, 
      #{foodnamedetail,jdbcType=LONGVARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.zm.order.tool.server.model.Master">
    insert into tbl_bill_master
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="itemid != null">
        itemID,
      </if>
      <if test="groupid != null">
        groupID,
      </if>
      <if test="brandid != null">
        brandID,
      </if>
      <if test="shopid != null">
        shopID,
      </if>
      <if test="shopname != null">
        shopName,
      </if>
      <if test="reportdate != null">
        reportDate,
      </if>
      <if test="saasorderkey != null">
        saasOrderKey,
      </if>
      <if test="saasorderno != null">
        saasOrderNo,
      </if>
      <if test="saasdeviceorderno != null">
        saasDeviceOrderNo,
      </if>
      <if test="timenamestart != null">
        timeNameStart,
      </if>
      <if test="timenamecheckout != null">
        timeNameCheckout,
      </if>
      <if test="areaname != null">
        areaName,
      </if>
      <if test="tablename != null">
        tableName,
      </if>
      <if test="channelkey != null">
        channelKey,
      </if>
      <if test="channelname != null">
        channelName,
      </if>
      <if test="channelorderkeytp != null">
        channelOrderKeyTP,
      </if>
      <if test="channelorderno != null">
        channelOrderNo,
      </if>
      <if test="channelorderkey != null">
        channelOrderKey,
      </if>
      <if test="channeluserid != null">
        channelUserID,
      </if>
      <if test="channeluserkey != null">
        channelUserKey,
      </if>
      <if test="channelordertime != null">
        channelOrderTime,
      </if>
      <if test="ordersubtype != null">
        orderSubType,
      </if>
      <if test="netordertypecode != null">
        netOrderTypeCode,
      </if>
      <if test="person != null">
        person,
      </if>
      <if test="starttime != null">
        startTime,
      </if>
      <if test="checkouttime != null">
        checkoutTime,
      </if>
      <if test="orderstatus != null">
        orderStatus,
      </if>
      <if test="istestorder != null">
        isTestOrder,
      </if>
      <if test="foodcount != null">
        foodCount,
      </if>
      <if test="foodamount != null">
        foodAmount,
      </if>
      <if test="sendfoodamount != null">
        sendFoodAmount,
      </if>
      <if test="sendcouponamount != null">
        sendCouponAmount,
      </if>
      <if test="sendcouponremark != null">
        sendCouponRemark,
      </if>
      <if test="cardno != null">
        cardNo,
      </if>
      <if test="cardkey != null">
        cardKey,
      </if>
      <if test="cardtransid != null">
        cardTransID,
      </if>
      <if test="customername != null">
        customerName,
      </if>
      <if test="cardtransafterremark != null">
        cardTransAfterRemark,
      </if>
      <if test="discountby != null">
        discountBy,
      </if>
      <if test="discountwaykey != null">
        discountWayKey,
      </if>
      <if test="discountwayname != null">
        discountWayName,
      </if>
      <if test="discountrate != null">
        discountRate,
      </if>
      <if test="discountrange != null">
        discountRange,
      </if>
      <if test="isvipprice != null">
        isVipPrice,
      </if>
      <if test="specialstatamount != null">
        specialStatAmount,
      </if>
      <if test="promotionamount != null">
        promotionAmount,
      </if>
      <if test="promotiondesc != null">
        promotionDesc,
      </if>
      <if test="paidamount != null">
        paidAmount,
      </if>
      <if test="saasorderremark != null">
        saasOrderRemark,
      </if>
      <if test="actiontime != null">
        actionTime,
      </if>
      <if test="createtime != null">
        createTime,
      </if>
      <if test="deliversource != null">
        deliverSource,
      </if>
      <if test="deliverfee != null">
        deliverFee,
      </if>
      <if test="action != null">
        action,
      </if>
      <if test="orderabandonreason != null">
        orderAbandonReason,
      </if>
      <if test="userpayflag != null">
        userPayFlag,
      </if>
      <if test="customerid != null">
        customerID,
      </if>
      <if test="tableleader != null">
        tableLeader,
      </if>
      <if test="actionstamp != null">
        actionstamp,
      </if>
      <if test="chargebackflag != null">
        chargeBackFlag,
      </if>
      <if test="parentorderkey != null">
        parentOrderKey,
      </if>
      <if test="consumptiontype != null">
        consumptionType,
      </if>
      <if test="isadd != null">
        isAdd,
      </if>
      <if test="foodnamedetail != null">
        foodNameDetail,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="itemid != null">
        #{itemid,jdbcType=INTEGER},
      </if>
      <if test="groupid != null">
        #{groupid,jdbcType=BIGINT},
      </if>
      <if test="brandid != null">
        #{brandid,jdbcType=BIGINT},
      </if>
      <if test="shopid != null">
        #{shopid,jdbcType=BIGINT},
      </if>
      <if test="shopname != null">
        #{shopname,jdbcType=VARCHAR},
      </if>
      <if test="reportdate != null">
        #{reportdate,jdbcType=DATE},
      </if>
      <if test="saasorderkey != null">
        #{saasorderkey,jdbcType=VARCHAR},
      </if>
      <if test="saasorderno != null">
        #{saasorderno,jdbcType=VARCHAR},
      </if>
      <if test="saasdeviceorderno != null">
        #{saasdeviceorderno,jdbcType=VARCHAR},
      </if>
      <if test="timenamestart != null">
        #{timenamestart,jdbcType=VARCHAR},
      </if>
      <if test="timenamecheckout != null">
        #{timenamecheckout,jdbcType=VARCHAR},
      </if>
      <if test="areaname != null">
        #{areaname,jdbcType=VARCHAR},
      </if>
      <if test="tablename != null">
        #{tablename,jdbcType=VARCHAR},
      </if>
      <if test="channelkey != null">
        #{channelkey,jdbcType=VARCHAR},
      </if>
      <if test="channelname != null">
        #{channelname,jdbcType=VARCHAR},
      </if>
      <if test="channelorderkeytp != null">
        #{channelorderkeytp,jdbcType=VARCHAR},
      </if>
      <if test="channelorderno != null">
        #{channelorderno,jdbcType=VARCHAR},
      </if>
      <if test="channelorderkey != null">
        #{channelorderkey,jdbcType=VARCHAR},
      </if>
      <if test="channeluserid != null">
        #{channeluserid,jdbcType=VARCHAR},
      </if>
      <if test="channeluserkey != null">
        #{channeluserkey,jdbcType=VARCHAR},
      </if>
      <if test="channelordertime != null">
        #{channelordertime,jdbcType=VARCHAR},
      </if>
      <if test="ordersubtype != null">
        #{ordersubtype,jdbcType=TINYINT},
      </if>
      <if test="netordertypecode != null">
        #{netordertypecode,jdbcType=VARCHAR},
      </if>
      <if test="person != null">
        #{person,jdbcType=INTEGER},
      </if>
      <if test="starttime != null">
        #{starttime,jdbcType=TIMESTAMP},
      </if>
      <if test="checkouttime != null">
        #{checkouttime,jdbcType=TIMESTAMP},
      </if>
      <if test="orderstatus != null">
        #{orderstatus,jdbcType=TINYINT},
      </if>
      <if test="istestorder != null">
        #{istestorder,jdbcType=TINYINT},
      </if>
      <if test="foodcount != null">
        #{foodcount,jdbcType=INTEGER},
      </if>
      <if test="foodamount != null">
        #{foodamount,jdbcType=DECIMAL},
      </if>
      <if test="sendfoodamount != null">
        #{sendfoodamount,jdbcType=DECIMAL},
      </if>
      <if test="sendcouponamount != null">
        #{sendcouponamount,jdbcType=DECIMAL},
      </if>
      <if test="sendcouponremark != null">
        #{sendcouponremark,jdbcType=VARCHAR},
      </if>
      <if test="cardno != null">
        #{cardno,jdbcType=VARCHAR},
      </if>
      <if test="cardkey != null">
        #{cardkey,jdbcType=VARCHAR},
      </if>
      <if test="cardtransid != null">
        #{cardtransid,jdbcType=VARCHAR},
      </if>
      <if test="customername != null">
        #{customername,jdbcType=VARCHAR},
      </if>
      <if test="cardtransafterremark != null">
        #{cardtransafterremark,jdbcType=VARCHAR},
      </if>
      <if test="discountby != null">
        #{discountby,jdbcType=VARCHAR},
      </if>
      <if test="discountwaykey != null">
        #{discountwaykey,jdbcType=VARCHAR},
      </if>
      <if test="discountwayname != null">
        #{discountwayname,jdbcType=VARCHAR},
      </if>
      <if test="discountrate != null">
        #{discountrate,jdbcType=DECIMAL},
      </if>
      <if test="discountrange != null">
        #{discountrange,jdbcType=TINYINT},
      </if>
      <if test="isvipprice != null">
        #{isvipprice,jdbcType=TINYINT},
      </if>
      <if test="specialstatamount != null">
        #{specialstatamount,jdbcType=DECIMAL},
      </if>
      <if test="promotionamount != null">
        #{promotionamount,jdbcType=DECIMAL},
      </if>
      <if test="promotiondesc != null">
        #{promotiondesc,jdbcType=VARCHAR},
      </if>
      <if test="paidamount != null">
        #{paidamount,jdbcType=DECIMAL},
      </if>
      <if test="saasorderremark != null">
        #{saasorderremark,jdbcType=VARCHAR},
      </if>
      <if test="actiontime != null">
        #{actiontime,jdbcType=BIGINT},
      </if>
      <if test="createtime != null">
        #{createtime,jdbcType=BIGINT},
      </if>
      <if test="deliversource != null">
        #{deliversource,jdbcType=TINYINT},
      </if>
      <if test="deliverfee != null">
        #{deliverfee,jdbcType=DECIMAL},
      </if>
      <if test="action != null">
        #{action,jdbcType=TINYINT},
      </if>
      <if test="orderabandonreason != null">
        #{orderabandonreason,jdbcType=VARCHAR},
      </if>
      <if test="userpayflag != null">
        #{userpayflag,jdbcType=VARCHAR},
      </if>
      <if test="customerid != null">
        #{customerid,jdbcType=BIGINT},
      </if>
      <if test="tableleader != null">
        #{tableleader,jdbcType=VARCHAR},
      </if>
      <if test="actionstamp != null">
        #{actionstamp,jdbcType=TIMESTAMP},
      </if>
      <if test="chargebackflag != null">
        #{chargebackflag,jdbcType=BIT},
      </if>
      <if test="parentorderkey != null">
        #{parentorderkey,jdbcType=VARCHAR},
      </if>
      <if test="consumptiontype != null">
        #{consumptiontype,jdbcType=VARCHAR},
      </if>
      <if test="isadd != null">
        #{isadd,jdbcType=BIT},
      </if>
      <if test="foodnamedetail != null">
        #{foodnamedetail,jdbcType=LONGVARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.zm.order.tool.server.model.Master">
    update tbl_bill_master
    <set>
      <if test="groupid != null">
        groupID = #{groupid,jdbcType=BIGINT},
      </if>
      <if test="brandid != null">
        brandID = #{brandid,jdbcType=BIGINT},
      </if>
      <if test="shopid != null">
        shopID = #{shopid,jdbcType=BIGINT},
      </if>
      <if test="shopname != null">
        shopName = #{shopname,jdbcType=VARCHAR},
      </if>
      <if test="reportdate != null">
        reportDate = #{reportdate,jdbcType=DATE},
      </if>
      <if test="saasorderkey != null">
        saasOrderKey = #{saasorderkey,jdbcType=VARCHAR},
      </if>
      <if test="saasorderno != null">
        saasOrderNo = #{saasorderno,jdbcType=VARCHAR},
      </if>
      <if test="saasdeviceorderno != null">
        saasDeviceOrderNo = #{saasdeviceorderno,jdbcType=VARCHAR},
      </if>
      <if test="timenamestart != null">
        timeNameStart = #{timenamestart,jdbcType=VARCHAR},
      </if>
      <if test="timenamecheckout != null">
        timeNameCheckout = #{timenamecheckout,jdbcType=VARCHAR},
      </if>
      <if test="areaname != null">
        areaName = #{areaname,jdbcType=VARCHAR},
      </if>
      <if test="tablename != null">
        tableName = #{tablename,jdbcType=VARCHAR},
      </if>
      <if test="channelkey != null">
        channelKey = #{channelkey,jdbcType=VARCHAR},
      </if>
      <if test="channelname != null">
        channelName = #{channelname,jdbcType=VARCHAR},
      </if>
      <if test="channelorderkeytp != null">
        channelOrderKeyTP = #{channelorderkeytp,jdbcType=VARCHAR},
      </if>
      <if test="channelorderno != null">
        channelOrderNo = #{channelorderno,jdbcType=VARCHAR},
      </if>
      <if test="channelorderkey != null">
        channelOrderKey = #{channelorderkey,jdbcType=VARCHAR},
      </if>
      <if test="channeluserid != null">
        channelUserID = #{channeluserid,jdbcType=VARCHAR},
      </if>
      <if test="channeluserkey != null">
        channelUserKey = #{channeluserkey,jdbcType=VARCHAR},
      </if>
      <if test="channelordertime != null">
        channelOrderTime = #{channelordertime,jdbcType=VARCHAR},
      </if>
      <if test="ordersubtype != null">
        orderSubType = #{ordersubtype,jdbcType=TINYINT},
      </if>
      <if test="netordertypecode != null">
        netOrderTypeCode = #{netordertypecode,jdbcType=VARCHAR},
      </if>
      <if test="person != null">
        person = #{person,jdbcType=INTEGER},
      </if>
      <if test="starttime != null">
        startTime = #{starttime,jdbcType=TIMESTAMP},
      </if>
      <if test="checkouttime != null">
        checkoutTime = #{checkouttime,jdbcType=TIMESTAMP},
      </if>
      <if test="orderstatus != null">
        orderStatus = #{orderstatus,jdbcType=TINYINT},
      </if>
      <if test="istestorder != null">
        isTestOrder = #{istestorder,jdbcType=TINYINT},
      </if>
      <if test="foodcount != null">
        foodCount = #{foodcount,jdbcType=INTEGER},
      </if>
      <if test="foodamount != null">
        foodAmount = #{foodamount,jdbcType=DECIMAL},
      </if>
      <if test="sendfoodamount != null">
        sendFoodAmount = #{sendfoodamount,jdbcType=DECIMAL},
      </if>
      <if test="sendcouponamount != null">
        sendCouponAmount = #{sendcouponamount,jdbcType=DECIMAL},
      </if>
      <if test="sendcouponremark != null">
        sendCouponRemark = #{sendcouponremark,jdbcType=VARCHAR},
      </if>
      <if test="cardno != null">
        cardNo = #{cardno,jdbcType=VARCHAR},
      </if>
      <if test="cardkey != null">
        cardKey = #{cardkey,jdbcType=VARCHAR},
      </if>
      <if test="cardtransid != null">
        cardTransID = #{cardtransid,jdbcType=VARCHAR},
      </if>
      <if test="customername != null">
        customerName = #{customername,jdbcType=VARCHAR},
      </if>
      <if test="cardtransafterremark != null">
        cardTransAfterRemark = #{cardtransafterremark,jdbcType=VARCHAR},
      </if>
      <if test="discountby != null">
        discountBy = #{discountby,jdbcType=VARCHAR},
      </if>
      <if test="discountwaykey != null">
        discountWayKey = #{discountwaykey,jdbcType=VARCHAR},
      </if>
      <if test="discountwayname != null">
        discountWayName = #{discountwayname,jdbcType=VARCHAR},
      </if>
      <if test="discountrate != null">
        discountRate = #{discountrate,jdbcType=DECIMAL},
      </if>
      <if test="discountrange != null">
        discountRange = #{discountrange,jdbcType=TINYINT},
      </if>
      <if test="isvipprice != null">
        isVipPrice = #{isvipprice,jdbcType=TINYINT},
      </if>
      <if test="specialstatamount != null">
        specialStatAmount = #{specialstatamount,jdbcType=DECIMAL},
      </if>
      <if test="promotionamount != null">
        promotionAmount = #{promotionamount,jdbcType=DECIMAL},
      </if>
      <if test="promotiondesc != null">
        promotionDesc = #{promotiondesc,jdbcType=VARCHAR},
      </if>
      <if test="paidamount != null">
        paidAmount = #{paidamount,jdbcType=DECIMAL},
      </if>
      <if test="saasorderremark != null">
        saasOrderRemark = #{saasorderremark,jdbcType=VARCHAR},
      </if>
      <if test="actiontime != null">
        actionTime = #{actiontime,jdbcType=BIGINT},
      </if>
      <if test="createtime != null">
        createTime = #{createtime,jdbcType=BIGINT},
      </if>
      <if test="deliversource != null">
        deliverSource = #{deliversource,jdbcType=TINYINT},
      </if>
      <if test="deliverfee != null">
        deliverFee = #{deliverfee,jdbcType=DECIMAL},
      </if>
      <if test="action != null">
        action = #{action,jdbcType=TINYINT},
      </if>
      <if test="orderabandonreason != null">
        orderAbandonReason = #{orderabandonreason,jdbcType=VARCHAR},
      </if>
      <if test="userpayflag != null">
        userPayFlag = #{userpayflag,jdbcType=VARCHAR},
      </if>
      <if test="customerid != null">
        customerID = #{customerid,jdbcType=BIGINT},
      </if>
      <if test="tableleader != null">
        tableLeader = #{tableleader,jdbcType=VARCHAR},
      </if>
      <if test="actionstamp != null">
        actionstamp = #{actionstamp,jdbcType=TIMESTAMP},
      </if>
      <if test="chargebackflag != null">
        chargeBackFlag = #{chargebackflag,jdbcType=BIT},
      </if>
      <if test="parentorderkey != null">
        parentOrderKey = #{parentorderkey,jdbcType=VARCHAR},
      </if>
      <if test="consumptiontype != null">
        consumptionType = #{consumptiontype,jdbcType=VARCHAR},
      </if>
      <if test="isadd != null">
        isAdd = #{isadd,jdbcType=BIT},
      </if>
      <if test="foodnamedetail != null">
        foodNameDetail = #{foodnamedetail,jdbcType=LONGVARCHAR},
      </if>
    </set>
    where itemID = #{itemid,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.zm.order.tool.server.model.Master">
    update tbl_bill_master
    set groupID = #{groupid,jdbcType=BIGINT},
      brandID = #{brandid,jdbcType=BIGINT},
      shopID = #{shopid,jdbcType=BIGINT},
      shopName = #{shopname,jdbcType=VARCHAR},
      reportDate = #{reportdate,jdbcType=DATE},
      saasOrderKey = #{saasorderkey,jdbcType=VARCHAR},
      saasOrderNo = #{saasorderno,jdbcType=VARCHAR},
      saasDeviceOrderNo = #{saasdeviceorderno,jdbcType=VARCHAR},
      timeNameStart = #{timenamestart,jdbcType=VARCHAR},
      timeNameCheckout = #{timenamecheckout,jdbcType=VARCHAR},
      areaName = #{areaname,jdbcType=VARCHAR},
      tableName = #{tablename,jdbcType=VARCHAR},
      channelKey = #{channelkey,jdbcType=VARCHAR},
      channelName = #{channelname,jdbcType=VARCHAR},
      channelOrderKeyTP = #{channelorderkeytp,jdbcType=VARCHAR},
      channelOrderNo = #{channelorderno,jdbcType=VARCHAR},
      channelOrderKey = #{channelorderkey,jdbcType=VARCHAR},
      channelUserID = #{channeluserid,jdbcType=VARCHAR},
      channelUserKey = #{channeluserkey,jdbcType=VARCHAR},
      channelOrderTime = #{channelordertime,jdbcType=VARCHAR},
      orderSubType = #{ordersubtype,jdbcType=TINYINT},
      netOrderTypeCode = #{netordertypecode,jdbcType=VARCHAR},
      person = #{person,jdbcType=INTEGER},
      startTime = #{starttime,jdbcType=TIMESTAMP},
      checkoutTime = #{checkouttime,jdbcType=TIMESTAMP},
      orderStatus = #{orderstatus,jdbcType=TINYINT},
      isTestOrder = #{istestorder,jdbcType=TINYINT},
      foodCount = #{foodcount,jdbcType=INTEGER},
      foodAmount = #{foodamount,jdbcType=DECIMAL},
      sendFoodAmount = #{sendfoodamount,jdbcType=DECIMAL},
      sendCouponAmount = #{sendcouponamount,jdbcType=DECIMAL},
      sendCouponRemark = #{sendcouponremark,jdbcType=VARCHAR},
      cardNo = #{cardno,jdbcType=VARCHAR},
      cardKey = #{cardkey,jdbcType=VARCHAR},
      cardTransID = #{cardtransid,jdbcType=VARCHAR},
      customerName = #{customername,jdbcType=VARCHAR},
      cardTransAfterRemark = #{cardtransafterremark,jdbcType=VARCHAR},
      discountBy = #{discountby,jdbcType=VARCHAR},
      discountWayKey = #{discountwaykey,jdbcType=VARCHAR},
      discountWayName = #{discountwayname,jdbcType=VARCHAR},
      discountRate = #{discountrate,jdbcType=DECIMAL},
      discountRange = #{discountrange,jdbcType=TINYINT},
      isVipPrice = #{isvipprice,jdbcType=TINYINT},
      specialStatAmount = #{specialstatamount,jdbcType=DECIMAL},
      promotionAmount = #{promotionamount,jdbcType=DECIMAL},
      promotionDesc = #{promotiondesc,jdbcType=VARCHAR},
      paidAmount = #{paidamount,jdbcType=DECIMAL},
      saasOrderRemark = #{saasorderremark,jdbcType=VARCHAR},
      actionTime = #{actiontime,jdbcType=BIGINT},
      createTime = #{createtime,jdbcType=BIGINT},
      deliverSource = #{deliversource,jdbcType=TINYINT},
      deliverFee = #{deliverfee,jdbcType=DECIMAL},
      action = #{action,jdbcType=TINYINT},
      orderAbandonReason = #{orderabandonreason,jdbcType=VARCHAR},
      userPayFlag = #{userpayflag,jdbcType=VARCHAR},
      customerID = #{customerid,jdbcType=BIGINT},
      tableLeader = #{tableleader,jdbcType=VARCHAR},
      actionstamp = #{actionstamp,jdbcType=TIMESTAMP},
      chargeBackFlag = #{chargebackflag,jdbcType=BIT},
      parentOrderKey = #{parentorderkey,jdbcType=VARCHAR},
      consumptionType = #{consumptiontype,jdbcType=VARCHAR},
      isAdd = #{isadd,jdbcType=BIT},
      foodNameDetail = #{foodnamedetail,jdbcType=LONGVARCHAR}
    where itemID = #{itemid,jdbcType=INTEGER}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.zm.order.tool.server.model.Master">
    update tbl_bill_master
    set groupID = #{groupid,jdbcType=BIGINT},
      brandID = #{brandid,jdbcType=BIGINT},
      shopID = #{shopid,jdbcType=BIGINT},
      shopName = #{shopname,jdbcType=VARCHAR},
      reportDate = #{reportdate,jdbcType=DATE},
      saasOrderKey = #{saasorderkey,jdbcType=VARCHAR},
      saasOrderNo = #{saasorderno,jdbcType=VARCHAR},
      saasDeviceOrderNo = #{saasdeviceorderno,jdbcType=VARCHAR},
      timeNameStart = #{timenamestart,jdbcType=VARCHAR},
      timeNameCheckout = #{timenamecheckout,jdbcType=VARCHAR},
      areaName = #{areaname,jdbcType=VARCHAR},
      tableName = #{tablename,jdbcType=VARCHAR},
      channelKey = #{channelkey,jdbcType=VARCHAR},
      channelName = #{channelname,jdbcType=VARCHAR},
      channelOrderKeyTP = #{channelorderkeytp,jdbcType=VARCHAR},
      channelOrderNo = #{channelorderno,jdbcType=VARCHAR},
      channelOrderKey = #{channelorderkey,jdbcType=VARCHAR},
      channelUserID = #{channeluserid,jdbcType=VARCHAR},
      channelUserKey = #{channeluserkey,jdbcType=VARCHAR},
      channelOrderTime = #{channelordertime,jdbcType=VARCHAR},
      orderSubType = #{ordersubtype,jdbcType=TINYINT},
      netOrderTypeCode = #{netordertypecode,jdbcType=VARCHAR},
      person = #{person,jdbcType=INTEGER},
      startTime = #{starttime,jdbcType=TIMESTAMP},
      checkoutTime = #{checkouttime,jdbcType=TIMESTAMP},
      orderStatus = #{orderstatus,jdbcType=TINYINT},
      isTestOrder = #{istestorder,jdbcType=TINYINT},
      foodCount = #{foodcount,jdbcType=INTEGER},
      foodAmount = #{foodamount,jdbcType=DECIMAL},
      sendFoodAmount = #{sendfoodamount,jdbcType=DECIMAL},
      sendCouponAmount = #{sendcouponamount,jdbcType=DECIMAL},
      sendCouponRemark = #{sendcouponremark,jdbcType=VARCHAR},
      cardNo = #{cardno,jdbcType=VARCHAR},
      cardKey = #{cardkey,jdbcType=VARCHAR},
      cardTransID = #{cardtransid,jdbcType=VARCHAR},
      customerName = #{customername,jdbcType=VARCHAR},
      cardTransAfterRemark = #{cardtransafterremark,jdbcType=VARCHAR},
      discountBy = #{discountby,jdbcType=VARCHAR},
      discountWayKey = #{discountwaykey,jdbcType=VARCHAR},
      discountWayName = #{discountwayname,jdbcType=VARCHAR},
      discountRate = #{discountrate,jdbcType=DECIMAL},
      discountRange = #{discountrange,jdbcType=TINYINT},
      isVipPrice = #{isvipprice,jdbcType=TINYINT},
      specialStatAmount = #{specialstatamount,jdbcType=DECIMAL},
      promotionAmount = #{promotionamount,jdbcType=DECIMAL},
      promotionDesc = #{promotiondesc,jdbcType=VARCHAR},
      paidAmount = #{paidamount,jdbcType=DECIMAL},
      saasOrderRemark = #{saasorderremark,jdbcType=VARCHAR},
      actionTime = #{actiontime,jdbcType=BIGINT},
      createTime = #{createtime,jdbcType=BIGINT},
      deliverSource = #{deliversource,jdbcType=TINYINT},
      deliverFee = #{deliverfee,jdbcType=DECIMAL},
      action = #{action,jdbcType=TINYINT},
      orderAbandonReason = #{orderabandonreason,jdbcType=VARCHAR},
      userPayFlag = #{userpayflag,jdbcType=VARCHAR},
      customerID = #{customerid,jdbcType=BIGINT},
      tableLeader = #{tableleader,jdbcType=VARCHAR},
      actionstamp = #{actionstamp,jdbcType=TIMESTAMP},
      chargeBackFlag = #{chargebackflag,jdbcType=BIT},
      parentOrderKey = #{parentorderkey,jdbcType=VARCHAR},
      consumptionType = #{consumptiontype,jdbcType=VARCHAR},
      isAdd = #{isadd,jdbcType=BIT}
    where itemID = #{itemid,jdbcType=INTEGER}
  </update>
</mapper>