<?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.cmeeting.mapper.primary.MeetTypeMapper">

    <resultMap id="BaseResultMap" type="com.cmeeting.pojo.MeetType">
        <id property="id" column="id" />
        <result property="name" column="name" />
        <result property="isDel" column="is_del" />
        <result property="personalPermission" column="personal_permission" />
        <result property="authType" column="auth_type" />
        <result property="relId" column="rel_id" />
        <result property="content" column="content" />
        <result property="createTime" column="create_time" />
        <result property="updateTime" column="update_time" />
        <result property="createUser" column="create_user" />
        <result property="updateUser" column="update_user" />
        <result property="createUserName" column="create_user_name" />
        <result property="updateUserName" column="update_user_name" />
    </resultMap>

    <sql id="Base_Column_List">
        id, `name`, is_del, personal_permission, auth_type, rel_id,
        content, create_time, update_time, create_user, update_user, create_user_name, update_user_name
    </sql>

    <resultMap id="MeetTypeDtoResultMap" type="com.cmeeting.dto.MeetTypeDto">
        <id property="id" column="meeting_type_id" />
        <result property="name" column="meeting_type_name" />
        <result property="personalPermission" column="meeting_type_personal_permission" />
        <result property="authType" column="meeting_type_auth_type" />
        <result property="relId" column="meeting_type_rel_id" />
        <result property="content" column="meeting_type_content" />
        <collection property="recordTemplateDTOList" javaType="List" ofType="com.cmeeting.dto.RecordTemplateDto">
            <id property="id" column="template_id" />
            <result property="name" column="template_name" />
            <result property="typeDetail" column="template_type_detail" />
            <result property="createTime" column="template_create_time" />
            <result property="enable" column="template_enabled" />
            <result property="prompt" column="template_prompt" />
            <result property="referTemplateId" column="template_refer_template_id" />
        </collection>
    </resultMap>

    <!-- 查询会议类型下拉框 -->
    <select id="selectMeetTypeSelect" resultMap="MeetTypeDtoResultMap">
        select
            id as meeting_type_id,
            name as meeting_type_name,
            content as meeting_type_content
        from
            meet_type
        where
            is_del = 0
    </select>
</mapper>
