运维文档
Centos7运维命令
Centos7在线搭建docker的elasticsearch环境(单节点)
Centos7使用阿里云yum源
Centos7 Yum相关软件在线安装
Windows运维
工具类运维
禅道系统运维
git使用培训
Docker搭建Hadoop环境
Docker搭建Hadoop环境(新)
Mysql运维
MySQL 索引
Mysql模拟故障恢复案例过程
常用Sql
Docker维护命令
Git常用操作命令
搭建ZSK服务
SVN常用操作命令及维护
Ubuntu相关运维
gitlab安装升级操作
openEuler运维命令
常用统计SQL-治未病
服务人数-活动档案统计
Oracle数据库管理
Windows安装VC2015\VC2017
Idea离线开发的Maven设置
慢病治未病部署步骤
Centos7升级openssh+openssl
OpenEuler22.03源码编译安装Nginx
Centos7 ISO文件做本地yum源
本文档使用 MrDoc 发布
-
+
首页
服务人数-活动档案统计
## 服务人数统计 ```SQL select YEAR(diagnosisTime) 服务年份, count(1) 服务人次 from admin_health_records hr where hr.clinicId in ( select clinic_id from sys_user u where u.del_flag = 0 and u.dept_id in( select dept_id from sys_dept where dept_id = 1440536945641000 or FIND_IN_SET(1440536945641000, ancestors) and status = 0 and del_flag = 0 ) ) and hr.diagnosisTime >= '2020-01-01 00:00:00' and hr.diagnosisTime <= '2022-12-31 23:59:59' group by YEAR(diagnosisTime) ``` ## 活动档案统计 ```SQL select y 服务年份, count(1) 活动档案数 from ( select distinct patientId, y from( select p.id patientId, year(p.createTime) y from admin_patient p where p.createBy in ( select user_id from sys_user u where u.del_flag = 0 and u.dept_id in( select dept_id from sys_dept where dept_id = 1440536945641000 or FIND_IN_SET(1440536945641000, ancestors) and status = 0 and del_flag = 0 ) ) and p.createTime >= '2020-01-01 00:00:00' and p.createTime <= '2020-03-31 23:59:59' union all select patientId, YEAR(diagnosisTime) y from admin_health_records hr where clinicId in( select clinic_id from sys_user u where u.del_flag = 0 and u.dept_id in( select dept_id from sys_dept where dept_id = 1440536945641000 or FIND_IN_SET(1440536945641000, ancestors) and status = 0 and del_flag = 0 ) ) and hr.diagnosisTime >= '2020-01-01 00:00:00' and hr.diagnosisTime <= '2020-03-31 23:59:59' ) t )t2 group by y ```
张文海
2024年2月23日 14:00
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
Markdown文件
分享
链接
类型
密码
更新密码