PortalMeetingApplyMapper.xml 5.7 KB
<?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.column.persistence.dao.PortalMeetingApplyDao">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.hotent.column.model.PortalMeetingApply">
        <id column="ID_" property="id" />
        <result column="SUBJECT_" property="subject" />
        <result column="MEETING_NAME_" property="meetingName" />
        <result column="MEETING_ID_" property="meetingId" />
        <result column="MEETING_OWNER_" property="meetingOwner" />
        <result column="OWNER_OWNER_ID_" property="ownerOwnerId" />
        <result column="MEETING_DEP_" property="meetingDep" />
        <result column="MEETING_DEP_ID_" property="meetingDepId" />
        <result column="PARTICIPANTS_" property="participants" />
        <result column="PARTICIPANTS_ID_" property="participantsId" />
        <result column="DEPARTMENT_" property="department" />
        <result column="DEPARTMENT_ID_" property="departmentId" />
        <result column="OUTSIDERS_" property="outsiders" />
        <result column="ATTENDANCE_" property="attendance" />
        <result column="MEETING_NOTES_" property="meetingNotes" />
        <result column="FILES_" property="files" />
        <result column="APPLY_DESC_" property="applyDesc" />
        <result column="START_TIME_" property="startTime" />
        <result column="END_TIME_" property="endTime" />
        <result column="PRO_INST_ID_" property="proInstId" />
        <result column="STATUS_" property="status" />
        <result column="SERVICE_" property="service" />
        <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_, SUBJECT_, MEETING_NAME_, MEETING_ID_, MEETING_OWNER_, OWNER_OWNER_ID_, MEETING_DEP_, MEETING_DEP_ID_, PARTICIPANTS_, PARTICIPANTS_ID_, DEPARTMENT_, DEPARTMENT_ID_, OUTSIDERS_, ATTENDANCE_, MEETING_NOTES_, FILES_, APPLY_DESC_, START_TIME_, END_TIME_, PRO_INST_ID_, STATUS_, SERVICE_, CREATE_BY_, UPDATE_BY_, CREATE_TIME_, UPDATE_TIME_, CREATE_ORG_ID_, TENANT_ID_
    </sql>
    
     <select id="getByInstId"   parameterType="java.lang.String" resultMap="BaseResultMap">
		SELECT <include refid="Base_Column_List" /> FROM portal_meeting_apply 
		WHERE 
		PRO_INST_ID_=#{instId} 
	</select>
	
	<select id="getApplyCount" resultType="java.util.List">
		select STATUS_ as status,COUNT(1) as amount
		from 
		portal_meeting_apply 
		where STATUS_ is not null 
		<if test="ownerId!=null">
			and OWNER_OWNER_ID_ = #{ownerId}
		</if>
		<if test="roomId!=null">
			and MEETING_ID_ = #{roomId}
		</if>
		GROUP BY STATUS_
	</select>

    <select id="countVerifyApply" resultType="java.lang.Integer">
        select count(1) from portal_meeting_apply where
        <if test="group =='start'">
            MEETING_ID_ = #{meetingId} and START_TIME_ &lt; #{startTime} and END_TIME_ &gt; #{startTime} and STATUS_ != #{status}
        </if>
        <if test="group == 'end'">
            MEETING_ID_ = #{meetingId} and START_TIME_ &lt; #{endTime} and END_TIME_ &gt; #{endTime} and STATUS_ != #{status}
        </if>
        <if test="group == 'eq'">
            MEETING_ID_ = #{meetingId} and START_TIME_ = #{startTime} and START_TIME_ = #{startTime} and STATUS_ != #{status}
        </if>
        <if test="id!=null and id!=''">
            and ID_!=#{id}
        </if>
    </select>

    <select id="countVerifyApply" resultType="java.lang.Integer" databaseId="oracle">
        select count(1) from portal_meeting_apply where
        <if test="group == 'start'">
            MEETING_ID_ = #{meetingId} and START_TIME_ &lt; TO_TIMESTAMP(#{startTime}, 'yyyy-mm-dd hh24:mi:ss') and END_TIME_ &gt; TO_TIMESTAMP(#{startTime}, 'yyyy-mm-dd hh24:mi:ss') and STATUS_ != #{status}
        </if>
        <if test="group == 'end'">
            MEETING_ID_ = #{meetingId} and START_TIME_ &lt; TO_TIMESTAMP(#{endTime}, 'yyyy-mm-dd hh24:mi:ss') and END_TIME_ &gt; TO_TIMESTAMP(#{endTime}, 'yyyy-mm-dd hh24:mi:ss') and STATUS_ != #{status}
        </if>
        <if test="group == 'eq'">
            MEETING_ID_ = #{meetingId} and START_TIME_ = TO_TIMESTAMP(#{startTime}, 'yyyy-mm-dd hh24:mi:ss') and END_TIME_ = TO_TIMESTAMP(#{endTime}, 'yyyy-mm-dd hh24:mi:ss') and STATUS_ != #{status}
        </if>
        <if test="id!=null and id!=''">
            and ID_!=#{id}
        </if>
    </select>

    <select id="countVerifyApply" resultType="java.lang.Integer" databaseId="pg">
        select count(1) from portal_meeting_apply where
        <if test="group == 'start'">
            MEETING_ID_ = #{meetingId} and START_TIME_ &lt; TO_TIMESTAMP(#{startTime}, 'yyyy-MM-dd hh24:mi:ss') and END_TIME_ &gt; TO_TIMESTAMP(#{startTime}, 'yyyy-MM-dd hh24:mi:ss') and STATUS_ != #{status}
        </if>
        <if test="group == 'end'">
            MEETING_ID_ = #{meetingId} and START_TIME_ &lt; TO_TIMESTAMP(#{endTime}, 'yyyy-MM-dd hh24:mi:ss') and END_TIME_ &gt; TO_TIMESTAMP(#{endTime}, 'yyyy-MM-dd hh24:mi:ss') and STATUS_ != #{status}
        </if>
        <if test="group == 'eq'">
            MEETING_ID_ = #{meetingId} and START_TIME_ = TO_TIMESTAMP(#{startTime}, 'yyyy-MM-dd hh24:mi:ss') and END_TIME_ = TO_TIMESTAMP(#{endTime}, 'yyyy-MM-dd hh24:mi:ss') and STATUS_ != #{status}
        </if>
        <if test="id!=null and id!=''">
            and ID_!=#{id}
        </if>
    </select>

</mapper>