<?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.teachcloud.common.mapper.BasicCollegeMapper">

    <select id="findBasicCollegePage" resultType="com.qmth.teachcloud.common.bean.result.BasicCollegeResult">
        SELECT
            id,
            college_name as collegeName,
            create_time as createTime
        FROM
            basic_college
        <where>
            <if test="schoolId != null and schoolId != ''">
                AND school_id = #{schoolId}
            </if>
            <if test="collegeName != null and collegeName != ''">
                AND college_name LIKE CONCAT('%',#{collegeName},'%')
            </if>
            <if test="dpr != null">
                <if test="dpr.requestUserId != null">
                    AND create_id = #{dpr.requestUserId}
                </if>
                <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
                    AND org_id IN
                    <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
                        #{item}
                    </foreach>
                </if>
            </if>
        </where>
        ORDER BY create_time DESC
    </select>
</mapper>
