<?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.hotent.portal.persistence.dao.PortalAgendaDayDao">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.hotent.portal.model.PortalAgendaDay">
        <id column="ID_" property="id" />
        <result column="CREATOR_" property="creator" />
        <result column="SUBJECT_" property="subject" />
        <result column="START_TIME_" property="startTime" />
        <result column="END_TIME_" property="endTime" />
        <result column="CONTENT_" property="content" />
        <result column="SHARE_ID_" property="shareId" />
        <result column="SHARE_NAME_" property="shareName" />
        <result column="CREATE_BY_" property="createBy" />
        <result column="UPDATE_BY_" property="updateBy" />
        <result column="CREATE_TIME_" property="createTime" />
        <result column="UPDATE_TIME_" property="updateTime" />
        <result column="CREATE_ORG_ID_" property="createOrgId" />
        <result column="TENANT_ID_" property="tenantId" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        ID_, CREATOR_, SUBJECT_, START_TIME_, END_TIME_, CONTENT_, SHARE_ID_, SHARE_NAME_, CREATE_BY_, UPDATE_BY_, CREATE_TIME_, UPDATE_TIME_, CREATE_ORG_ID_, TENANT_ID_
    </sql>
    
    <select id="getByUserId"   parameterType="java.lang.String" resultMap="BaseResultMap">
		SELECT <include refid="Base_Column_List" /> FROM portal_agenda_day 
		WHERE 
		CREATE_BY_=#{userId} or SHARE_ID_ like  CONCAT('%',#{userId},'%')
	</select>

</mapper>
