<?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="org.dromara.system.mapper.TeacherInfoMapper">
    <resultMap type="org.dromara.system.domain.vo.TeacherInfoVo" id="TeacherInfoResult">
        <result property="id"    column="id"    />
        <result property="teacherId"    column="teacher_id"    />
        <result property="name"    column="name"    />
        <result property="sex"    column="sex"    />
        <result property="age"    column="age"    />
        <result property="phone"    column="phone"    />
        <result property="professional"    column="professional"    />
        <result property="idCard"    column="id_card"    />
        <result property="height"    column="height"    />
        <result property="weight"    column="weight"    />
        <result property="bloodType"    column="blood_type"    />
        <result property="politicalStatus"    column="political_status"    />
        <result property="graduationPhoto"    column="graduation_photo"    />
        <result property="degreePhoto"    column="degree_photo"    />
        <result property="teachingPhoto"    column="teaching_photo"    />
        <result property="professionalPhoto"    column="professional_photo"    />
        <result property="identificationPhoto"    column="identification_photo"    />
        <result property="entrancePermit"    column="entrance_permit"    />
        <result property="address"    column="address"    />

        <result property="onBoardTime"    column="on_board_time"    />
        <result property="jobTime"    column="job_time"    />

        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="remark"    column="remark"    />

        <result property="schoolId"    column="schoolId"    />
    </resultMap>

    <sql id="selectTeacherInfoVo">
        select id, teacher_id, name, sex, age, phone, professional, id_card, height, weight, blood_type, political_status, graduation_photo, degree_photo,
               teaching_photo, professional_photo, identification_photo, entrance_permit, address,on_board_time,job_time, create_by, create_time,
               update_by, update_time, remark from teacher_info
    </sql>

    <select id="selectVoMapperPage" resultMap="TeacherInfoResult">
        select ANY_VALUE(t.id) as id, ANY_VALUE(t.teacher_id) as teacher_id,  ANY_VALUE(t.name) as name, ANY_VALUE(t.sex) as sex,
               ANY_VALUE(t.age) as age, ANY_VALUE(t.phone) as phone, ANY_VALUE(t.professional) as professional, ANY_VALUE(t.id_card) as id_card,
               ANY_VALUE(t.height) as height, ANY_VALUE(t.weight) as weight, ANY_VALUE(t.blood_type) as blood_type, ANY_VALUE(t.political_status) as political_status,
               ANY_VALUE(t.graduation_photo) as graduation_photo, ANY_VALUE(t.degree_photo) as degree_photo,
               ANY_VALUE(t.teaching_photo) as teaching_photo, ANY_VALUE(t.professional_photo) as professional_photo, ANY_VALUE(t.identification_photo) as identification_photo,
               ANY_VALUE(t.entrance_permit) as entrance_permit, ANY_VALUE(t.address) as address,ANY_VALUE(t.on_board_time) as on_board_time,ANY_VALUE(t.job_time) as job_time,
               ANY_VALUE(t.create_by) as create_by, ANY_VALUE(t.create_time) as create_time,
               ANY_VALUE(t.update_by) as update_by, ANY_VALUE(t.update_time) as update_time, ANY_VALUE(t.remark) as remark
        from teacher_info t
                 left join formal_teacher_class f on t.teacher_id = f.teacher_id
            ${ew.getCustomSqlSegment}
    </select>
    <select id="selectVoMapperList" resultMap="TeacherInfoResult">
        select ANY_VALUE(t.id) as id, ANY_VALUE(t.teacher_id) as teacher_id,  ANY_VALUE(t.name) as name, ANY_VALUE(t.sex) as sex,
               ANY_VALUE(t.age) as age, ANY_VALUE(t.phone) as phone, ANY_VALUE(t.professional) as professional, ANY_VALUE(t.id_card) as id_card,
               ANY_VALUE(t.height) as height, ANY_VALUE(t.weight) as weight, ANY_VALUE(t.blood_type) as blood_type, ANY_VALUE(t.political_status) as political_status,
               ANY_VALUE(t.graduation_photo) as graduation_photo, ANY_VALUE(t.degree_photo) as degree_photo,
               ANY_VALUE(t.teaching_photo) as teaching_photo, ANY_VALUE(t.professional_photo) as professional_photo, ANY_VALUE(t.identification_photo) as identification_photo,
               ANY_VALUE(t.entrance_permit) as entrance_permit, ANY_VALUE(t.address) as address,ANY_VALUE(t.on_board_time) as on_board_time,ANY_VALUE(t.job_time) as job_time,
               ANY_VALUE(t.create_by) as create_by, ANY_VALUE(t.create_time) as create_time,
               ANY_VALUE(t.update_by) as update_by, ANY_VALUE(t.update_time) as update_time, ANY_VALUE(t.remark) as remark
        from teacher_info t
                 left join formal_teacher_class f on t.teacher_id = f.teacher_id
            ${ew.getCustomSqlSegment}
    </select>
    <select id="selectVoMapperById" resultMap="TeacherInfoResult">
        <include refid="selectTeacherInfoVo"/>
        where id = #{id}
    </select>
</mapper>
