<?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.BasicCampusMapper">

    <select id="findBasicCampusResult"
            resultType="com.qmth.teachcloud.common.bean.result.BasicCampusResult">
        SELECT
            cam.id AS id,
            campus_name AS campusName,
            campus_code AS campusCode,
            print_house_id AS printHouseId,
            org.name AS printHouseName,
            cam.create_id AS createId,
            cam.create_time AS createTime
        FROM
            basic_campus cam
                LEFT JOIN
            sys_org org ON cam.print_house_id = org.id
        WHERE
            cam.school_id = #{schoolId}
          AND cam.enable = TRUE
        ORDER BY cam.create_time DESC
    </select>
</mapper>
