mirror of
https://gitee.com/elegant_wings/dbd-meeting.git
synced 2025-06-21 14:49:37 +08:00
会议室预约统计
This commit is contained in:
parent
d47e85026c
commit
dcad6d4643
@ -0,0 +1,104 @@
|
|||||||
|
package com.ics.admin.controller;
|
||||||
|
|
||||||
|
import com.ics.admin.service.IMeetingStatsService;
|
||||||
|
import com.ics.common.core.domain.R;
|
||||||
|
import com.ics.common.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.wf.jwtp.annotation.RequiresPermissions;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会议室预约统计接口
|
||||||
|
* created at 2024-9-29 16:15
|
||||||
|
*
|
||||||
|
* @author lujiang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping({"/admin/ms"})
|
||||||
|
public class MeetingStatsController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMeetingStatsService meetingStatsService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会议室统计 第一行
|
||||||
|
*
|
||||||
|
* @param day 格式:2024-09-30
|
||||||
|
* @return
|
||||||
|
* alreadyBooking, 已预约会议室数量
|
||||||
|
* noBooking,未预约会议室数量
|
||||||
|
* going,开会中会议室数量
|
||||||
|
* free,空闲中会议室数量
|
||||||
|
*/
|
||||||
|
@RequiresPermissions(value = {"mr:manage:operator"})
|
||||||
|
@RequestMapping("roomStats")
|
||||||
|
public R roomStats(String day) {
|
||||||
|
return R.ok().put("data", meetingStatsService.roomStats(day));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日历 第二行左
|
||||||
|
*
|
||||||
|
* @param month 月份,格式:2024-09
|
||||||
|
*/
|
||||||
|
@RequiresPermissions(value = {"mr:manage:operator"})
|
||||||
|
@RequestMapping("calendar")
|
||||||
|
public R calendar(String month) {
|
||||||
|
return R.ok().put("data", meetingStatsService.calendar(month));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会议状态 第二行右上
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* wait, 待开始会议数量
|
||||||
|
* going,进行中会议数量
|
||||||
|
* closed,已结束会议数量
|
||||||
|
*/
|
||||||
|
@RequiresPermissions(value = {"mr:manage:operator"})
|
||||||
|
@RequestMapping("meetingStats")
|
||||||
|
public R meetingStats() {
|
||||||
|
return R.ok().put("data", meetingStatsService.meetingStats());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会议待办 第二行右下
|
||||||
|
*/
|
||||||
|
@RequiresPermissions(value = {"mr:manage:operator"})
|
||||||
|
@RequestMapping("meetingAudit")
|
||||||
|
public R meetingAudit() {
|
||||||
|
return R.ok().put("data", meetingStatsService.meetingAudit());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图表统计数据
|
||||||
|
*
|
||||||
|
* @param startDate 统计数据开始时间,日期格式示例:2024-08-23
|
||||||
|
* @param endDate 统计数据结束时间,日期格式示例:2024-09-23
|
||||||
|
* @return
|
||||||
|
* roomRank,会议室使用排名
|
||||||
|
* serve,服务情况
|
||||||
|
* roomType,会议室形式统计
|
||||||
|
* orgMeeting,部门开会情况--top10
|
||||||
|
* everyDay,开会情况--按天--top20
|
||||||
|
*/
|
||||||
|
@RequiresPermissions(value = {"mr:manage:operator"})
|
||||||
|
@RequestMapping("chartStats")
|
||||||
|
public R chartStats(String startDate, String endDate) {
|
||||||
|
Date start, end;
|
||||||
|
try {
|
||||||
|
start = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, startDate + " 00:00:00");
|
||||||
|
end = DateUtils.dateTime(DateUtils.YYYY_MM_DD_HH_MM_SS, endDate + " 23:59:59");
|
||||||
|
} catch (Exception e) {
|
||||||
|
return R.error("参数错误");
|
||||||
|
}
|
||||||
|
return R.ok().put("data", meetingStatsService.chartStats(start, end));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,78 @@
|
|||||||
|
package com.ics.admin.mapper;
|
||||||
|
|
||||||
|
import com.ics.admin.vo.MRStatsVo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface MeetingStatsMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会议室统计 第一行
|
||||||
|
* @param day 格式:2024-09-30
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<MRStatsVo> roomStats(@Param("day") String day);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日历 第二行左
|
||||||
|
*/
|
||||||
|
List<MRStatsVo> calendar(@Param("month") String month);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会议状态 第二行右上
|
||||||
|
*/
|
||||||
|
List<MRStatsVo> meetingStats();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会议待办 第二行右下
|
||||||
|
*/
|
||||||
|
List<MRStatsVo> meetingAudit();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会议室使用排名
|
||||||
|
*
|
||||||
|
* @param start 开始时间范围
|
||||||
|
* @param end 结束时间范围
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<MRStatsVo> roomRankStats(@Param("start") Date start, @Param("end") Date end);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务情况
|
||||||
|
*
|
||||||
|
* @param start 开始时间范围
|
||||||
|
* @param end 结束时间范围
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<MRStatsVo> serveStats(@Param("start") Date start, @Param("end") Date end);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会议室形式统计
|
||||||
|
*
|
||||||
|
* @param start 开始时间范围
|
||||||
|
* @param end 结束时间范围
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<MRStatsVo> roomTypeStats(@Param("start") Date start, @Param("end") Date end);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门开会情况 top10
|
||||||
|
*
|
||||||
|
* @param start 开始时间范围
|
||||||
|
* @param end 结束时间范围
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<MRStatsVo> orgMeetingStats(@Param("start") Date start, @Param("end") Date end);
|
||||||
|
/**
|
||||||
|
* 开会情况 top20
|
||||||
|
*
|
||||||
|
* @param start 开始时间范围
|
||||||
|
* @param end 结束时间范围
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<MRStatsVo> everyDayStats(@Param("start") Date start, @Param("end") Date end);
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
package com.ics.admin.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface IMeetingStatsService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会议室统计 第一行
|
||||||
|
* @param day 格式:2024-09-30
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String, Integer> roomStats(String day);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日历 第二行左
|
||||||
|
* @param month 月份,格式:2024-09
|
||||||
|
*/
|
||||||
|
Map<String, List<JSONObject>> calendar(String month);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会议状态 第二行右上
|
||||||
|
*/
|
||||||
|
Map<String, Integer> meetingStats();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 会议待办 第二行右下
|
||||||
|
*/
|
||||||
|
List<Map<String, Object>> meetingAudit();
|
||||||
|
/**
|
||||||
|
* 图表统计
|
||||||
|
*
|
||||||
|
* @param start 开始时间范围
|
||||||
|
* @param end 结束时间范围
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String, Object> chartStats(Date start, Date end);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,166 @@
|
|||||||
|
package com.ics.admin.service.impl;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.ics.admin.mapper.MeetingStatsMapper;
|
||||||
|
import com.ics.admin.service.IMeetingStatsService;
|
||||||
|
import com.ics.admin.vo.MRStatsVo;
|
||||||
|
import com.ics.common.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* created at 2024-9-29 16:32
|
||||||
|
*
|
||||||
|
* @author lujiang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class IMeetingStatsServiceImpl implements IMeetingStatsService {
|
||||||
|
@Autowired
|
||||||
|
private MeetingStatsMapper meetingStatsMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Integer> roomStats(String day) {
|
||||||
|
Map<String, Integer> map = new HashMap<>();
|
||||||
|
List<MRStatsVo> list = meetingStatsMapper.roomStats(day);
|
||||||
|
if (list.size() > 0) {
|
||||||
|
MRStatsVo mrStatsVo = list.get(0);
|
||||||
|
map.put("alreadyBooking", mrStatsVo.getBooking());
|
||||||
|
map.put("noBooking", mrStatsVo.getZs() - mrStatsVo.getBooking());
|
||||||
|
map.put("going", mrStatsVo.getGoing());
|
||||||
|
map.put("free", mrStatsVo.getZs() - mrStatsVo.getGoing());
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, List<JSONObject>> calendar(String month) {
|
||||||
|
Map<String, List<JSONObject>> map = new HashMap<>();
|
||||||
|
Date date = DateUtils.dateTime(DateUtils.YYYY_MM_DD, month + "-01");
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(date);
|
||||||
|
int lastDay = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
|
||||||
|
for (int i = 0; i < lastDay; i++) {
|
||||||
|
if (i > 0) calendar.add(Calendar.DATE, 1);
|
||||||
|
String key = DateUtils.dateTime(calendar.getTime());
|
||||||
|
map.put(key, new ArrayList<>());
|
||||||
|
}
|
||||||
|
List<MRStatsVo> datas = meetingStatsMapper.calendar(month);
|
||||||
|
for (MRStatsVo mrStatsVo : datas) {
|
||||||
|
String key = mrStatsVo.getName();
|
||||||
|
JSONObject one = new JSONObject();
|
||||||
|
one.put("id", mrStatsVo.getId());
|
||||||
|
one.put("sn", mrStatsVo.getSn());
|
||||||
|
one.put("title", mrStatsVo.getTitle());
|
||||||
|
one.put("time", mrStatsVo.getTime());
|
||||||
|
one.put("org", mrStatsVo.getOrg());
|
||||||
|
map.get(key).add(one);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Integer> meetingStats() {
|
||||||
|
Map<String, Integer> map = new HashMap<>();
|
||||||
|
List<MRStatsVo> list = meetingStatsMapper.meetingStats();
|
||||||
|
if (list.size() > 0) {
|
||||||
|
MRStatsVo mrStatsVo = list.get(0);
|
||||||
|
map.put("wait", mrStatsVo.getWait());
|
||||||
|
map.put("going", mrStatsVo.getGoing());
|
||||||
|
map.put("closed", mrStatsVo.getClosed());
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Map<String, Object>> meetingAudit() {
|
||||||
|
List<Map<String, Object>> list = new ArrayList<>();
|
||||||
|
List<MRStatsVo> datas = meetingStatsMapper.meetingAudit();
|
||||||
|
for (MRStatsVo mrStatsVo : datas) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("id", mrStatsVo.getId());
|
||||||
|
map.put("title", mrStatsVo.getTitle());
|
||||||
|
map.put("time", mrStatsVo.getTime());
|
||||||
|
map.put("org", mrStatsVo.getOrg());
|
||||||
|
list.add(map);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> chartStats(Date start, Date end) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
if (true) { //会议室使用排名
|
||||||
|
Map<String, Object> roomRank = new HashMap<>();
|
||||||
|
List<String> y = new ArrayList<>();
|
||||||
|
List<Long> zs = new ArrayList<>();
|
||||||
|
List<MRStatsVo> list = meetingStatsMapper.roomRankStats(start, end);
|
||||||
|
for (MRStatsVo mrStatsVo : list) {
|
||||||
|
y.add(mrStatsVo.getName());
|
||||||
|
zs.add(mrStatsVo.getValue());
|
||||||
|
}
|
||||||
|
roomRank.put("y", y);
|
||||||
|
roomRank.put("total", zs);
|
||||||
|
map.put("roomRank", roomRank);
|
||||||
|
}
|
||||||
|
if (true) {//服务情况
|
||||||
|
List<Map<String, Object>> serve = new ArrayList<>();
|
||||||
|
List<MRStatsVo> list = meetingStatsMapper.serveStats(start, end);
|
||||||
|
for (MRStatsVo mrStatsVo : list) {
|
||||||
|
serve.add(getMap(mrStatsVo.getName(), mrStatsVo.getValue()));
|
||||||
|
}
|
||||||
|
map.put("serve", serve);
|
||||||
|
}
|
||||||
|
if (true) {//会议室形式统计
|
||||||
|
List<Map<String, Object>> roomType = new ArrayList<>();
|
||||||
|
List<MRStatsVo> list = meetingStatsMapper.roomTypeStats(start, end);
|
||||||
|
for (MRStatsVo mrStatsVo : list) {
|
||||||
|
roomType.add(getMap(mrStatsVo.getName(), mrStatsVo.getValue()));
|
||||||
|
}
|
||||||
|
map.put("roomType", roomType);
|
||||||
|
}
|
||||||
|
if (true) {//部门开会情况
|
||||||
|
Map<String, Object> orgMeeting = new HashMap<>();
|
||||||
|
List<String> x = new ArrayList<>();
|
||||||
|
List<Long> total = new ArrayList<>();
|
||||||
|
List<MRStatsVo> list = meetingStatsMapper.orgMeetingStats(start, end);
|
||||||
|
for (MRStatsVo mrStatsVo : list) {
|
||||||
|
x.add(mrStatsVo.getName());
|
||||||
|
total.add(mrStatsVo.getValue());
|
||||||
|
}
|
||||||
|
orgMeeting.put("x", x);
|
||||||
|
orgMeeting.put("total", total);
|
||||||
|
map.put("orgMeeting", orgMeeting);
|
||||||
|
}
|
||||||
|
if (true) {//开会情况--按天--top20
|
||||||
|
Map<String, Object> everyDay = new HashMap<>();
|
||||||
|
List<String> x = new ArrayList<>();
|
||||||
|
List<Long> total = new ArrayList<>();
|
||||||
|
List<MRStatsVo> list = meetingStatsMapper.everyDayStats(start, end);
|
||||||
|
for (MRStatsVo mrStatsVo : list) {
|
||||||
|
x.add(mrStatsVo.getName());
|
||||||
|
total.add(mrStatsVo.getValue());
|
||||||
|
}
|
||||||
|
everyDay.put("x", x);
|
||||||
|
everyDay.put("total", total);
|
||||||
|
map.put("everyDay", everyDay);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String, Object> getMap(String name, Object value) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
map.put("name", name);
|
||||||
|
map.put("value", value);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,50 @@
|
|||||||
|
package com.ics.admin.vo;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* created at 2024-9-29 17:11
|
||||||
|
*
|
||||||
|
* @author lujiang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MRStatsVo implements Serializable {
|
||||||
|
private static final long serialVersionUID = -202409291712L;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private Long value;
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
private Date start;
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
private Date end;
|
||||||
|
|
||||||
|
//总数
|
||||||
|
private Integer zs;
|
||||||
|
//预约数
|
||||||
|
private Integer booking;
|
||||||
|
//进行中会议数量
|
||||||
|
private Integer going;
|
||||||
|
|
||||||
|
//待开始会议数量
|
||||||
|
private Integer wait;
|
||||||
|
|
||||||
|
//已结束会议数量
|
||||||
|
private Integer closed;
|
||||||
|
|
||||||
|
//---会议待办
|
||||||
|
private Long id;
|
||||||
|
private String sn;
|
||||||
|
private String title;
|
||||||
|
private String time;
|
||||||
|
private String org;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,106 @@
|
|||||||
|
<?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.ics.admin.mapper.MeetingStatsMapper">
|
||||||
|
<!-- 会议室统计 第一行 -->
|
||||||
|
<select id="roomStats" resultType="com.ics.admin.vo.MRStatsVo">
|
||||||
|
<![CDATA[
|
||||||
|
select
|
||||||
|
count(name) zs ,sum(booking) booking,sum(going) going
|
||||||
|
from (
|
||||||
|
select room.name,
|
||||||
|
case when count(mr.id)>0 then 1 else 0 end as booking,
|
||||||
|
case when count(case when mr.status=9 then 1 else null end)>0 then 1 else 0 end as going
|
||||||
|
from ics_meeting_room room left join ics_meeting_reservation mr on room.id=mr.room_id
|
||||||
|
and room.delete_flag=0 and mr.delete_flag=0 and mr.status>3 and mr.start LIKE CONCAT(#{day}, '%')
|
||||||
|
group by room.name
|
||||||
|
) zj
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 日历 第二行左 -->
|
||||||
|
<select id="calendar" resultType="com.ics.admin.vo.MRStatsVo">
|
||||||
|
<![CDATA[
|
||||||
|
select
|
||||||
|
id,sn,title,DATE_FORMAT(start,'%Y-%m-%d') name,
|
||||||
|
CONCAT(DATE_FORMAT(start,'%Y-%m-%d %H:%i'), '~',DATE_FORMAT(`end`,'%H:%i')) time,user_org org
|
||||||
|
from ics_meeting_reservation mr where mr.delete_flag=0 and mr.status>3 and start like CONCAT(#{month}, '%') order by start
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 会议状态 第二行右上 -->
|
||||||
|
<select id="meetingStats" resultType="com.ics.admin.vo.MRStatsVo">
|
||||||
|
<![CDATA[
|
||||||
|
select sum(`wait`) `wait`,sum(going) going,sum(closed) closed from
|
||||||
|
(select
|
||||||
|
case when mr.status=7 then 1 else 0 end as `wait`,
|
||||||
|
case when mr.status=9 then 1 else 0 end as going,
|
||||||
|
case when mr.status=11 then 1 else 0 end as closed
|
||||||
|
from ics_meeting_reservation mr where mr.delete_flag=0 and mr.status>=7
|
||||||
|
) zj
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 会议待办 第二行右下 -->
|
||||||
|
<select id="meetingAudit" resultType="com.ics.admin.vo.MRStatsVo">
|
||||||
|
<![CDATA[
|
||||||
|
select
|
||||||
|
id,title,CONCAT(DATE_FORMAT(start,'%Y-%m-%d %H:%i'), '~',DATE_FORMAT(`end`,'%H:%i')) `time`,user_org org
|
||||||
|
from ics_meeting_reservation mr where mr.delete_flag=0 and mr.status=5 order by mr.start limit 10
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- ====下面为图表======== -->
|
||||||
|
<!--会议室使用排名-->
|
||||||
|
<select id="roomRankStats" resultType="com.ics.admin.vo.MRStatsVo">
|
||||||
|
<![CDATA[
|
||||||
|
select room.name name,count(mr.id) value
|
||||||
|
from ics_meeting_room room left join ics_meeting_reservation mr
|
||||||
|
on room.id=mr.room_id and room.delete_flag=0 and mr.delete_flag=0 and mr.status>7 and mr.start between #{start} and #{end}
|
||||||
|
GROUP BY room.name order by room.id
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 服务情况 -->
|
||||||
|
<select id="serveStats" resultType="com.ics.admin.vo.MRStatsVo">
|
||||||
|
<![CDATA[
|
||||||
|
select ms.name name,count(ms.id) value
|
||||||
|
from ics_meeting_serve ms,ics_meeting_reservation mr
|
||||||
|
where ms.rid=mr.id and ms.delete_flag=0 and mr.delete_flag=0 and mr.status>7 and mr.start between #{start} and #{end}
|
||||||
|
GROUP BY ms.name order by ms.id
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 会议室形式统计 -->
|
||||||
|
<select id="roomTypeStats" resultType="com.ics.admin.vo.MRStatsVo">
|
||||||
|
<![CDATA[
|
||||||
|
select type.dict_label name,count(jl.id) value from sys_dict_data type left join
|
||||||
|
(select room.type_id typeid,mr.id from ics_meeting_room room,ics_meeting_reservation mr
|
||||||
|
where mr.room_id=room.id and room.delete_flag=0 and mr.delete_flag=0
|
||||||
|
and mr.status>7 and mr.start between #{start} and #{end}) jl
|
||||||
|
on type.dict_value=jl.typeid
|
||||||
|
where type.dict_type='mm_type' and type.status=0
|
||||||
|
group by type.dict_label,type.dict_type order by type.dict_sort
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 部门开会情况 -->
|
||||||
|
<select id="orgMeetingStats" resultType="com.ics.admin.vo.MRStatsVo">
|
||||||
|
<![CDATA[
|
||||||
|
select mr.user_org name,count(mr.id) value from ics_meeting_reservation mr
|
||||||
|
where mr.delete_flag=0 and mr.status>7 and mr.start between #{start} and #{end}
|
||||||
|
GROUP BY mr.user_org order by value desc limit 10
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 开会情况 -->
|
||||||
|
<select id="everyDayStats" resultType="com.ics.admin.vo.MRStatsVo">
|
||||||
|
<![CDATA[
|
||||||
|
select rq name,count(id) value FROM(
|
||||||
|
select id,DATE_FORMAT(start,'%m月%d日') rq from ics_meeting_reservation mr where mr.delete_flag=0 and mr.status>7 and mr.start between #{start} and #{end}
|
||||||
|
) d GROUP BY rq order by rq limit 20
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 80 KiB |
Loading…
x
Reference in New Issue
Block a user