<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yida.data.school.secondClass.mapper.EduSecondClassCourseContentMapper">
  <select id="listContentPage" resultType="com.yida.data.school.vo.secondClass.CourseContentVO">
    select id, name, lecturer_id, duration, file_type, file_size, file_url
    from edu_second_class_course_content
      where del_flag = 0
        and course_id = #{dto.courseId}
    <if test="dto.name != null and dto.name != ''">
      and name like concat('%', #{dto.name}, '%')
    </if>
    order by sort
  </select>

  <update id="changeSort">
    update edu_second_class_course_content
    set sort=sort + #{step}
    where course_id = #{courseId}
      and del_flag = 0
      and id <![CDATA[<>]]> #{id}
      and sort between #{start} and #{end}
  </update>
</mapper>
