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

    <resultMap id="OrderItemMap" type="com.zm.order.tool.server.model.OrderNo">
        <id column="id" jdbcType="INTEGER" property="id"/>
        <id column="order_no" jdbcType="VARCHAR" property="orderNo"/>
    </resultMap>

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

    <sql id="cols_all">
        id,
        order_no
    </sql>

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