he2802 3 سال پیش
والد
کامیت
3160973cbd

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

@@ -239,8 +239,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="checkCrossLiveTime" parameterType="map" resultType="long">
-        SELECT count(*) from course_section cs where  #{startTime} >= cs.live_start_time or cs.live_end_time >= #{startTime}
-                                                  or cs.live_end_time >= #{endTime} or #{endTime} >= cs.live_start_time or (cs.live_start_time >= #{startTime} and
+        SELECT count(*) from course_section cs where  (#{startTime} >= cs.live_start_time and cs.live_end_time >= #{startTime})
+                                                  or (cs.live_end_time >= #{endTime} and #{endTime} >= cs.live_start_time) or (cs.live_start_time >= #{startTime} and
                                                                                                                             #{endTime} >= cs.live_end_time)
         <if test="sectionId != null and sectionId != ''">
             AND cs.section_id != #{sectionId}

+ 3 - 0
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamBeforeApplyMapper.xml

@@ -37,6 +37,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             exam_before_apply eba
                 LEFT JOIN exam_apply ea ON eba.apply_id = ea.apply_id
         WHERE
+              1=1
+        <if test="beforeId != null and beforeId != '' and beforeId != -1">
             eba.before_id = #{beforeId}
+        </if>
     </select>
 </mapper>