<?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.tempdb.OrderNuoWaDao">

    <resultMap id="JuiceOrderMap" type="com.zm.order.tool.server.model.OrderNuoWa">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="store_id" jdbcType="BIGINT" property="storeId"/>
        <result column="type" jdbcType="VARCHAR" property="type"/>
        <result column="productfee" jdbcType="DECIMAL" property="productfee"/>
        <result column="deliveryfee" jdbcType="DECIMAL" property="deliveryfee"/>
        <result column="preoff" jdbcType="DECIMAL" property="preoff"/>
        <result column="totalfee" jdbcType="INTEGER" property="totalfee"/>
        <result column="outtradeno" jdbcType="VARCHAR" property="outtradeno"/>
        <result column="shtime" jdbcType="VARCHAR" property="shtime"/>
        <result column="pay_time" jdbcType="VARCHAR" property="payTime"/>
        <result column="qmai_user_id" jdbcType="BIGINT" property="qmaiUserId"/>
        <result column="mobile" jdbcType="VARCHAR" property="mobile"/>
        <result column="order_type" jdbcType="INTEGER" property="orderType"/>

    </resultMap>

    <sql id="tb">
        nuowa_order
    </sql>

    <sql id="cols_all">
        id,
        store_id,
        type,
        productfee,
        deliveryfee,
        preoff,
        totalfee,
        outtradeno,
         shtime,
        pay_time,
        qmai_user_id,
        mobile,
        order_type
    </sql>

    <select id="selectList" parameterType="map" resultMap="JuiceOrderMap">
        select
        <include refid="cols_all"/>
        from
        <include refid="tb"/>
        <where>
            <if test="lastId != null">
                id > #{lastId}
            </if>
        </where>
            order by id asc limit #{size}
    </select>
</mapper>