<?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.qmth.distributed.print.business.mapper.TeachClazzMapper">

    <select id="findTeachClazzPage"
            resultType="com.qmth.distributed.print.business.bean.result.TeachClazzResult">
        SELECT
            id,
            teach_course_id AS teachCourseId,
            teach_clazz_name AS teachClazzName,
            create_time AS createTime
        FROM
            teach_clazz
        <where>
            <if test="schoolId != null and schoolId != ''">
                AND school_id = #{schoolId}
            </if>
            <if test="teachClazzName != null and teachClazzName != ''">
                AND teach_clazz_name LIKE CONCAT('%',#{teachClazzName},'%')
            </if>
                AND teach_course_id = #{teachCourseId}
        </where>
        ORDER BY create_time DESC
    </select>
</mapper>