From 6348642a70582ddc09ab011d35139d6a1275a948 Mon Sep 17 00:00:00 2001 From: wangxy <1356089412@qq.com> Date: Thu, 4 Jul 2024 15:01:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=9A=8F=E6=9C=BA=E9=A2=98=E5=BA=93sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/web/controller/manager/PaperManager.java | 2 +- ruoyi-system/src/main/resources/mapper/system/ElQuMapper.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/PaperManager.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/PaperManager.java index 16ec36a..5b12040 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/PaperManager.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/manager/PaperManager.java @@ -290,7 +290,7 @@ public class PaperManager { //回答列表 QueryWrapper wrapper = new QueryWrapper<>(); wrapper.lambda().eq(ElQuAnswer::getQuId, item.getQuId()); - wrapper.last(" ORDER BY RAND() "); + wrapper.last(" ORDER BY RANDOM() "); List answerList = quAnswerService.list(wrapper); if (CollUtil.isNotEmpty(answerList)) { int ii = 0; diff --git a/ruoyi-system/src/main/resources/mapper/system/ElQuMapper.xml b/ruoyi-system/src/main/resources/mapper/system/ElQuMapper.xml index 5758648..aab4e6c 100644 --- a/ruoyi-system/src/main/resources/mapper/system/ElQuMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/ElQuMapper.xml @@ -51,7 +51,7 @@ AND a.id NOT IN '${item}' - ORDER BY RAND() + ORDER BY RANDOM() LIMIT ${size}