yangdamao 3 주 전
부모
커밋
405129f0a5
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

@@ -5028,7 +5028,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
         examQuestion.setQuestionId(questionId);
         //获取最新排序
         Integer sort = 0;
-        ExamQuestion one = iExamQuestionService.getOne(new LambdaUpdateWrapper<ExamQuestion>().eq(ExamQuestion::getExamId, examId).orderByDesc(ExamQuestion::getSort));
+        ExamQuestion one = iExamQuestionService.getOne(new LambdaUpdateWrapper<ExamQuestion>().eq(ExamQuestion::getExamId, examId).orderByDesc(ExamQuestion::getSort).last("limit 1"));
         if (ObjectUtils.isNotNull(one)){
             sort = one.getSort() +1;
         }