<select id="findStudentCoursePageBy" resultType="org.jeecg.modules.course.vo.TpStudentCoursePageVO" >
SELECT a.*,b.course,b.total_nodes,d.teacher_name
FROM tp_student_course a JOIN tp_course_info b ON a.course_id=b.id
JOIN tp_teacher_info d ON b.lecturer_id=d.id
WHERE a.create_by = #{queryName}
<if test="map.isOver!= null and map.isOver!='' or map.isOver==0">
and a.is_over = #{map.isOver}
<if test="map.isOver != 1 and map.learnType != null and map.learnType!=''">
<choose>
<when test="map.learnType =='1' ">
and a.course_id in( SELECT c.course_id
from tp_course_record c
WHERE c.create_by = #{queryName}
group by c.course_id
HAVING max(c.learn_time)!=0 )
</when>
<otherwise>
and a.course_id not in( SELECT c.course_id
from tp_course_record c
WHERE c.create_by = #{queryName}
group by c.course_id
HAVING max(c.learn_time)=0 )
</otherwise>
</choose>
</if>
</if>
<if test="map.courseId != null and map.courseId!=''">
and a.course_id = #{map.courseId}
</if>
order by a.create_time
</select>
之前一直写
<if test="map.isOver!= null and map.isOver!='' >
如果此时传值为map.isOver为 0 的话 也会把if条件拦截掉 直接跳到下一个if判断
<if test="map.isOver!= null and map.isOver!='' or map.isOver==0">
4万+




被折叠的 条评论
为什么被折叠?



