<?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.xjrsoft.module.classtime.mapper.ClassTimeDeleteMapper">
    <select id="getPage" parameterType="com.xjrsoft.module.classtime.dto.ClassTimeDeletePageDto" resultType="com.xjrsoft.module.classtime.vo.ClassTimeDeletePageVo">
        SELECT t1.id, t2.name AS class_name,t3.name AS type_cn,t1.type,t4.name AS operation_user_name,t1.remark,t1.time_period,
        t1.start_date,t1.end_date,t1.status,IFNULL(t1.modify_date,t1.create_date) AS operation_time FROM class_time_delete t1
        INNER JOIN base_class t2 ON t1.class_id = t2.id
        LEFT JOIN xjr_dictionary_detail t3 ON t1.type = t3.code
        LEFT JOIN xjr_user t4 ON IFNULL(t1.modify_user_id, t1.create_user_id) = t4.id
        WHERE t1.delete_mark = 0
        <if test="dto.className != null and dto.className != ''">
            and t2.name like concat('%', #{dto.className},'%')
        </if>
        <if test="dto.type != null and dto.type != ''">
            and t1.type = #{dto.type}
        </if>
        <if test="dto.enabledMark != null">
            and t1.status = #{dto.enabledMark}
        </if>
         order by t1.create_date desc
    </select>

</mapper>