Bläddra i källkod

fix 业务层次

he2802 4 år sedan
förälder
incheckning
3e19d5d16a

+ 1 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml

@@ -525,6 +525,7 @@
 
           and cg.`status` =1
           and cgg.goods_id = #{goodsId}
+        and cgu.change_grade = 0
         order by cg.create_time desc LIMIT 1
     </select>
 </mapper>

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/course/CoursePhotoLogMapper.xml

@@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           AND goods_id = #{goodsId}
           AND grade_id = #{gradeId}
           AND section_id = #{sectionId}
-            and current_status =1
+        AND current_status =1
         <if test="moduleId != null ">
             and module_id = #{moduleId}
         </if>

+ 4 - 3
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -244,6 +244,7 @@
         LEFT JOIN user_profile up on u.user_id =up.user_id and up.goods_id = cgg.goods_id and up.type_status=1 and up.current_status = 1
         where 1=1
         and cgu.`status` =1
+        and cgu.change_grade =0
         <if test="gradeId != null and gradeId !='' ">
             and cgu.grade_id = #{gradeId}
         </if>
@@ -289,7 +290,7 @@
         class_grade_user cgu
         LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
         LEFT JOIN `user` u ON u.user_id = cgu.user_id
-        where 1=1
+        where 1=1 AND cgu.change_grade = 0
         <if test="userId != null and userId !='' ">
             and u.user_id = #{userId}
         </if>
@@ -342,10 +343,10 @@
         (SELECT COUNT(ccs.section_id) FROM course_chapter_section ccs where ccs.chapter_id=cm.menu_id) as class_hours,
         2 as type,
         (SELECT usr.create_time FROM user_study_record usr LEFT JOIN course_chapter_section ccs on usr.section_id =
-        ccs.section_id where ccs.chapter_id = cm.menu_id and usr.goods_id = gc.goods_id ORDER BY usr.create_time ASC
+        ccs.section_id where ccs.chapter_id = cm.menu_id and usr.goods_id = gc.goods_id and usr.grade_id = #{gradeId} ORDER BY usr.create_time ASC
         limit 1) as study_start_time,
         (SELECT usr.update_time FROM user_study_record usr LEFT JOIN course_chapter_section ccs on usr.section_id =
-        ccs.section_id where ccs.chapter_id = cm.menu_id and usr.goods_id = gc.goods_id ORDER BY usr.create_time DESC
+        ccs.section_id where ccs.chapter_id = cm.menu_id and usr.goods_id = gc.goods_id and usr.grade_id = #{gradeId} ORDER BY usr.create_time DESC
         limit 1) as study_end_time
         FROM
         course_menu cm

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

@@ -165,7 +165,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         (SELECT COUNT(id) FROM course_menu m where  m.course_id = r.course_id and m.type in(1)) as module_num,
         (SELECT COUNT(id)+(SELECT COUNT(p.id) FROM course_module_chapter p LEFT JOIN course_menu m  on m.menu_id = p.module_id where  m.course_id = r.course_id and m.type in(1)) FROM course_menu m where  m.course_id = r.course_id and m.type in(2)) as chapter_num,
         (SELECT COUNT(id)+(SELECT COUNT(n.id) FROM course_chapter_section n LEFT JOIN course_module_chapter p on n.chapter_id = p.chapter_id LEFT JOIN course_menu m on m.menu_id = p.module_id where m.course_id =  r.course_id and m.type in(1))+(SELECT COUNT(n.id) FROM course_chapter_section n  LEFT JOIN course_menu m on m.menu_id = n.chapter_id where m.course_id = r.course_id and m.type in(2)) FROM course_menu m where  m.course_id = r.course_id and m.type in(3)) as section_num,
-        (select COUNT(DISTINCT section_id) FROM user_study_record c where c.course_id = r.course_id and c.user_id=#{userId} and c.status = 1 and c.goods_id = #{goodsId}) as record_num
+        (select COUNT(DISTINCT section_id) FROM user_study_record c where c.course_id = r.course_id and c.grade_id=#{gradeId} and c.user_id=#{userId} and c.status = 1 and c.goods_id = #{goodsId}) as record_num
         FROM
         course r
         LEFT JOIN goods_course c ON c.course_id = r.course_id