<select id="getMaxIdOfLimitedCdr" parameterType="map"
resultType="int">
<![CDATA[
SELECT
MAX(id)
FROM
(
SELECT id
FROM ${tableName} limit #{startIndex},#{limitCount}
) AS tmp
]]>
</select>