| | |
| | | |
| | | @RequestMapping(value = "/page", method = RequestMethod.POST) |
| | | public Result<PageInfo<QuestionResponseVO>> pageList(@RequestBody QuestionPageRequestVO model) { |
| | | model.setTitle(model.getContent()); |
| | | model.setContent(null); |
| | | PageInfo<QuestionResponseVO> pageInfo = questionService.page(model); |
| | | PageInfo<QuestionResponseVO> page = PageInfoHelper.copyMap(pageInfo, q -> { |
| | | QuestionResponseVO vo = new QuestionResponseVO(); |
| | |
| | | |
| | | private String content; |
| | | |
| | | private String title; |
| | | |
| | | } |
| | |
| | | for (PaperSettingItem settingItem : settingList) { |
| | | Integer num = settingItem.getNum(); |
| | | Integer difficult = settingItem.getDifficult(); |
| | | if(difficult == 0){ |
| | | difficult = null; |
| | | } |
| | | //需要配置的题目数量为0则跳过 |
| | | if (num == null || num == 0) continue; |
| | | List<Question> questions = questionMapper.getRandomQuestion(settingItem.getSubjectId(), paperSetting.getQuestionType(), difficult, settingItem.getNum()); |
| | |
| | | <if test="content != null and content != ''"> |
| | | and instr(tq.content, #{content}) |
| | | </if> |
| | | <if test="title != null and title != ''"> |
| | | and title like CONCAT('%', #{title}, '%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |