<?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.newchen.OrderMasterDao">
    <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="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>

