<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPEmapperPUBLIC"-//mybatis.org//DTD Mapper 3.0//EN""http://mybatis.org/dtd/mybatis-3-mapper.dtd"><mappernamespace="com.xxx.mapper.TestMapper"><!-- 通用查询映射结果 --><resultMapid="BaseResultMap"type="com.xxx.entity.dto.TestDTO"><idcolumn="id"property="id"jdbcType="BIGINT"/><resultcolumn="from_type"property="fromType"/><resultcolumn="tools_type"property="toolsType"/><resultcolumn="name"property="name"/><resultcolumn="description"property="description"/><resultcolumn="work_time"property="workTime"/><resultcolumn="work_addr"property="workAddr"/><resultcolumn="content"property="content"/><resultcolumn="is_notice"property="isNotice"/><resultcolumn="msg_notice"property="msgNotice"/><resultcolumn="sms_notice"property="smsNotice"/><resultcolumn="notice_scope"property="noticeScope"/><resultcolumn="notice_info"property="noticeInfo"/><resultcolumn="is_share"property="isShare"/><resultcolumn="share_url"property="shareUrl"/><resultcolumn="is_sync"property="isSync"/><resultcolumn="from_id"property="fromId"/><resultcolumn="status"property="status"/><resultcolumn="creator_id"property="creatorId"/><resultcolumn="updated_at"property="updatedAt"/><resultcolumn="is_delete"property="isDelete"/><associationproperty="hoster"javaType="com.xxx.entity.TestUser"column="{mtsId=id}"select="selectUserByMtsId3"/><collectionproperty="userList1"ofType="com.xxx.entity.TestUser"column="{mtsId=id}"select="selectUserByMtsId1"/><collectionproperty="userList2"ofType="com.xxx.entity.TestUser"column="{mtsId=id}"select="selectUserByMtsId2"/><collectionproperty="postList"ofType="com.xxx.entity.TestPost"column="{mtsId=id}"select="selectPostByMtsId"/><collectionproperty="noticeList"ofType="String"column="{mtsId=id}"select="selectUserNoticeByMtsId"/></resultMap><!-- 通用查询结果列 --><sqlid="Base_Column_List">
id, from_type, tools_type, name, description, work_time, work_addr, hoster, content, is_notice, msg_notice, sms_notice,
notice_scope, notice_info, is_share, share_url, is_sync, from_id, creator_id, created_at, updated_at, is_delete
</sql><selectid="getTestInfo"resultMap="BaseResultMap">
select
<includerefid="Base_Column_List"/>,if(work_time > now(),1,2) status
from yc_meet_talk_study
where id=#{id}
</select><selectid="selectPostByMtsId"resultType="com.xxx.entity.TestPost">
select id, mts_id, org_uuid, org_name, path_code, org_code, sys_code, parent_org_uuid, creator_id, created_at, updated_at, is_delete
from yc_meet_talk_study_post
where mts_id=#{mtsId} and is_delete=0
</select><selectid="selectUserByMtsId1"resultType="com.xxx.entity.TestUser">
select a.id, a.mts_id, a.account_uuid, a.org_uuid, a.org_name, a.path_code, a.org_code, a.sys_code, a.user_type, b.person_name
from yc_meet_talk_study_user a left join uc_uu_personinfo b on a.account_uuid=b.account_uuid
where a.mts_id=#{mtsId} and a.user_type=1 and a.is_delete=0
</select><selectid="selectUserByMtsId2"resultType="com.xxx.entity.TestUser">
select a.id, a.mts_id, a.account_uuid, a.org_uuid, a.org_name, a.path_code, a.org_code, a.sys_code, a.user_type, b.person_name
from yc_meet_talk_study_user a left join uc_uu_personinfo b on a.account_uuid=b.account_uuid
where a.mts_id=#{mtsId} and a.user_type=2 and a.is_delete=0
</select><selectid="selectUserByMtsId3"resultType="com.xxx.entity.TestUser">
select a.id, a.mts_id, a.account_uuid, a.org_uuid, a.org_name, a.path_code, a.org_code, a.sys_code, a.user_type, b.person_name
from yc_meet_talk_study_user a left join uc_uu_personinfo b on a.account_uuid=b.account_uuid
where a.mts_id=#{mtsId} and a.user_type=6 and a.is_delete=0
</select><selectid="selectUserNoticeByMtsId"resultType="String">
select distinct a.account_uuid
from yc_meet_talk_study_user a
where a.mts_id=#{mtsId} and a.is_delete=0 and notice_flag=1
</select></mapper>