<?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.ruoyi.collaborativeApproval.mapper.MeetApplicationMapper">
|
|
<resultMap id="BaseResultMap" type="com.ruoyi.collaborativeApproval.pojo.MeetApplication">
|
<id property="id" column="id" jdbcType="BIGINT"/>
|
<result property="title" column="title" jdbcType="VARCHAR"/>
|
<result property="type" column="type" jdbcType="VARCHAR"/>
|
<result property="roomId" column="room_id" jdbcType="BIGINT"/>
|
<result property="host" column="host" jdbcType="VARCHAR"/>
|
<result property="meetingDate" column="meeting_date" jdbcType="DATE"/>
|
<result property="startTime" column="start_time" jdbcType="TIMESTAMP"/>
|
<result property="endTime" column="end_time" jdbcType="TIMESTAMP"/>
|
<result property="participants" column="participants" jdbcType="VARCHAR"/>
|
<result property="description" column="description" jdbcType="VARCHAR"/>
|
<result property="applicationType" column="application_type" jdbcType="VARCHAR"/>
|
<result property="status" column="status" jdbcType="TINYINT"/>
|
<result property="applicant" column="applicant" jdbcType="VARCHAR"/>
|
<result property="createUser" column="create_user" jdbcType="BIGINT"/>
|
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
<result property="updateUser" column="update_user" jdbcType="BIGINT"/>
|
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
<result property="tenantId" column="tenant_id" jdbcType="BIGINT"/>
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
id,title,type,
|
room_id,host,meeting_date,
|
start_time,end_time,participants,
|
description,application_type,status,
|
applicant,create_user,create_time,
|
update_user,update_time,tenant_id
|
</sql>
|
<select id="getMeetSummary" resultType="com.ruoyi.collaborativeApproval.dto.MeetSummaryDto">
|
SELECT
|
COUNT(*) AS total,
|
SUM(CASE
|
WHEN meeting_date = CURDATE() AND start_time <![CDATA[<=]]> NOW() AND end_time <![CDATA[>]]> NOW()
|
THEN 1 ELSE 0
|
END) AS underWay,
|
SUM(CASE
|
WHEN (meeting_date <![CDATA[<]]> CURDATE() OR (meeting_date = CURDATE() AND end_time <![CDATA[<=]]> NOW()))
|
THEN 1 ELSE 0
|
END) AS completed,
|
SUM(CASE
|
WHEN meeting_date <![CDATA[>=]]> CURDATE() AND start_time <![CDATA[>]]> NOW()
|
THEN 1 ELSE 0
|
END) AS toStart
|
FROM meet_application as t1
|
where status = 1 OR application_type='notification'
|
</select>
|
<select id="getMeetSummaryItems" resultType="com.ruoyi.collaborativeApproval.dto.MeetingSimpleDto">
|
select t1.id as id,
|
t1.title as title,
|
(CASE
|
WHEN t1.meeting_date = CURDATE() AND t1.start_time <![CDATA[<=]]> NOW() AND t1.end_time <![CDATA[>]]> NOW()
|
THEN 2
|
WHEN t1.meeting_date <![CDATA[>=]]> CURDATE() AND t1.start_time <![CDATA[>]]> NOW() then 1
|
ELSE 0 end) as status,
|
t1.start_time as start_time,
|
t1.end_time as end_time,
|
CONCAT(t2.name, '(', t2.location, ')') as location,
|
t1.host as host,
|
t1.participants as participants,
|
t3.content as content
|
from meet_application
|
as t1
|
left join meeting_room as t2 on t1.room_id = t2.id
|
left join meeting_minutes as t3 on t1.id = t3.meeting_id
|
where t1.status = 1
|
OR t1.application_type = 'notification'
|
order by (CASE
|
WHEN t1.meeting_date = CURDATE() AND t1.start_time <![CDATA[<=]]> NOW() AND t1.end_time <![CDATA[>]]> NOW()
|
THEN 2
|
WHEN t1.meeting_date <![CDATA[>=]]> CURDATE() AND t1.start_time > NOW() then 1
|
ELSE 0 end) desc, t1.end_time desc
|
</select>
|
</mapper>
|