he2802 3 år sedan
förälder
incheckning
2cf0b7ec7b

+ 46 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/course/CourseMenuExamController.java

@@ -0,0 +1,46 @@
+package com.zhongzheng.controller.course;
+
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.modules.course.bo.CourseMenuExamQueryBo;
+import com.zhongzheng.modules.course.service.ICourseMenuExamService;
+import com.zhongzheng.modules.course.vo.CourseMenuExamVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 课程目录关联卷Controller
+ *
+ * @author hjl
+ * @date 2021-11-17
+ */
+@Api(value = "课程目录关联卷控制器", tags = {"课程目录关联卷管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/course/menu/exam")
+public class CourseMenuExamController extends BaseController {
+
+    private final ICourseMenuExamService iCourseMenuExamService;
+
+    /**
+     * 查询课程目录关联卷列表
+     */
+    @ApiOperation("查询课程目录关联卷列表")
+    @GetMapping("/list")
+    public TableDataInfo<CourseMenuExamVo> list(CourseMenuExamQueryBo bo) {
+        startPage();
+        List<CourseMenuExamVo> list = iCourseMenuExamService.getList(bo);
+        return getDataTable(list);
+    }
+
+
+
+}

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseMenuExamVo.java

@@ -50,4 +50,8 @@ public class CourseMenuExamVo {
 	private Long examId;
 	@ApiModelProperty("卷名称")
 	private String examName;
+	/** 做卷类型  1测试 2考试 */
+	@Excel(name = "做卷类型  1测试 2考试")
+	@ApiModelProperty("做题类型  1测试 2考试")
+	private Integer doType;
 }

+ 9 - 2
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMenuExamMapper.xml

@@ -25,17 +25,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="type" column="type"/>
         <result property="examId" column="exam_id"/>
         <result property="examName" column="exam_name"/>
+        <result property="doType" column="do_type"/>
     </resultMap>
 
     <select id="getList" parameterType="com.zhongzheng.modules.course.bo.CourseMenuExamQueryBo" resultMap="CourseMenuExamVoResult">
         SELECT
             cme.*,
-            e.exam_name
+            e.exam_name,
+            e.do_type
         FROM
             course_menu_exam cme
                 LEFT JOIN exam e ON cme.exam_id = e.exam_id
-                AND cme.type = 1
         where cme.course_id = #{courseId}
+        <if test="chapterId != null and chapterId != ''">
+            AND cme.chapter_id = #{chapterId}
+        </if>
+        <if test="moduleId != null and moduleId != ''">
+            AND cme.module_id = #{moduleId}
+        </if>
     </select>
 
 </mapper>