PortalMeetingApplyMapper.xml
5.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?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_ < #{startTime} and END_TIME_ > #{startTime} and STATUS_ != #{status}
</if>
<if test="group == 'end'">
MEETING_ID_ = #{meetingId} and START_TIME_ < #{endTime} and END_TIME_ > #{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_ < TO_TIMESTAMP(#{startTime}, 'yyyy-mm-dd hh24:mi:ss') and END_TIME_ > TO_TIMESTAMP(#{startTime}, 'yyyy-mm-dd hh24:mi:ss') and STATUS_ != #{status}
</if>
<if test="group == 'end'">
MEETING_ID_ = #{meetingId} and START_TIME_ < TO_TIMESTAMP(#{endTime}, 'yyyy-mm-dd hh24:mi:ss') and END_TIME_ > 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_ < TO_TIMESTAMP(#{startTime}, 'yyyy-MM-dd hh24:mi:ss') and END_TIME_ > TO_TIMESTAMP(#{startTime}, 'yyyy-MM-dd hh24:mi:ss') and STATUS_ != #{status}
</if>
<if test="group == 'end'">
MEETING_ID_ = #{meetingId} and START_TIME_ < TO_TIMESTAMP(#{endTime}, 'yyyy-MM-dd hh24:mi:ss') and END_TIME_ > 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>