<?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,
            clazz_name AS teachClazzName,
            create_time AS createTime,
            basic_teach_clazz_id AS basicTeachClazzId,
            belong_teach_course_id AS belongTeachCourseId
        FROM
            teach_clazz
        <where>
            <if test="teachCourseId != null">
                AND teach_course_id = #{teachCourseId}
            </if>
            <if test="teachClazzName != null and teachClazzName != ''">
                AND clazz_name LIKE CONCAT('%',#{teachClazzName},'%')
            </if>
            <if test="belongTeachCourseId != null">
                AND belong_teach_course_id = #{belongTeachCourseId}
            </if>
        </where>
        ORDER BY id ASC
    </select>
</mapper>