Sfoglia il codice sorgente

fix 计费单商品

he2802 3 anni fa
parent
commit
edf829ba56

+ 3 - 2
zhongzheng-system/src/main/resources/mapper/modules/bank/QuestionMapper.xml

@@ -125,7 +125,7 @@
 
     <select id="selectList_COUNT" resultType="Long">
         SELECT
-        count(distinct q.question_id)
+        count(q.question_id)
         FROM
         question q
         LEFT JOIN question_business qb ON q.question_id = qb.major_id and qb.type = 1
@@ -150,6 +150,7 @@
         <if test="prefixName != null and prefixName != ''">
             AND q.prefix_name like concat('%', #{prefixName}, '%')
         </if>
-
+        GROUP BY
+        q.question_id
     </select>
 </mapper>

+ 3 - 5
zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterMapper.xml

@@ -117,10 +117,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         cc.chapter_id
         ) c
         LEFT JOIN course_chapter_business ccb ON ccb.chapter_id = c.chapter_id
-        LEFT JOIN course_education_type cet ON ccb.education_type_id = cet.id
-        LEFT JOIN course_project_type cpt ON ccb.project_id = cpt.id
-        LEFT JOIN course_business cb ON ccb.business_id = cb.id
-        LEFT JOIN course_subject cs ON ccb.subject_id = cs.id
         WHERE
         1 = 1
         <if test="status != null and status.size()!=0 ">
@@ -155,7 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectList_COUNT" resultType="Long">
         SELECT
-        count( DISTINCT c.chapter_id )
+        count(c.chapter_id )
         FROM
         course_chapter  c
         LEFT JOIN course_chapter_business ccb ON c.chapter_id = ccb.chapter_id
@@ -185,5 +181,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="prefixName != null and prefixName != ''">
             AND c.prefix_name like concat('%', #{prefixName}, '%')
         </if>
+        GROUP BY
+        c.chapter_id
     </select>
 </mapper>

+ 45 - 25
zhongzheng-system/src/main/resources/mapper/modules/course/CourseSectionMapper.xml

@@ -39,12 +39,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="durationTime" column="duration_time"/>
         <result property="coverUrl" column="cover_url"/>
         <result property="code" column="code"/>
-        <collection property="businessList" javaType="java.util.List" resultMap="CourseSectionBusiness"/>
-        <collection property="chapterList" javaType="java.util.List" resultMap="CourseChapterSectionListResult"/>
-        <collection property="moduleList" javaType="java.util.List" resultMap="CourseModuleChapterListResult"/>
-        <collection property="courseList" javaType="java.util.List" resultMap="CourseSectionListResult"/>
+        <collection property="businessList" column="section_id" select="findBusinessList"/>
+        <collection property="chapterList" column="section_id" select="findChapterList"/>
+      <!--  <collection property="moduleList" javaType="java.util.List" resultMap="CourseModuleChapterListResult"/>
+        <collection property="courseList" javaType="java.util.List" resultMap="CourseSectionListResult"/> -->
     </resultMap>
 
+    <select id="findChapterList" resultMap="CourseChapterSectionListResult">
+        SELECT
+            ccs.chapter_id,
+            cc.NAME AS chapter_name
+        FROM
+            course_chapter_section ccs
+        LEFT JOIN course_chapter cc ON ccs.chapter_id = cc.chapter_id
+        WHERE
+            ccs.id =#{section_id}
+    </select>
+
+
+    <select id="findBusinessList" resultMap="CourseSectionBusiness">
+        SELECT
+            csb.education_type_id,
+            csb.id,
+            csb.business_id,
+            csb.subject_id,
+            csb.project_id,
+            cet.education_name,
+            cpt.project_name,
+            cb.business_name,
+            cs.subject_name
+        FROM
+            course_section_business csb
+            LEFT JOIN course_education_type cet ON csb.education_type_id = cet.id
+            LEFT JOIN course_project_type cpt ON csb.project_id = cpt.id
+            LEFT JOIN course_business cb ON csb.business_id = cb.id
+            LEFT JOIN course_subject cs ON csb.subject_id = cs.id
+        WHERE
+            csb.section_id=#{section_id}
+    </select>
+
     <resultMap type="com.zhongzheng.modules.course.domain.CourseSectionBusiness" id="CourseSectionBusiness">
         <result property="id" column="id"/>
         <result property="subjectId" column="subject_id"/>
@@ -75,27 +108,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectSectionList" parameterType="com.zhongzheng.modules.course.bo.CourseSectionQueryBo" resultMap="CourseSectionResultVo">
         SELECT
-        c.*,
-        csb.education_type_id,
-        csb.id,
-        csb.business_id,
-        csb.subject_id,
-        csb.project_id,
-        cet.education_name,
-        cpt.project_name,
-        cb.business_name,
-        cs.subject_name,
-        ccs.chapter_id,
-        cc.NAME AS chapter_name
+        c.*
         FROM
         course_section c
-        LEFT JOIN course_section_business csb ON c.section_id = csb.section_id
-        LEFT JOIN course_education_type cet ON csb.education_type_id = cet.id
-        LEFT JOIN course_project_type cpt ON csb.project_id = cpt.id
-        LEFT JOIN course_business cb ON csb.business_id = cb.id
-        LEFT JOIN course_subject cs ON csb.subject_id = cs.id
-        LEFT JOIN course_chapter_section ccs ON csb.id = ccs.section_id
-        LEFT JOIN course_chapter cc ON ccs.chapter_id = cc.chapter_id
+        LEFT JOIN course_section_business csb ON csb.section_id  = c.section_id
         WHERE
         1 = 1
         <if test="name != null and name != ''">
@@ -125,13 +141,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 #{item}
             </foreach>
         </if>
-
+        GROUP BY
+        c.section_id
+        ORDER BY c.section_id DESC
     </select>
 
 
     <select id="selectSectionList_COUNT" resultType="Long">
         SELECT
-        count( DISTINCT c.section_id )
+        count(c.section_id )
         FROM
         course_section c
         LEFT JOIN course_section_business csb ON c.section_id = csb.section_id
@@ -164,5 +182,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 #{item}
             </foreach>
         </if>
+        GROUP BY
+        c.section_id
     </select>
 </mapper>