<select id="selectJqgridList" parameterType="jqgridVO" resultType="egovMap">
SELECT a.*
FROM (
SELECT a.*,
ROWNUM rnum,
FLOOR((ROWNUM - 1) /#{rows} + 1) pageNumber
FROM (
SELECT seq
, name
, phone
, address
, etcc
, gender
FROM jqgrid_start
WHERE 1=1
<if test='serviceImplYn != null'>
<choose>
<when test='serviceImplYn == "A"'>
AND name = 'dddd'
</when>
<when test='serviceImplYn == "B"'>
AND name = 'shink'
</when>
<when test='serviceImplYn == "D"'>
AND name = 'rrrr'
</when>
<otherwise>
</otherwise>
</choose>
</if>
ORDER BY seq ASC
) a
) a
WHERE a.pageNumber = #{page}
order by a.rnum
</select>
<select id="selectJqgridListCnt" parameterType="jqgridVO" resultType="egovMap">
SELECT count(*) totalTotCnt
, CEIL(count(*) / #{rows}) totalPage
FROM jqgrid_start
WHERE 1=1
ORDER BY seq ASC
</select>
출처: https://pjh3749.tistory.com/154 [JayTech의 기술 블로그]