java.util.NoSuchElementException 报错
前端传的参数如下
{"accountId":105,"topicSetId":62,"topicTypeId":2,"serialNumber":null,"limit":10,"pageOffset":0}
然后后端是这样计算分页偏移量的,
queryObjectSubmitDTO.setPageOffset((queryObjectSubmitDTO.getPageOffset()-1)*queryObjectSubmitDTO.getLimit());
算完pageOffset为-10传进sql所以就会报错
SELECT qt.topic_fraction as judgePointScore, js.situation_name as situationName ,qt.topic_title as topicSerial,tic.topic_name topicName FROM
<if test="topicTypeId == 1">
`judge_new` jn,
`topic_judge` tic,
</if>
<if test="topicTypeId == 2">
`single_options_new` jn,
`topic_singleoptions` tic,
</if>
<if test="topicTypeId == 3">
`multiple_options_new` jn,
`topic_doubleoptions` tic,
</if>
<if test="topicTypeId == 4">
`fill_new` jn,
`topic_fill` tic,
</if>
(SELECT topic_title , qtopicset_id ,topic_fraction , topic_id FROM `qtopicset_topic` WHERE topicset_id= #{topicSetId} and topic_typeid = #{topicTypeId}) qt
,judge_situation as js
WHERE jn.qtopicset_id = qt.qtopicset_id AND jn.account_id= #{accountId} and tic.topic_id = qt.topic_id and js.situation_id = jn.situation_id
order by topicSerial
<if test="pageOffset != null and limit != null">
LIMIT #{pageOffset},#{limit}
</if>
,