<?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.classSchedule.mapper.EduClassScheduleMapper">
    <select id="listClassSchedulePage"
            resultType="com.yida.data.school.vo.classSchedule.ClassSchedulePageInfoVO">
        select id,name,district_name,grade_id,grade_name,semester_name,status,create_date
        from edu_class_schedule
        where del_flag = 0
        <if test="dto.status != null">
            and status=#{dto.status}
        </if>
        <if test="dto.semesterId != null">
            and semester_id=#{dto.semesterId}
        </if>
        <if test="dto.schoolId != null">
            and school_id=#{dto.schoolId}
        </if>
        <if test="dto.districtId != null">
            and district_id=#{dto.districtId}
        </if>
        <if test="dto.sectionId != null">
            and section_id=#{dto.sectionId}
        </if>
        <if test="dto.gradeId != null">
            and grade_id=#{dto.gradeId}
        </if>
        <if test="dto.classScheduleName != null and dto.classScheduleName != ''">
            and name like concat('%',#{dto.classScheduleName},'%')
        </if>
        order by create_date desc
    </select>
</mapper>
