Browse Source

获取试题关联知识点

tags/正式3.10.2
王宁 1 year ago
parent
commit
2e8017b460

+ 16
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/controller/question/QuestionController.java View File

@@ -153,4 +153,20 @@ public class QuestionController {
153 153
         Map map = tQuestionService.saveUpdateQuestion(question);
154 154
         return new ResultVo(0, "保存成功",map);
155 155
     }
156
+
157
+    /*
158
+     * @Description 获取试题关联知识点
159
+     * @Date 2023/8/28 15:32:38
160
+     * @Author WN
161
+     * @Param [question]
162
+     * @Return com.xhkjedu.vo.ResultVo
163
+     **/
164
+    @PostMapping("/qpoints")
165
+    public ResultVo listQuestionPoints(@RequestBody TQuestion question) {
166
+        N_Utils.validation(new Object[]{question.getQuestionid(),"试题id",2 });
167
+
168
+        List<Map> list = tQuestionService.listPointsByQuestionid(question.getQuestionid());
169
+        return new ResultVo(0, "保存成功",list);
170
+    }
171
+
156 172
 }

+ 3
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/mapper/question/QuestionPointMapper.java View File

@@ -5,6 +5,7 @@ import com.xhkjedu.sstudy.model.question.TQuestionPoint;
5 5
 import org.apache.ibatis.annotations.Param;
6 6
 
7 7
 import java.util.List;
8
+import java.util.Map;
8 9
 
9 10
 public interface QuestionPointMapper extends TkMapper<TQuestionPoint> {
10 11
     /**
@@ -17,4 +18,6 @@ public interface QuestionPointMapper extends TkMapper<TQuestionPoint> {
17 18
     Integer deleteByQuestionId(@Param("questionid") String questionid);
18 19
 
19 20
     void batchSave(@Param("list") List<TQuestionPoint> questionPoints);
21
+
22
+    List<Map> listPointsByQuestionid(@Param("questionid") String questionid);
20 23
 }

+ 11
- 0
sstudy/src/main/java/com/xhkjedu/sstudy/service/question/QuestionService.java View File

@@ -464,4 +464,15 @@ public class QuestionService {
464 464
             }
465 465
         }
466 466
     }
467
+
468
+    /*
469
+     * @Description 获取试题关联知识点
470
+     * @Date 2023/8/28 15:30:01
471
+     * @Author WN
472
+     * @Param [questionid]
473
+     * @Return java.util.Map
474
+     **/
475
+    public List<Map> listPointsByQuestionid(String questionid) {
476
+        return questionPointMapper.listPointsByQuestionid(questionid);
477
+    }
467 478
 }

+ 7
- 0
sstudy/src/main/resources/mapper/question/QuestionPointMapper.xml View File

@@ -13,4 +13,11 @@
13 13
             (#{p.qpid},#{p.questionid},#{p.pointid},#{p.createid},#{p.createtime})
14 14
         </foreach>
15 15
     </insert>
16
+
17
+    <!--试题关联知识点-->
18
+    <select id="listPointsByQuestionid" resultType="java.util.Map">
19
+        select qp.pointid,p.pointname from t_question_point qp
20
+        left join t_point p on qp.pointid=p.pointid
21
+        where qp.questionid=#{questionid} order by p.pointorder
22
+    </select>
16 23
 </mapper>

Loading…
Cancel
Save