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

    <resultMap id="ResultMap" type="com.zm.order.tool.server.model.BaoZhu">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="mobile" jdbcType="VARCHAR" property="mobile"/>
        <result column="user_id" jdbcType="BIGINT" property="userId"/>
        <result column="store_id" jdbcType="BIGINT" property="storeId"/>
        <result column="store_name" jdbcType="VARCHAR" property="storeName"/>
        <result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
        <result column="status_txt" jdbcType="VARCHAR" property="statusTxt"/>
        <result column="pay_status_txt" jdbcType="VARCHAR" property="payStatusTxt"/>
        <result column="item_name" jdbcType="VARCHAR" property="itemName"/>
        <result column="item_price" jdbcType="DECIMAL" property="itemPrice"/>
        <result column="num" jdbcType="INTEGER" property="num"/>
        <result column="price" jdbcType="DECIMAL" property="price"/>
        <result column="order_no" jdbcType="VARCHAR" property="orderNo"/>
        <result column="source_no" jdbcType="VARCHAR" property="sourceNo"/>
    </resultMap>

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

    <sql id="cols_all">
        id,
        mobile,
        user_id,
        store_id,
        store_name,
        created_at,
        pay_status_txt,
        item_name,
        item_price,
        num,
        price,
        order_no,
        source_no
    </sql>

    <select id="selectList" parameterType="map" resultMap="ResultMap">
        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>