소스 검색

fix 计费单商品

he2802 3 년 전
부모
커밋
ea4b1df1d4
1개의 변경된 파일14개의 추가작업 그리고 7개의 파일을 삭제
  1. 14 7
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml

+ 14 - 7
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml

@@ -54,9 +54,20 @@
         <result property="schoolName" column="school_name"/>
         <result property="categoryName" column="category_name"/>
         <result property="subjectName" column="subject_name"/>
-        <collection property="goodsList" javaType="java.util.List" resultMap="CourseGoodsListResult"/>
+        <collection property="goodsList" column="course_id" select="findGoodsList"/>
     </resultMap>
 
+    <select id="findGoodsList" resultMap="CourseChapterSectionListResult">
+        SELECT
+            g.goods_name,
+            g.goods_id
+        FROM
+            goods_course gc
+                 LEFT JOIN goods g ON gc.goods_id = g.goods_id
+        WHERE
+            gc.course_id =#{course_id}
+    </select>
+
     <resultMap type="com.zhongzheng.modules.course.vo.CourseGoodsVo" id="CourseGoodsListResult">
         <result property="goodsName" column="goods_name"/>
         <result property="goodsId" column="goods_id"/>
@@ -70,9 +81,8 @@
         cb.business_name,
         s.school_name,
         m.category_name,
-        cs.subject_name,
-        g.goods_name,
-        g.goods_id
+        cs.subject_name
+
         FROM
         course c
         LEFT JOIN course_education_type cet ON c.education_type_id = cet.id
@@ -81,8 +91,6 @@
         LEFT JOIN school s ON s.id = c.school_id
         LEFT JOIN major m ON c.major_id = m.id
         LEFT JOIN course_subject cs ON cs.id = c.subject_id
-        LEFT JOIN goods_course gc ON gc.course_id = c.course_id
-        LEFT JOIN goods g ON gc.goods_id = g.goods_id
         WHERE
         1 = 1
         <if test="status != null and status.size()!=0 ">
@@ -91,7 +99,6 @@
                 #{item}
             </foreach>
         </if>
-
         <if test="educationTypeId != null and educationTypeId != ''">
             AND c.education_type_id = #{educationTypeId}
         </if>