feat:修改查询随机题库sql

pg_adapter
wangxy 9 months ago
parent e093d88d36
commit 6348642a70

@ -290,7 +290,7 @@ public class PaperManager {
//回答列表 //回答列表
QueryWrapper<ElQuAnswer> wrapper = new QueryWrapper<>(); QueryWrapper<ElQuAnswer> wrapper = new QueryWrapper<>();
wrapper.lambda().eq(ElQuAnswer::getQuId, item.getQuId()); wrapper.lambda().eq(ElQuAnswer::getQuId, item.getQuId());
wrapper.last(" ORDER BY RAND() "); wrapper.last(" ORDER BY RANDOM() ");
List<ElQuAnswer> answerList = quAnswerService.list(wrapper); List<ElQuAnswer> answerList = quAnswerService.list(wrapper);
if (CollUtil.isNotEmpty(answerList)) { if (CollUtil.isNotEmpty(answerList)) {
int ii = 0; int ii = 0;

@ -51,7 +51,7 @@
AND a.id NOT IN AND a.id NOT IN
<foreach item="item" collection="excludes" separator="," open="(" close=")" index="">'${item}'</foreach> <foreach item="item" collection="excludes" separator="," open="(" close=")" index="">'${item}'</foreach>
</if> </if>
ORDER BY RAND() ORDER BY RANDOM()
LIMIT ${size} LIMIT ${size}
</select> </select>

Loading…
Cancel
Save