收藏考试优化
This commit is contained in:
parent
24c324ea36
commit
3b5a5545fa
|
|
@ -32,6 +32,8 @@ public class ApiPracticeController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private IExamQuestionService examQuestionService;
|
private IExamQuestionService examQuestionService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService sysUserService;
|
||||||
/**
|
/**
|
||||||
* 查询练习列表
|
* 查询练习列表
|
||||||
* @param examPractice
|
* @param examPractice
|
||||||
|
|
@ -55,6 +57,8 @@ public class ApiPracticeController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping("/v1/practice/info")
|
@GetMapping("/v1/practice/info")
|
||||||
public AjaxResult queryOne(@RequestParam Map<String, Object> map) {
|
public AjaxResult queryOne(@RequestParam Map<String, Object> map) {
|
||||||
|
SysUser sysUser = sysUserService.selectUserByLoginName( JwtUtil.getLoginName() );
|
||||||
|
map.put( "vipUserId", sysUser.getUserId() );
|
||||||
List<ExamQuestionVO> result = examQuestionService.selectQuestionListByPracticeId(map);
|
List<ExamQuestionVO> result = examQuestionService.selectQuestionListByPracticeId(map);
|
||||||
if (map.containsKey("disorder") && map.get("disorder").toString().equals("1")) {
|
if (map.containsKey("disorder") && map.get("disorder").toString().equals("1")) {
|
||||||
Collections.shuffle(result);
|
Collections.shuffle(result);
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ public class ExamPracticeQuestionVO extends ExamPracticeQuestion {
|
||||||
|
|
||||||
private String questionName;
|
private String questionName;
|
||||||
|
|
||||||
|
|
||||||
public Integer getQuestionType() {
|
public Integer getQuestionType() {
|
||||||
return questionType;
|
return questionType;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,15 @@ import java.util.List;
|
||||||
public class ExamQuestionVO extends ExamQuestion{
|
public class ExamQuestionVO extends ExamQuestion{
|
||||||
private List<ExamQuestionItem> questionItem;
|
private List<ExamQuestionItem> questionItem;
|
||||||
|
|
||||||
|
private String examUserCollectionQuestionId;
|
||||||
|
|
||||||
|
public String getExamUserCollectionQuestionId() {
|
||||||
|
return examUserCollectionQuestionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExamUserCollectionQuestionId(String examUserCollectionQuestionId) {
|
||||||
|
this.examUserCollectionQuestionId = examUserCollectionQuestionId;
|
||||||
|
}
|
||||||
public List<ExamQuestionItem> getQuestionItem() {
|
public List<ExamQuestionItem> getQuestionItem() {
|
||||||
return questionItem;
|
return questionItem;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="updateDate" column="update_date" />
|
<result property="updateDate" column="update_date" />
|
||||||
<result property="remarks" column="remarks" />
|
<result property="remarks" column="remarks" />
|
||||||
<result property="delFlag" column="del_flag" />
|
<result property="delFlag" column="del_flag" />
|
||||||
|
<result property="examUserCollectionQuestionId" column="examUserCollectionQuestionId" />
|
||||||
|
|
||||||
<collection property="questionItem" ofType="com.ruoyi.exam.domain.ExamQuestionItem">
|
<collection property="questionItem" ofType="com.ruoyi.exam.domain.ExamQuestionItem">
|
||||||
<result property="id" column="item_id" />
|
<result property="id" column="item_id" />
|
||||||
<result property="content" column="item_content" />
|
<result property="content" column="item_content" />
|
||||||
|
|
@ -102,7 +104,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
eqi.number AS item_number,
|
eqi.number AS item_number,
|
||||||
eqi.exam_question_id AS item_exam_question_id,
|
eqi.exam_question_id AS item_exam_question_id,
|
||||||
eqi.remarks AS item_remarks
|
eqi.remarks AS item_remarks
|
||||||
|
|
||||||
|
<if test="vipUserId != null and vipUserId != '' "> ,eucq.id as examUserCollectionQuestionId</if>
|
||||||
|
|
||||||
from exam_question eq
|
from exam_question eq
|
||||||
|
|
||||||
|
<if test="vipUserId != null and vipUserId != '' ">
|
||||||
|
left join exam_user_collection_question eucq on eucq.exam_question_id=eq.id and eucq.vip_user_id=#{vipUserId}
|
||||||
|
</if>
|
||||||
|
|
||||||
INNER JOIN exam_practice_question epq ON eq.id = epq.exam_question_id
|
INNER JOIN exam_practice_question epq ON eq.id = epq.exam_question_id
|
||||||
INNER JOIN exam_question_item eqi ON eqi.exam_question_id = eq.id
|
INNER JOIN exam_question_item eqi ON eqi.exam_question_id = eq.id
|
||||||
where epq.exam_practice_id = #{practiceId}
|
where epq.exam_practice_id = #{practiceId}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue