<?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.MasterDao">
    <resultMap id="BaseResultMap" type="com.zm.order.tool.server.model.Master">
        <id column="itemID" jdbcType="INTEGER" property="itemid" />
        <id column="reportDate" jdbcType="BIGINT" property="reportdate" />
        <id column="saasOrderKey" jdbcType="VARCHAR" property="saasorderkey" />
        <id column="shopID" jdbcType="BIGINT" property="shopid" />
        <result column="groupID" jdbcType="BIGINT" property="groupid" />
        <result column="brandID" jdbcType="BIGINT" property="brandid" />
        <result column="shopName" jdbcType="VARCHAR" property="shopname" />
        <result column="saasOrderNo" jdbcType="VARCHAR" property="saasorderno" />
        <result column="saasDeviceOrderNo" jdbcType="VARCHAR" property="saasdeviceorderno" />
        <result column="lockedFlag" jdbcType="VARCHAR" property="lockedflag" />
        <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="channelUserImage" jdbcType="VARCHAR" property="channeluserimage" />
        <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="createBy" jdbcType="VARCHAR" property="createby" />
        <result column="isCreatedByLoginUser" jdbcType="BIT" property="iscreatedbyloginuser" />
        <result column="waiterBy" jdbcType="VARCHAR" property="waiterby" />
        <result column="startTime" jdbcType="BIGINT" property="starttime" />
        <result column="checkoutTime" jdbcType="BIGINT" property="checkouttime" />
        <result column="checkoutBy" jdbcType="VARCHAR" property="checkoutby" />
        <result column="orderStatus" jdbcType="TINYINT" property="orderstatus" />
        <result column="isTestOrder" jdbcType="TINYINT" property="istestorder" />
        <result column="orderMD5" jdbcType="VARCHAR" property="ordermd5" />
        <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="moneyWipeZeroType" jdbcType="TINYINT" property="moneywipezerotype" />
        <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="invoiceBy" jdbcType="VARCHAR" property="invoiceby" />
        <result column="invoiceTaxpayerIdentCode" jdbcType="VARCHAR" property="invoicetaxpayeridentcode" />
        <result column="invoiceAmount" jdbcType="DECIMAL" property="invoiceamount" />
        <result column="invoiceTaxRate" jdbcType="DECIMAL" property="invoicetaxrate" />
        <result column="invoiceTaxAmount" jdbcType="DECIMAL" property="invoicetaxamount" />
        <result column="userName" jdbcType="VARCHAR" property="username" />
        <result column="userSex" jdbcType="TINYINT" property="usersex" />
        <result column="userMobile" jdbcType="VARCHAR" property="usermobile" />
        <result column="userAddress" jdbcType="VARCHAR" property="useraddress" />
        <result column="YJZCount" jdbcType="INTEGER" property="yjzcount" />
        <result column="FJZCount" jdbcType="INTEGER" property="fjzcount" />
        <result column="alertFlagLst" jdbcType="VARCHAR" property="alertflaglst" />
        <result column="foodAlert" jdbcType="VARCHAR" property="foodalert" />
        <result column="payAlert" jdbcType="VARCHAR" property="payalert" />
        <result column="saasOrderRemark" jdbcType="VARCHAR" property="saasorderremark" />
        <result column="deviceKey" jdbcType="VARCHAR" property="devicekey" />
        <result column="deviceCode" jdbcType="VARCHAR" property="devicecode" />
        <result column="deviceName" jdbcType="VARCHAR" property="devicename" />
        <result column="deviceGroupID" jdbcType="VARCHAR" property="devicegroupid" />
        <result column="deviceGroupName" jdbcType="VARCHAR" property="devicegroupname" />
        <result column="serverMAC" jdbcType="VARCHAR" property="servermac" />
        <result column="reviewBy" jdbcType="VARCHAR" property="reviewby" />
        <result column="reviewTime" jdbcType="BIGINT" property="reviewtime" />
        <result column="shiftTime" jdbcType="VARCHAR" property="shifttime" />
        <result column="actionTime" jdbcType="BIGINT" property="actiontime" />
        <result column="createTime" jdbcType="BIGINT" property="createtime" />
        <result column="uploadTime" jdbcType="BIGINT" property="uploadtime" />
        <result column="shiftName" jdbcType="VARCHAR" property="shiftname" />
        <result column="deliverSource" jdbcType="TINYINT" property="deliversource" />
        <result column="deliverFee" jdbcType="DECIMAL" property="deliverfee" />
        <result column="action" jdbcType="TINYINT" property="action" />
        <result column="billMD5" jdbcType="VARCHAR" property="billmd5" />
        <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="partition_id" jdbcType="INTEGER" property="partitionId" />
        <result column="offset" jdbcType="BIGINT" property="offset" />
    </resultMap>
    <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.zm.order.tool.server.model.masterWithBLOBs">
        <result column="invoiceTitle" jdbcType="LONGVARCHAR" property="invoicetitle" />
        <result column="modifyOrderLog" jdbcType="LONGVARCHAR" property="modifyorderlog" />
        <result column="foodNameDetail" jdbcType="LONGVARCHAR" property="foodnamedetail" />
    </resultMap>
    <sql id="Base_Column_List">
        itemID, reportDate, saasOrderKey, shopID, groupID, brandID, shopName, saasOrderNo, lockedFlag, timeNameStart, timeNameCheckout, areaName, tableName,
    channelKey, channelName, channelOrderKeyTP, channelOrderNo, channelOrderKey, channelUserID,
    channelUserKey, channelUserImage, channelOrderTime, orderSubType, netOrderTypeCode,
    person, createBy, isCreatedByLoginUser, waiterBy, startTime, checkoutTime, checkoutBy,
    orderStatus, isTestOrder, orderMD5, foodCount, foodAmount, sendFoodAmount, sendCouponAmount,
    sendCouponRemark, cardNo, cardKey, cardTransID, customerName, cardTransAfterRemark,
    discountBy, discountWayKey, discountWayName, discountRate, discountRange, isVipPrice,
    moneyWipeZeroType, specialStatAmount, promotionAmount, promotionDesc, paidAmount,
    invoiceBy, invoiceTaxpayerIdentCode, invoiceAmount, invoiceTaxRate, invoiceTaxAmount,
    userName, userSex, userMobile, userAddress, YJZCount, FJZCount, alertFlagLst, foodAlert,
    payAlert, saasOrderRemark, deviceKey, deviceCode, deviceName, deviceGroupID, deviceGroupName,
    serverMAC, reviewBy, reviewTime, shiftTime, actionTime, createTime, uploadTime, shiftName,
    deliverSource, deliverFee, billMD5, orderAbandonReason, userPayFlag, customerID,
    tableLeader, actionstamp, chargeBackFlag, parentOrderKey, partition_id
    </sql>

    <sql id="Blob_Column_List">
        invoiceTitle, modifyOrderLog, foodNameDetail
    </sql>
    <select id="selectByPrimaryKey" parameterType="com.zm.order.tool.server.model.masterKey" resultMap="ResultMapWithBLOBs">
        select
        <include refid="Base_Column_List" />
        ,
        <include refid="Blob_Column_List" />
        from tbl_bill_master
        where itemID = #{itemid,jdbcType=INTEGER}
        and reportDate = #{reportdate,jdbcType=BIGINT}
        and saasOrderKey = #{saasorderkey,jdbcType=VARCHAR}
        and shopID = #{shopid,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="com.zm.order.tool.server.model.masterKey">
        delete from tbl_bill_master
        where itemID = #{itemid,jdbcType=INTEGER}
          and reportDate = #{reportdate,jdbcType=BIGINT}
          and saasOrderKey = #{saasorderkey,jdbcType=VARCHAR}
          and shopID = #{shopid,jdbcType=BIGINT}
    </delete>
    <insert id="insert" parameterType="com.zm.order.tool.server.model.masterWithBLOBs">
        insert into tbl_bill_master (itemID, reportDate, saasOrderKey,
                                     shopID, groupID, brandID,
                                     shopName, saasOrderNo, saasDeviceOrderNo,
                                     lockedFlag, timeNameStart, timeNameCheckout,
                                     areaName, tableName, channelKey,
                                     channelName, channelOrderKeyTP, channelOrderNo,
                                     channelOrderKey, channelUserID, channelUserKey,
                                     channelUserImage, channelOrderTime, orderSubType,
                                     netOrderTypeCode, person, createBy,
                                     isCreatedByLoginUser, waiterBy, startTime,
                                     checkoutTime, checkoutBy, orderStatus,
                                     isTestOrder, orderMD5, foodCount,
                                     foodAmount, sendFoodAmount, sendCouponAmount,
                                     sendCouponRemark, cardNo, cardKey,
                                     cardTransID, customerName, cardTransAfterRemark,
                                     discountBy, discountWayKey, discountWayName,
                                     discountRate, discountRange, isVipPrice,
                                     moneyWipeZeroType, specialStatAmount, promotionAmount,
                                     promotionDesc, paidAmount, invoiceBy,
                                     invoiceTaxpayerIdentCode, invoiceAmount,
                                     invoiceTaxRate, invoiceTaxAmount, userName,
                                     userSex, userMobile, userAddress,
                                     YJZCount, FJZCount, alertFlagLst,
                                     foodAlert, payAlert, saasOrderRemark,
                                     deviceKey, deviceCode, deviceName,
                                     deviceGroupID, deviceGroupName, serverMAC,
                                     reviewBy, reviewTime, shiftTime,
                                     actionTime, createTime, uploadTime,
                                     shiftName, deliverSource, deliverFee,
                                     action, billMD5, orderAbandonReason,
                                     userPayFlag, customerID, tableLeader,
                                     actionstamp, chargeBackFlag, parentOrderKey,
                                     partition_id, offset, invoiceTitle,
                                     modifyOrderLog, foodNameDetail)
        values (#{itemid,jdbcType=INTEGER}, #{reportdate,jdbcType=BIGINT}, #{saasorderkey,jdbcType=VARCHAR},
                #{shopid,jdbcType=BIGINT}, #{groupid,jdbcType=BIGINT}, #{brandid,jdbcType=BIGINT},
                #{shopname,jdbcType=VARCHAR}, #{saasorderno,jdbcType=VARCHAR}, #{saasdeviceorderno,jdbcType=VARCHAR},
                #{lockedflag,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},
                #{channeluserimage,jdbcType=VARCHAR}, #{channelordertime,jdbcType=VARCHAR}, #{ordersubtype,jdbcType=TINYINT},
                #{netordertypecode,jdbcType=VARCHAR}, #{person,jdbcType=INTEGER}, #{createby,jdbcType=VARCHAR},
                #{iscreatedbyloginuser,jdbcType=BIT}, #{waiterby,jdbcType=VARCHAR}, #{starttime,jdbcType=BIGINT},
                #{checkouttime,jdbcType=BIGINT}, #{checkoutby,jdbcType=VARCHAR}, #{orderstatus,jdbcType=TINYINT},
                #{istestorder,jdbcType=TINYINT}, #{ordermd5,jdbcType=VARCHAR}, #{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},
                #{moneywipezerotype,jdbcType=TINYINT}, #{specialstatamount,jdbcType=DECIMAL}, #{promotionamount,jdbcType=DECIMAL},
                #{promotiondesc,jdbcType=VARCHAR}, #{paidamount,jdbcType=DECIMAL}, #{invoiceby,jdbcType=VARCHAR},
                #{invoicetaxpayeridentcode,jdbcType=VARCHAR}, #{invoiceamount,jdbcType=DECIMAL},
                #{invoicetaxrate,jdbcType=DECIMAL}, #{invoicetaxamount,jdbcType=DECIMAL}, #{username,jdbcType=VARCHAR},
                #{usersex,jdbcType=TINYINT}, #{usermobile,jdbcType=VARCHAR}, #{useraddress,jdbcType=VARCHAR},
                #{yjzcount,jdbcType=INTEGER}, #{fjzcount,jdbcType=INTEGER}, #{alertflaglst,jdbcType=VARCHAR},
                #{foodalert,jdbcType=VARCHAR}, #{payalert,jdbcType=VARCHAR}, #{saasorderremark,jdbcType=VARCHAR},
                #{devicekey,jdbcType=VARCHAR}, #{devicecode,jdbcType=VARCHAR}, #{devicename,jdbcType=VARCHAR},
                #{devicegroupid,jdbcType=VARCHAR}, #{devicegroupname,jdbcType=VARCHAR}, #{servermac,jdbcType=VARCHAR},
                #{reviewby,jdbcType=VARCHAR}, #{reviewtime,jdbcType=BIGINT}, #{shifttime,jdbcType=VARCHAR},
                #{actiontime,jdbcType=BIGINT}, #{createtime,jdbcType=BIGINT}, #{uploadtime,jdbcType=BIGINT},
                #{shiftname,jdbcType=VARCHAR}, #{deliversource,jdbcType=TINYINT}, #{deliverfee,jdbcType=DECIMAL},
                #{action,jdbcType=TINYINT}, #{billmd5,jdbcType=VARCHAR}, #{orderabandonreason,jdbcType=VARCHAR},
                #{userpayflag,jdbcType=VARCHAR}, #{customerid,jdbcType=BIGINT}, #{tableleader,jdbcType=VARCHAR},
                #{actionstamp,jdbcType=TIMESTAMP}, #{chargebackflag,jdbcType=BIT}, #{parentorderkey,jdbcType=VARCHAR},
                #{partitionId,jdbcType=INTEGER}, #{offset,jdbcType=BIGINT}, #{invoicetitle,jdbcType=LONGVARCHAR},
                #{modifyorderlog,jdbcType=LONGVARCHAR}, #{foodnamedetail,jdbcType=LONGVARCHAR})
    </insert>



    <insert id="insertSelective" parameterType="com.zm.order.tool.server.model.masterWithBLOBs">
        insert into tbl_bill_master
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="itemid != null">
                itemID,
            </if>
            <if test="reportdate != null">
                reportDate,
            </if>
            <if test="saasorderkey != null">
                saasOrderKey,
            </if>
            <if test="shopid != null">
                shopID,
            </if>
            <if test="groupid != null">
                groupID,
            </if>
            <if test="brandid != null">
                brandID,
            </if>
            <if test="shopname != null">
                shopName,
            </if>
            <if test="saasorderno != null">
                saasOrderNo,
            </if>
            <if test="saasdeviceorderno != null">
                saasDeviceOrderNo,
            </if>
            <if test="lockedflag != null">
                lockedFlag,
            </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="channeluserimage != null">
                channelUserImage,
            </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="createby != null">
                createBy,
            </if>
            <if test="iscreatedbyloginuser != null">
                isCreatedByLoginUser,
            </if>
            <if test="waiterby != null">
                waiterBy,
            </if>
            <if test="starttime != null">
                startTime,
            </if>
            <if test="checkouttime != null">
                checkoutTime,
            </if>
            <if test="checkoutby != null">
                checkoutBy,
            </if>
            <if test="orderstatus != null">
                orderStatus,
            </if>
            <if test="istestorder != null">
                isTestOrder,
            </if>
            <if test="ordermd5 != null">
                orderMD5,
            </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="moneywipezerotype != null">
                moneyWipeZeroType,
            </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="invoiceby != null">
                invoiceBy,
            </if>
            <if test="invoicetaxpayeridentcode != null">
                invoiceTaxpayerIdentCode,
            </if>
            <if test="invoiceamount != null">
                invoiceAmount,
            </if>
            <if test="invoicetaxrate != null">
                invoiceTaxRate,
            </if>
            <if test="invoicetaxamount != null">
                invoiceTaxAmount,
            </if>
            <if test="username != null">
                userName,
            </if>
            <if test="usersex != null">
                userSex,
            </if>
            <if test="usermobile != null">
                userMobile,
            </if>
            <if test="useraddress != null">
                userAddress,
            </if>
            <if test="yjzcount != null">
                YJZCount,
            </if>
            <if test="fjzcount != null">
                FJZCount,
            </if>
            <if test="alertflaglst != null">
                alertFlagLst,
            </if>
            <if test="foodalert != null">
                foodAlert,
            </if>
            <if test="payalert != null">
                payAlert,
            </if>
            <if test="saasorderremark != null">
                saasOrderRemark,
            </if>
            <if test="devicekey != null">
                deviceKey,
            </if>
            <if test="devicecode != null">
                deviceCode,
            </if>
            <if test="devicename != null">
                deviceName,
            </if>
            <if test="devicegroupid != null">
                deviceGroupID,
            </if>
            <if test="devicegroupname != null">
                deviceGroupName,
            </if>
            <if test="servermac != null">
                serverMAC,
            </if>
            <if test="reviewby != null">
                reviewBy,
            </if>
            <if test="reviewtime != null">
                reviewTime,
            </if>
            <if test="shifttime != null">
                shiftTime,
            </if>
            <if test="actiontime != null">
                actionTime,
            </if>
            <if test="createtime != null">
                createTime,
            </if>
            <if test="uploadtime != null">
                uploadTime,
            </if>
            <if test="shiftname != null">
                shiftName,
            </if>
            <if test="deliversource != null">
                deliverSource,
            </if>
            <if test="deliverfee != null">
                deliverFee,
            </if>
            <if test="action != null">
                action,
            </if>
            <if test="billmd5 != null">
                billMD5,
            </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="partitionId != null">
                partition_id,
            </if>
            <if test="offset != null">
                offset,
            </if>
            <if test="invoicetitle != null">
                invoiceTitle,
            </if>
            <if test="modifyorderlog != null">
                modifyOrderLog,
            </if>
            <if test="foodnamedetail != null">
                foodNameDetail,
            </if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="itemid != null">
                #{itemid,jdbcType=INTEGER},
            </if>
            <if test="reportdate != null">
                #{reportdate,jdbcType=BIGINT},
            </if>
            <if test="saasorderkey != null">
                #{saasorderkey,jdbcType=VARCHAR},
            </if>
            <if test="shopid != null">
                #{shopid,jdbcType=BIGINT},
            </if>
            <if test="groupid != null">
                #{groupid,jdbcType=BIGINT},
            </if>
            <if test="brandid != null">
                #{brandid,jdbcType=BIGINT},
            </if>
            <if test="shopname != null">
                #{shopname,jdbcType=VARCHAR},
            </if>
            <if test="saasorderno != null">
                #{saasorderno,jdbcType=VARCHAR},
            </if>
            <if test="saasdeviceorderno != null">
                #{saasdeviceorderno,jdbcType=VARCHAR},
            </if>
            <if test="lockedflag != null">
                #{lockedflag,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="channeluserimage != null">
                #{channeluserimage,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="createby != null">
                #{createby,jdbcType=VARCHAR},
            </if>
            <if test="iscreatedbyloginuser != null">
                #{iscreatedbyloginuser,jdbcType=BIT},
            </if>
            <if test="waiterby != null">
                #{waiterby,jdbcType=VARCHAR},
            </if>
            <if test="starttime != null">
                #{starttime,jdbcType=BIGINT},
            </if>
            <if test="checkouttime != null">
                #{checkouttime,jdbcType=BIGINT},
            </if>
            <if test="checkoutby != null">
                #{checkoutby,jdbcType=VARCHAR},
            </if>
            <if test="orderstatus != null">
                #{orderstatus,jdbcType=TINYINT},
            </if>
            <if test="istestorder != null">
                #{istestorder,jdbcType=TINYINT},
            </if>
            <if test="ordermd5 != null">
                #{ordermd5,jdbcType=VARCHAR},
            </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="moneywipezerotype != null">
                #{moneywipezerotype,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="invoiceby != null">
                #{invoiceby,jdbcType=VARCHAR},
            </if>
            <if test="invoicetaxpayeridentcode != null">
                #{invoicetaxpayeridentcode,jdbcType=VARCHAR},
            </if>
            <if test="invoiceamount != null">
                #{invoiceamount,jdbcType=DECIMAL},
            </if>
            <if test="invoicetaxrate != null">
                #{invoicetaxrate,jdbcType=DECIMAL},
            </if>
            <if test="invoicetaxamount != null">
                #{invoicetaxamount,jdbcType=DECIMAL},
            </if>
            <if test="username != null">
                #{username,jdbcType=VARCHAR},
            </if>
            <if test="usersex != null">
                #{usersex,jdbcType=TINYINT},
            </if>
            <if test="usermobile != null">
                #{usermobile,jdbcType=VARCHAR},
            </if>
            <if test="useraddress != null">
                #{useraddress,jdbcType=VARCHAR},
            </if>
            <if test="yjzcount != null">
                #{yjzcount,jdbcType=INTEGER},
            </if>
            <if test="fjzcount != null">
                #{fjzcount,jdbcType=INTEGER},
            </if>
            <if test="alertflaglst != null">
                #{alertflaglst,jdbcType=VARCHAR},
            </if>
            <if test="foodalert != null">
                #{foodalert,jdbcType=VARCHAR},
            </if>
            <if test="payalert != null">
                #{payalert,jdbcType=VARCHAR},
            </if>
            <if test="saasorderremark != null">
                #{saasorderremark,jdbcType=VARCHAR},
            </if>
            <if test="devicekey != null">
                #{devicekey,jdbcType=VARCHAR},
            </if>
            <if test="devicecode != null">
                #{devicecode,jdbcType=VARCHAR},
            </if>
            <if test="devicename != null">
                #{devicename,jdbcType=VARCHAR},
            </if>
            <if test="devicegroupid != null">
                #{devicegroupid,jdbcType=VARCHAR},
            </if>
            <if test="devicegroupname != null">
                #{devicegroupname,jdbcType=VARCHAR},
            </if>
            <if test="servermac != null">
                #{servermac,jdbcType=VARCHAR},
            </if>
            <if test="reviewby != null">
                #{reviewby,jdbcType=VARCHAR},
            </if>
            <if test="reviewtime != null">
                #{reviewtime,jdbcType=BIGINT},
            </if>
            <if test="shifttime != null">
                #{shifttime,jdbcType=VARCHAR},
            </if>
            <if test="actiontime != null">
                #{actiontime,jdbcType=BIGINT},
            </if>
            <if test="createtime != null">
                #{createtime,jdbcType=BIGINT},
            </if>
            <if test="uploadtime != null">
                #{uploadtime,jdbcType=BIGINT},
            </if>
            <if test="shiftname != null">
                #{shiftname,jdbcType=VARCHAR},
            </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="billmd5 != null">
                #{billmd5,jdbcType=VARCHAR},
            </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="partitionId != null">
                #{partitionId,jdbcType=INTEGER},
            </if>
            <if test="offset != null">
                #{offset,jdbcType=BIGINT},
            </if>
            <if test="invoicetitle != null">
                #{invoicetitle,jdbcType=LONGVARCHAR},
            </if>
            <if test="modifyorderlog != null">
                #{modifyorderlog,jdbcType=LONGVARCHAR},
            </if>
            <if test="foodnamedetail != null">
                #{foodnamedetail,jdbcType=LONGVARCHAR},
            </if>
        </trim>
    </insert>
    <update id="updateByPrimaryKeySelective" parameterType="com.zm.order.tool.server.model.masterWithBLOBs">
        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="shopname != null">
                shopName = #{shopname,jdbcType=VARCHAR},
            </if>
            <if test="saasorderno != null">
                saasOrderNo = #{saasorderno,jdbcType=VARCHAR},
            </if>
            <if test="saasdeviceorderno != null">
                saasDeviceOrderNo = #{saasdeviceorderno,jdbcType=VARCHAR},
            </if>
            <if test="lockedflag != null">
                lockedFlag = #{lockedflag,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="channeluserimage != null">
                channelUserImage = #{channeluserimage,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="createby != null">
                createBy = #{createby,jdbcType=VARCHAR},
            </if>
            <if test="iscreatedbyloginuser != null">
                isCreatedByLoginUser = #{iscreatedbyloginuser,jdbcType=BIT},
            </if>
            <if test="waiterby != null">
                waiterBy = #{waiterby,jdbcType=VARCHAR},
            </if>
            <if test="starttime != null">
                startTime = #{starttime,jdbcType=BIGINT},
            </if>
            <if test="checkouttime != null">
                checkoutTime = #{checkouttime,jdbcType=BIGINT},
            </if>
            <if test="checkoutby != null">
                checkoutBy = #{checkoutby,jdbcType=VARCHAR},
            </if>
            <if test="orderstatus != null">
                orderStatus = #{orderstatus,jdbcType=TINYINT},
            </if>
            <if test="istestorder != null">
                isTestOrder = #{istestorder,jdbcType=TINYINT},
            </if>
            <if test="ordermd5 != null">
                orderMD5 = #{ordermd5,jdbcType=VARCHAR},
            </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="moneywipezerotype != null">
                moneyWipeZeroType = #{moneywipezerotype,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="invoiceby != null">
                invoiceBy = #{invoiceby,jdbcType=VARCHAR},
            </if>
            <if test="invoicetaxpayeridentcode != null">
                invoiceTaxpayerIdentCode = #{invoicetaxpayeridentcode,jdbcType=VARCHAR},
            </if>
            <if test="invoiceamount != null">
                invoiceAmount = #{invoiceamount,jdbcType=DECIMAL},
            </if>
            <if test="invoicetaxrate != null">
                invoiceTaxRate = #{invoicetaxrate,jdbcType=DECIMAL},
            </if>
            <if test="invoicetaxamount != null">
                invoiceTaxAmount = #{invoicetaxamount,jdbcType=DECIMAL},
            </if>
            <if test="username != null">
                userName = #{username,jdbcType=VARCHAR},
            </if>
            <if test="usersex != null">
                userSex = #{usersex,jdbcType=TINYINT},
            </if>
            <if test="usermobile != null">
                userMobile = #{usermobile,jdbcType=VARCHAR},
            </if>
            <if test="useraddress != null">
                userAddress = #{useraddress,jdbcType=VARCHAR},
            </if>
            <if test="yjzcount != null">
                YJZCount = #{yjzcount,jdbcType=INTEGER},
            </if>
            <if test="fjzcount != null">
                FJZCount = #{fjzcount,jdbcType=INTEGER},
            </if>
            <if test="alertflaglst != null">
                alertFlagLst = #{alertflaglst,jdbcType=VARCHAR},
            </if>
            <if test="foodalert != null">
                foodAlert = #{foodalert,jdbcType=VARCHAR},
            </if>
            <if test="payalert != null">
                payAlert = #{payalert,jdbcType=VARCHAR},
            </if>
            <if test="saasorderremark != null">
                saasOrderRemark = #{saasorderremark,jdbcType=VARCHAR},
            </if>
            <if test="devicekey != null">
                deviceKey = #{devicekey,jdbcType=VARCHAR},
            </if>
            <if test="devicecode != null">
                deviceCode = #{devicecode,jdbcType=VARCHAR},
            </if>
            <if test="devicename != null">
                deviceName = #{devicename,jdbcType=VARCHAR},
            </if>
            <if test="devicegroupid != null">
                deviceGroupID = #{devicegroupid,jdbcType=VARCHAR},
            </if>
            <if test="devicegroupname != null">
                deviceGroupName = #{devicegroupname,jdbcType=VARCHAR},
            </if>
            <if test="servermac != null">
                serverMAC = #{servermac,jdbcType=VARCHAR},
            </if>
            <if test="reviewby != null">
                reviewBy = #{reviewby,jdbcType=VARCHAR},
            </if>
            <if test="reviewtime != null">
                reviewTime = #{reviewtime,jdbcType=BIGINT},
            </if>
            <if test="shifttime != null">
                shiftTime = #{shifttime,jdbcType=VARCHAR},
            </if>
            <if test="actiontime != null">
                actionTime = #{actiontime,jdbcType=BIGINT},
            </if>
            <if test="createtime != null">
                createTime = #{createtime,jdbcType=BIGINT},
            </if>
            <if test="uploadtime != null">
                uploadTime = #{uploadtime,jdbcType=BIGINT},
            </if>
            <if test="shiftname != null">
                shiftName = #{shiftname,jdbcType=VARCHAR},
            </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="billmd5 != null">
                billMD5 = #{billmd5,jdbcType=VARCHAR},
            </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="partitionId != null">
                partition_id = #{partitionId,jdbcType=INTEGER},
            </if>
            <if test="offset != null">
                offset = #{offset,jdbcType=BIGINT},
            </if>
            <if test="invoicetitle != null">
                invoiceTitle = #{invoicetitle,jdbcType=LONGVARCHAR},
            </if>
            <if test="modifyorderlog != null">
                modifyOrderLog = #{modifyorderlog,jdbcType=LONGVARCHAR},
            </if>
            <if test="foodnamedetail != null">
                foodNameDetail = #{foodnamedetail,jdbcType=LONGVARCHAR},
            </if>
        </set>
        where itemID = #{itemid,jdbcType=INTEGER}
        and reportDate = #{reportdate,jdbcType=BIGINT}
        and saasOrderKey = #{saasorderkey,jdbcType=VARCHAR}
        and shopID = #{shopid,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.zm.order.tool.server.model.masterWithBLOBs">
        update tbl_bill_master
        set groupID = #{groupid,jdbcType=BIGINT},
            brandID = #{brandid,jdbcType=BIGINT},
            shopName = #{shopname,jdbcType=VARCHAR},
            saasOrderNo = #{saasorderno,jdbcType=VARCHAR},
            saasDeviceOrderNo = #{saasdeviceorderno,jdbcType=VARCHAR},
            lockedFlag = #{lockedflag,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},
            channelUserImage = #{channeluserimage,jdbcType=VARCHAR},
            channelOrderTime = #{channelordertime,jdbcType=VARCHAR},
            orderSubType = #{ordersubtype,jdbcType=TINYINT},
            netOrderTypeCode = #{netordertypecode,jdbcType=VARCHAR},
            person = #{person,jdbcType=INTEGER},
            createBy = #{createby,jdbcType=VARCHAR},
            isCreatedByLoginUser = #{iscreatedbyloginuser,jdbcType=BIT},
            waiterBy = #{waiterby,jdbcType=VARCHAR},
            startTime = #{starttime,jdbcType=BIGINT},
            checkoutTime = #{checkouttime,jdbcType=BIGINT},
            checkoutBy = #{checkoutby,jdbcType=VARCHAR},
            orderStatus = #{orderstatus,jdbcType=TINYINT},
            isTestOrder = #{istestorder,jdbcType=TINYINT},
            orderMD5 = #{ordermd5,jdbcType=VARCHAR},
            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},
            moneyWipeZeroType = #{moneywipezerotype,jdbcType=TINYINT},
            specialStatAmount = #{specialstatamount,jdbcType=DECIMAL},
            promotionAmount = #{promotionamount,jdbcType=DECIMAL},
            promotionDesc = #{promotiondesc,jdbcType=VARCHAR},
            paidAmount = #{paidamount,jdbcType=DECIMAL},
            invoiceBy = #{invoiceby,jdbcType=VARCHAR},
            invoiceTaxpayerIdentCode = #{invoicetaxpayeridentcode,jdbcType=VARCHAR},
            invoiceAmount = #{invoiceamount,jdbcType=DECIMAL},
            invoiceTaxRate = #{invoicetaxrate,jdbcType=DECIMAL},
            invoiceTaxAmount = #{invoicetaxamount,jdbcType=DECIMAL},
            userName = #{username,jdbcType=VARCHAR},
            userSex = #{usersex,jdbcType=TINYINT},
            userMobile = #{usermobile,jdbcType=VARCHAR},
            userAddress = #{useraddress,jdbcType=VARCHAR},
            YJZCount = #{yjzcount,jdbcType=INTEGER},
            FJZCount = #{fjzcount,jdbcType=INTEGER},
            alertFlagLst = #{alertflaglst,jdbcType=VARCHAR},
            foodAlert = #{foodalert,jdbcType=VARCHAR},
            payAlert = #{payalert,jdbcType=VARCHAR},
            saasOrderRemark = #{saasorderremark,jdbcType=VARCHAR},
            deviceKey = #{devicekey,jdbcType=VARCHAR},
            deviceCode = #{devicecode,jdbcType=VARCHAR},
            deviceName = #{devicename,jdbcType=VARCHAR},
            deviceGroupID = #{devicegroupid,jdbcType=VARCHAR},
            deviceGroupName = #{devicegroupname,jdbcType=VARCHAR},
            serverMAC = #{servermac,jdbcType=VARCHAR},
            reviewBy = #{reviewby,jdbcType=VARCHAR},
            reviewTime = #{reviewtime,jdbcType=BIGINT},
            shiftTime = #{shifttime,jdbcType=VARCHAR},
            actionTime = #{actiontime,jdbcType=BIGINT},
            createTime = #{createtime,jdbcType=BIGINT},
            uploadTime = #{uploadtime,jdbcType=BIGINT},
            shiftName = #{shiftname,jdbcType=VARCHAR},
            deliverSource = #{deliversource,jdbcType=TINYINT},
            deliverFee = #{deliverfee,jdbcType=DECIMAL},
            action = #{action,jdbcType=TINYINT},
            billMD5 = #{billmd5,jdbcType=VARCHAR},
            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},
            partition_id = #{partitionId,jdbcType=INTEGER},
            offset = #{offset,jdbcType=BIGINT},
            invoiceTitle = #{invoicetitle,jdbcType=LONGVARCHAR},
            modifyOrderLog = #{modifyorderlog,jdbcType=LONGVARCHAR},
            foodNameDetail = #{foodnamedetail,jdbcType=LONGVARCHAR}
        where itemID = #{itemid,jdbcType=INTEGER}
          and reportDate = #{reportdate,jdbcType=BIGINT}
          and saasOrderKey = #{saasorderkey,jdbcType=VARCHAR}
          and shopID = #{shopid,jdbcType=BIGINT}
    </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},
            shopName = #{shopname,jdbcType=VARCHAR},
            saasOrderNo = #{saasorderno,jdbcType=VARCHAR},
            saasDeviceOrderNo = #{saasdeviceorderno,jdbcType=VARCHAR},
            lockedFlag = #{lockedflag,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},
            channelUserImage = #{channeluserimage,jdbcType=VARCHAR},
            channelOrderTime = #{channelordertime,jdbcType=VARCHAR},
            orderSubType = #{ordersubtype,jdbcType=TINYINT},
            netOrderTypeCode = #{netordertypecode,jdbcType=VARCHAR},
            person = #{person,jdbcType=INTEGER},
            createBy = #{createby,jdbcType=VARCHAR},
            isCreatedByLoginUser = #{iscreatedbyloginuser,jdbcType=BIT},
            waiterBy = #{waiterby,jdbcType=VARCHAR},
            startTime = #{starttime,jdbcType=BIGINT},
            checkoutTime = #{checkouttime,jdbcType=BIGINT},
            checkoutBy = #{checkoutby,jdbcType=VARCHAR},
            orderStatus = #{orderstatus,jdbcType=TINYINT},
            isTestOrder = #{istestorder,jdbcType=TINYINT},
            orderMD5 = #{ordermd5,jdbcType=VARCHAR},
            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},
            moneyWipeZeroType = #{moneywipezerotype,jdbcType=TINYINT},
            specialStatAmount = #{specialstatamount,jdbcType=DECIMAL},
            promotionAmount = #{promotionamount,jdbcType=DECIMAL},
            promotionDesc = #{promotiondesc,jdbcType=VARCHAR},
            paidAmount = #{paidamount,jdbcType=DECIMAL},
            invoiceBy = #{invoiceby,jdbcType=VARCHAR},
            invoiceTaxpayerIdentCode = #{invoicetaxpayeridentcode,jdbcType=VARCHAR},
            invoiceAmount = #{invoiceamount,jdbcType=DECIMAL},
            invoiceTaxRate = #{invoicetaxrate,jdbcType=DECIMAL},
            invoiceTaxAmount = #{invoicetaxamount,jdbcType=DECIMAL},
            userName = #{username,jdbcType=VARCHAR},
            userSex = #{usersex,jdbcType=TINYINT},
            userMobile = #{usermobile,jdbcType=VARCHAR},
            userAddress = #{useraddress,jdbcType=VARCHAR},
            YJZCount = #{yjzcount,jdbcType=INTEGER},
            FJZCount = #{fjzcount,jdbcType=INTEGER},
            alertFlagLst = #{alertflaglst,jdbcType=VARCHAR},
            foodAlert = #{foodalert,jdbcType=VARCHAR},
            payAlert = #{payalert,jdbcType=VARCHAR},
            saasOrderRemark = #{saasorderremark,jdbcType=VARCHAR},
            deviceKey = #{devicekey,jdbcType=VARCHAR},
            deviceCode = #{devicecode,jdbcType=VARCHAR},
            deviceName = #{devicename,jdbcType=VARCHAR},
            deviceGroupID = #{devicegroupid,jdbcType=VARCHAR},
            deviceGroupName = #{devicegroupname,jdbcType=VARCHAR},
            serverMAC = #{servermac,jdbcType=VARCHAR},
            reviewBy = #{reviewby,jdbcType=VARCHAR},
            reviewTime = #{reviewtime,jdbcType=BIGINT},
            shiftTime = #{shifttime,jdbcType=VARCHAR},
            actionTime = #{actiontime,jdbcType=BIGINT},
            createTime = #{createtime,jdbcType=BIGINT},
            uploadTime = #{uploadtime,jdbcType=BIGINT},
            shiftName = #{shiftname,jdbcType=VARCHAR},
            deliverSource = #{deliversource,jdbcType=TINYINT},
            deliverFee = #{deliverfee,jdbcType=DECIMAL},
            action = #{action,jdbcType=TINYINT},
            billMD5 = #{billmd5,jdbcType=VARCHAR},
            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},
            partition_id = #{partitionId,jdbcType=INTEGER},
            offset = #{offset,jdbcType=BIGINT}
        where itemID = #{itemid,jdbcType=INTEGER}
          and reportDate = #{reportdate,jdbcType=BIGINT}
          and saasOrderKey = #{saasorderkey,jdbcType=VARCHAR}
          and shopID = #{shopid,jdbcType=BIGINT}
    </update>
    
    <select id="selectList" parameterType="map" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from
        tbl_bill_master
        where
        orderStatus = 40
        and userMobile != ""
        and itemID > #{lastId}
        order by itemID asc
        LIMIT #{size}
    </select>
</mapper>