change 3 лет назад
Родитель
Сommit
fe288f8041

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/vo/InformCourseVo.java

@@ -53,6 +53,13 @@ public class InformCourseVo {
 	@Excel(name = "商品名")
 	@ApiModelProperty("商品名")
 	private String goodsName;
+	@Excel(name = "商品id")
+	@ApiModelProperty("商品id")
+	private Long goodsId;
+
+	@Excel(name = "科目iD")
+	@ApiModelProperty("科目iD")
+	private Long subjectId;
 
 	@Excel(name = "科目名")
 	@ApiModelProperty("科目名")

+ 6 - 2
zhongzheng-system/src/main/resources/mapper/modules/inform/InformCourseMapper.xml

@@ -26,14 +26,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="subjectName" column="subject_name"/>
         <result property="chapterName" column="chapter_name"/>
         <result property="moduleName" column="module_name"/>
+        <result property="goodsId" column="goods_id"/>
+        <result property="subjectId" column="subject_id"/>
+        <result property="subjectName" column="subject_name"/>
         <result property="sectionName" column="section_name"/>
     </resultMap>
 
     <select id="queryCourse" parameterType="long" resultMap="InformCourseVo">
         SELECT
         ic.*,
-        (SELECT g.goods_name FROM goods g where g.goods_id = ic.goods_id) as goods_name
-
+        (SELECT g.goods_name FROM goods g where g.goods_id = ic.goods_id) as goods_name,
+        (SELECT cs.subject_name FROM course_subject cs LEFT JOIN course c on c.subject_id = cs.id where c.course_id = ic.course_id) as subject_name,
+        (SELECT cs.id FROM course_subject cs LEFT JOIN course c on c.subject_id = cs.id where c.course_id = ic.course_id) as subject_id
         FROM
         inform_course ic
         WHERE