From 5f7a61e50bcf82f368272e29518b2bd3a85e4782 Mon Sep 17 00:00:00 2001
From: eight <641137800@qq.com>
Date: 星期三, 14 八月 2024 10:59:18 +0800
Subject: [PATCH] update
---
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java | 7 +++++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueServiceImpl.java | 8 ++++++++
sql/mysql/jh.sql | 3 +--
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/queueMapper.java | 15 +++++++++++++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/queue/QueueStatisticDO.java | 20 ++++++++++++++++++++
jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueService.java | 5 +++++
6 files changed, 56 insertions(+), 2 deletions(-)
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java
index 55fd0ab..8a370d8 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/controller/admin/appointment/AppointmentController.java
@@ -4,6 +4,7 @@
import cn.lihu.jh.framework.common.enums.CommonStatusEnum;
import cn.lihu.jh.module.ecg.controller.admin.queue.vo.QueueSaveReqVO;
import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO;
+import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueStatisticDO;
import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomStatisticsDO;
import cn.lihu.jh.module.ecg.feign.RemoteDataService;
import cn.lihu.jh.module.ecg.feign.RestApiReqBodyVo;
@@ -215,6 +216,12 @@
List<RoomStatisticsDO> roomStatisticsList = roomService.roomStatistics();
roomStatisticsList.size();
+ List statusList = new ArrayList<Byte>();
+ statusList.add((byte)20);
+ statusList.add((byte)30);
+ List<QueueStatisticDO> queueStatisticDOList = queueService.queueStatistics(statusList);
+ queueStatisticDOList.size();
+
return success("hello");
}
}
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/queue/QueueStatisticDO.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/queue/QueueStatisticDO.java
new file mode 100644
index 0000000..86ce7c7
--- /dev/null
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/dataobject/queue/QueueStatisticDO.java
@@ -0,0 +1,20 @@
+package cn.lihu.jh.module.ecg.dal.dataobject.queue;
+
+import cn.lihu.jh.framework.mybatis.core.dataobject.BaseDO;
+import com.baomidou.mybatisplus.annotation.KeySequence;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+/**
+ * 鎺掗槦 DO
+ *
+ * @author 鑺嬮亾婧愮爜
+ */
+@Data
+public class QueueStatisticDO {
+
+ private Byte status;
+
+ private Integer totalInStatus;
+}
\ No newline at end of file
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/queueMapper.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/queueMapper.java
index 30a3e14..1cd7419 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/queueMapper.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/dal/mysql/queue/queueMapper.java
@@ -4,8 +4,14 @@
import cn.lihu.jh.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.lihu.jh.framework.mybatis.core.mapper.BaseMapperX;
import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO;
+import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueStatisticDO;
+import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomStatisticsDO;
import org.apache.ibatis.annotations.Mapper;
import cn.lihu.jh.module.ecg.controller.admin.queue.vo.*;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
/**
* 鎺掗槦 Mapper
@@ -32,4 +38,13 @@
.orderByDesc(QueueDO::getId));
}
+ @Select("<script>" +
+ "SELECT status, count(1) as total_in_status FROM lihu.queue where status in (" +
+ " <foreach collection='statusList' separator=',' item='status'>" +
+ " #{status} " +
+ " </foreach> )" +
+ " group by status; "
+ +"</script>")
+
+ List<QueueStatisticDO> queueStatistic(@Param("statusList")List<Byte> statusList);
}
\ No newline at end of file
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueService.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueService.java
index c51ebad..101ded9 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueService.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueService.java
@@ -3,8 +3,11 @@
import cn.lihu.jh.module.ecg.controller.admin.queue.vo.*;
import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueDO;
import cn.lihu.jh.framework.common.pojo.PageResult;
+import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueStatisticDO;
+import cn.lihu.jh.module.ecg.dal.dataobject.room.RoomStatisticsDO;
import javax.validation.Valid;
+import java.util.List;
/**
* 鎺掗槦 Service 鎺ュ彛
@@ -51,4 +54,6 @@
*/
PageResult<QueueDO> getqueuePage(QueuePageReqVO pageReqVO);
+ List<QueueStatisticDO> queueStatistics(List<Byte> statusList);
+
}
\ No newline at end of file
diff --git a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueServiceImpl.java b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueServiceImpl.java
index 98a3b40..936379e 100644
--- a/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueServiceImpl.java
+++ b/jh-module-ecg/jh-module-ecg-biz/src/main/java/cn/lihu/jh/module/ecg/service/queue/queueServiceImpl.java
@@ -1,5 +1,6 @@
package cn.lihu.jh.module.ecg.service.queue;
+import cn.lihu.jh.module.ecg.dal.dataobject.queue.QueueStatisticDO;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
@@ -11,6 +12,8 @@
import cn.lihu.jh.module.ecg.dal.mysql.queue.queueMapper;
import javax.annotation.Resource;
+
+import java.util.List;
import static cn.lihu.jh.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.lihu.jh.module.ecg.enums.ErrorCodeConstants.*;
@@ -69,4 +72,9 @@
return queueMapper.selectPage(pageReqVO);
}
+ @Override
+ public List<QueueStatisticDO> queueStatistics(List<Byte> statusList) {
+ return queueMapper.queueStatistic(statusList);
+ }
+
}
\ No newline at end of file
diff --git a/sql/mysql/jh.sql b/sql/mysql/jh.sql
index 5ff5473..6dc166f 100644
--- a/sql/mysql/jh.sql
+++ b/sql/mysql/jh.sql
@@ -61,8 +61,7 @@
`updater` varchar(10) DEFAULT '' COMMENT '鏇存柊鑰�',
`update_time` datetime NOT NULL COMMENT '鏇存柊鏃堕棿',
`deleted` bit(1) DEFAULT 0 COMMENT '鍒犻櫎鏍囪',
- PRIMARY KEY (`id`),
- UNIQUE KEY `idx_seq_id` (`seq_num`)
+ PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='鎺掗槦琛�';
--
Gitblit v1.9.3