<?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.user.mapper.EduUserDeptMapper">
	
	<select id="getClassInfo" resultType="com.yida.data.system.vo.ClassInfoVO">
		SELECT clazz.school_id   schoolId,
			   clazz.DEPT_ID     classId,
			   clazz.DEPT_NAME   className,
			   grade.DEPT_ID     gradeId,
			   grade.DEPT_NAME   gradeName,
			   section.DEPT_ID   sectionId,
			   section.DEPT_NAME sectionName,
			   campus.DEPT_ID    campusId,
			   campus.DEPT_NAME  campusName
		FROM edu_user_dept clazz
				 LEFT JOIN edu_user_dept grade ON clazz.PARENT_ID = grade.DEPT_ID
				 LEFT JOIN edu_user_dept section ON grade.PARENT_ID = section.DEPT_ID
				 LEFT JOIN edu_user_dept campus ON section.PARENT_ID = campus.DEPT_ID
		where clazz.DEPT_ID = #{classId}
	</select>

</mapper>
