Newer
Older
huludao / src / main / resources / mapper / MeetPlanMapper.xml
<?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.newfiber.api.pc.dao.MeetPlanMapper">

    <resultMap id="meetPlanMap" type="com.newfiber.api.pc.model.meet.MeetPlan">
        <id property="mId" column="m_id"/>
        <result property="createTime" column="create_time" />
        <result property="userNo" column="user_no" />
        <result property="planName" column="plan_name" />
        <result property="planTypeId" column="plan_type_id" />
        <result property="planTypeName" column="plan_type_name " />
        <result property="planLevelId" column="plan_level_id" />
        <result property="planLevelName" column="plan_level_name" />
        <result property="updateTime" column="update_time"/>
        <collection property="files" ofType="com.newfiber.api.pc.model.meet.MeetPlanFile">
            <id property="mFId" column="m_f_id"/>
            <result property="planId" column="plan_id"/>
            <result property="fileName" column="file_name"/>
            <result property="filePath" column="file_path"/>
            <result property="createTime" column="create_time"/>
        </collection>
        <collection property="subs" ofType="com.newfiber.api.pc.model.meet.MeetPlanSub">
            <id property="mSId" column="m_s_id"/>
            <result property="subId" column="sub_id"/>
            <result property="subName" column="sub_name"/>
            <result property="subCount" column="sub_count"/>
            <result property="createUserNo" column="create_user_no"/>
            <result property="createTime" column="create_time"/>
            <result property="updateTime" column="update_time"/>
            <result property="planId" column="plan_id"/>
            <result property="nature" column="nature"/>
        </collection>
    </resultMap>

    <select id="selectMeetPlanInfoById" resultMap="meetPlanMap">
      SELECT
          mp.*,mpf.*,mps.*
      FROM
      meet_plan mp
      LEFT JOIN
      meet_plan_file mpf
      ON
      mp.m_id = mpf.plan_id
      LEFT JOIN
      meet_plan_sub mps
      ON
      mp.m_id = mps.plan_id
      where mp.m_id = #{id}
    </select>



</mapper>