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

    <resultMap id="OrderItemMap" type="com.zm.order.tool.server.model.IdMap">
        <id column="ignore_id" jdbcType="BIGINT" property="ignoreId"/>
        <result column="import_id" jdbcType="BIGINT" property="importId"/>
        <result column="phone" jdbcType="VARCHAR" property="phone"/>
    </resultMap>

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

    <sql id="cols_all">
        ignore_id,
        import_id,
        phone
    </sql>

    <select id="selectOne" parameterType="map" resultMap="OrderItemMap">
        select
        <include refid="cols_all"/>
        from
        <include refid="tb"/>
        where ignore_id = #{ignoreId} limit 1
    </select>

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