<?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.EduSecondClassCourseLecturerMapper">
  <select id="listLecturer" resultType="com.yida.data.school.vo.secondClass.CourseLecturerVO">
    select id
         , name
         , avatar
    <if test="param1 != null">
      , remark
    </if>
    from edu_second_class_course_lecturer
      where del_flag = 0
        and dept_id = #{deptId}
    <if test="name != null and name != ''">
      and name like concat('%', #{name}, '%')
    </if>
    <choose>
      <when test="param1 != null">
        order by create_date desc
      </when>
      <otherwise>
        order by CONVERT(name using gbk)
      </otherwise>
    </choose>
  </select>

  <select id="getInfo" resultType="com.yida.data.school.vo.secondClass.CourseLecturerVO">
    select id, name, remark, avatar
    from edu_second_class_course_lecturer
    where del_flag = 0
      and id = #{id}
  </select>


</mapper>
