<?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.OrderWuYinDao">

    <resultMap id="JuiceOrderMap" type="com.zm.order.tool.server.model.OrderWuyin">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="store_id" jdbcType="BIGINT" property="storeId"/>
        <result column="order_code" jdbcType="VARCHAR" property="orderCode"/>
        <result column="mobile" jdbcType="VARCHAR" property="mobile"/>
        <result column="user_id" jdbcType="BIGINT" property="userId"/>
        <result column="discount_amount" jdbcType="DECIMAL" property="discountAmount"/>
        <result column="pay_amount" jdbcType="DECIMAL" property="payAmount"/>
        <result column="total_amount" jdbcType="DECIMAL" property="totalAmount"/>
        <result column="order_at" jdbcType="TIMESTAMP" property="orderAt"/>
        <result column="order_type" jdbcType="INTEGER" property="orderType"/>
        <result column="status_txt" jdbcType="VARCHAR" property="statusTxt"/>
        <result column="pay_type" jdbcType="INTEGER" property="payType"/>
        <result column="source" jdbcType="INTEGER" property="source"/>
        <result column="freight_amount" jdbcType="DECIMAL" property="freightAmount"/>

    </resultMap>

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

    <sql id="cols_all">
        id,
        store_id,
        order_code,
        mobile,
        user_id,
        discount_amount,
        pay_amount,
        total_amount,
        order_at,
        order_type,
        status_txt,
        pay_type,
        source,
        freight_amount
    </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>