SELECT
ROWNUM
, COUNT (TEST_SEQ) OVER () TOTAL_CNT
, COUNT ( TEST _SEQ) OVER () - ROWNUM + 1 display_no
FROM TEST _STUDENT CS
AND TOTAL_CNT + 1 - display_no > ( ('1' - 1)*'10' )
AND ( ('1' - 1)*'10' ) + '10' >= TOTAL_CNT + 1 - display_no
<!-- currentPage 가 -1 일 경우 전체 검색. -->
<if test="startNum != null and numPerPage != null and currentPage != null and currentPage != -1">
<if test='( (currentPage - 1)*numPerPage ) < 0 '>
AND TOTAL_CNT + 1 - display_no > 0
AND 0 + #{numPerPage} >= TOTAL_CNT + 1 - display_no
</if>
<if test='( (currentPage - 1)*numPerPage ) > -1 '>
AND TOTAL_CNT + 1 - display_no > ( (#{currentPage} - 1)*#{numPerPage} )
AND ( (#{currentPage} - 1)*#{numPerPage} ) + #{numPerPage} >= TOTAL_CNT + 1 - display_no
</if>
</if>
paginationInfo.setTotalRecordCount(testList.isEmpty() ? 0 : Integer.parseInt( testList.get(0).get("totalCnt").toString()));