Compare commits
28
Commits
develop
...
073efdd34f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
073efdd34f | ||
|
|
bc40b561dc | ||
|
|
b9ea233a45 | ||
|
|
670f36a57b | ||
|
|
3733d442cc | ||
|
|
061749cfb3 | ||
|
|
0b403a559e | ||
|
|
8fd4cd9253 | ||
|
|
10d5e6ca4a | ||
|
|
d98884ea4c | ||
|
|
bab238daae | ||
|
|
5233e6cb4b | ||
|
|
224dae23ee | ||
|
|
5f790c0c7e | ||
|
|
890cdfe40d | ||
|
|
909ccacaeb | ||
|
|
9b3021e847 | ||
|
|
264ca97055 | ||
|
|
9251e202f3 | ||
|
|
5885cd2ea0 | ||
|
|
d2a2f8291c | ||
|
|
a38f8adfc8 | ||
|
|
4c98dd2d30 | ||
|
|
b751f40bb4 | ||
|
|
61045e4389 | ||
|
|
a3cb8a45ad | ||
|
|
fb5f142127 | ||
|
|
2c0d684079 |
@@ -0,0 +1,111 @@
|
||||
DROP TABLE "20250917_CARE";
|
||||
DROP TABLE "ARC_ASSESS_VALUE";
|
||||
DROP TABLE "ARC_FOOD_ATLAS";
|
||||
DROP TABLE "ARC_QUESTIONNAIRE";
|
||||
DROP TABLE "ARC_QUESTIONNAIRE_CHILD";
|
||||
DROP TABLE "CESHI_NOTE";
|
||||
DROP TABLE "COMMON_EXPORTS_INFO_QH";
|
||||
DROP TABLE "COMMON_EXPORTS_ITEM_QH";
|
||||
DROP TABLE "COMMON_IMPORTS_DETAIL_QH";
|
||||
DROP TABLE "COMMON_IMPORTS_QH";
|
||||
DROP TABLE "CON_COST_STATISTICS";
|
||||
DROP TABLE "CON_DEPARTMENT";
|
||||
DROP TABLE "CON_DOCTOR_FOLLOW";
|
||||
DROP TABLE "CON_DOCTOR_SCHEDULING";
|
||||
DROP TABLE "CON_DOCTOR_SCHEDULING_DATE";
|
||||
DROP TABLE "CON_EVALUATE";
|
||||
DROP TABLE "CON_FAMILY_MEMBERS";
|
||||
DROP TABLE "CON_HEALTH_INFO";
|
||||
DROP TABLE "CON_HEALTH_INFO_ANSWER";
|
||||
DROP TABLE "CON_HOSPITAL_FOLLOW";
|
||||
DROP TABLE "CON_KNOWLEDGE";
|
||||
DROP TABLE "CON_KNOWLEDGE_CATEGORY";
|
||||
DROP TABLE "CON_MEDICAL_RECORDS";
|
||||
DROP TABLE "CON_SESSION_RESERVATION_DATE";
|
||||
DROP TABLE "DEMO";
|
||||
DROP TABLE "DEMO_FIELD_DEF_VAL_MAIN";
|
||||
DROP TABLE "DEMO_FIELD_DEF_VAL_SUB";
|
||||
DROP TABLE "EMERGENCY_SERIOUS_DISEASE";
|
||||
DROP TABLE "HEALTH_CLASSIFICATION";
|
||||
DROP TABLE "HEALTH_USER_EMPLOYEE_EX_QH";
|
||||
DROP TABLE "JEECG_MONTHLY_GROWTH_ANALYSIS";
|
||||
DROP TABLE "JEECG_ORDER_CUSTOMER";
|
||||
DROP TABLE "JEECG_ORDER_MAIN";
|
||||
DROP TABLE "JEECG_ORDER_TICKET";
|
||||
DROP TABLE "JEECG_PROJECT_NATURE_INCOME";
|
||||
DROP TABLE "JIMU_DICT";
|
||||
DROP TABLE "JIMU_DICT_ITEM";
|
||||
DROP TABLE "JIMU_REPORT";
|
||||
DROP TABLE "JIMU_REPORT_DATA_SOURCE";
|
||||
DROP TABLE "JIMU_REPORT_DB";
|
||||
DROP TABLE "JIMU_REPORT_DB_FIELD";
|
||||
DROP TABLE "JIMU_REPORT_DB_PARAM";
|
||||
DROP TABLE "JIMU_REPORT_LINK";
|
||||
DROP TABLE "JIMU_REPORT_MAP";
|
||||
DROP TABLE "JIMU_REPORT_SHARE";
|
||||
DROP TABLE "JOA_DEMO";
|
||||
DROP TABLE "LORE_CHECK_SUBJECT";
|
||||
DROP TABLE "ONL_AUTH_DATA";
|
||||
DROP TABLE "ONL_AUTH_PAGE";
|
||||
DROP TABLE "ONL_AUTH_RELATION";
|
||||
DROP TABLE "ONL_CGFORM_BUTTON";
|
||||
DROP TABLE "ONL_CGFORM_ENHANCE_JAVA";
|
||||
DROP TABLE "ONL_CGFORM_ENHANCE_JS";
|
||||
DROP TABLE "ONL_CGFORM_ENHANCE_SQL";
|
||||
DROP TABLE "ONL_CGFORM_FIELD";
|
||||
DROP TABLE "ONL_CGFORM_HEAD";
|
||||
DROP TABLE "ONL_CGFORM_INDEX";
|
||||
DROP TABLE "ONL_CGREPORT_HEAD";
|
||||
DROP TABLE "ONL_CGREPORT_ITEM";
|
||||
DROP TABLE "ONL_CGREPORT_PARAM";
|
||||
DROP TABLE "OSS_FILE";
|
||||
DROP TABLE "QRTZ_BLOB_TRIGGERS";
|
||||
DROP TABLE "QRTZ_CALENDARS";
|
||||
DROP TABLE "QRTZ_CRON_TRIGGERS";
|
||||
DROP TABLE "QRTZ_FIRED_TRIGGERS";
|
||||
DROP TABLE "QRTZ_JOB_DETAILS" CASCADE;
|
||||
DROP TABLE "QRTZ_LOCKS";
|
||||
DROP TABLE "QRTZ_PAUSED_TRIGGER_GRPS";
|
||||
DROP TABLE "QRTZ_SCHEDULER_STATE";
|
||||
DROP TABLE "QRTZ_SIMPLE_TRIGGERS";
|
||||
DROP TABLE "QRTZ_SIMPROP_TRIGGERS";
|
||||
DROP TABLE "QRTZ_TRIGGERS";
|
||||
DROP TABLE "REP_DEMO_DXTJ";
|
||||
DROP TABLE "REP_DEMO_EMPLOYEE";
|
||||
DROP TABLE "REP_DEMO_GONGSI";
|
||||
DROP TABLE "REP_DEMO_JIANPIAO";
|
||||
DROP TABLE "SYS_APP_VERSION_QH";
|
||||
DROP TABLE "SYS_DEPART_COPY1";
|
||||
DROP TABLE "SYS_DEPART_GPS_QH";
|
||||
DROP TABLE "SYS_DEPART_QH";
|
||||
DROP TABLE "SYS_LOG_QH";
|
||||
DROP TABLE "SYS_PERMISSION_20241224";
|
||||
DROP TABLE "SYS_PERMISSION_DATA_RULE_QH";
|
||||
DROP TABLE "SYS_PERMISSION_QH";
|
||||
DROP TABLE "SYS_ROLE_INDEX_QH";
|
||||
DROP TABLE "SYS_ROLE_PERMISSION_QH";
|
||||
DROP TABLE "SYS_ROLE_QH";
|
||||
DROP TABLE "SYS_USER_DEPART_CHANGE_APPLY_QH";
|
||||
DROP TABLE "SYS_USER_DEPART_QH";
|
||||
DROP TABLE "SYS_USER_QH";
|
||||
DROP TABLE "SYS_USER_ROLE_QH";
|
||||
DROP TABLE "TEST_DEMO";
|
||||
DROP TABLE "TEST_ENHANCE_SELECT";
|
||||
DROP TABLE "TEST_NOTE";
|
||||
DROP TABLE "TEST_ORDER_CUSTOMER";
|
||||
DROP TABLE "TEST_ORDER_MAIN";
|
||||
DROP TABLE "TEST_ORDER_PRODUCT";
|
||||
DROP TABLE "TEST_SHOPTYPE_TREE";
|
||||
DROP TABLE "TEST_V3_HELLO";
|
||||
DROP TABLE "TMP_REPORT_DATA_1";
|
||||
DROP TABLE "TMP_REPORT_DATA_INCOME";
|
||||
DROP TABLE "REMOTE_WEIGHT_MANUFACTURER_INBODY";
|
||||
DROP TABLE "REMOTE_WEIGHT_MANUFACTURER_LEFU";
|
||||
DROP TABLE "REMOTE_WEIGHT_MANUFACTURER_ONE";
|
||||
DROP TABLE "REMOTE_WEIGHT_MANUFACTURER_TWO";
|
||||
DROP TABLE "REMOTE_WEIGHT_NORMATIVE_DATA";
|
||||
DROP TABLE "HEALTH_USER_DOCTOR_BASE_EX";
|
||||
DROP TABLE "HOSPITAL_DEPARTMENT";
|
||||
DROP TABLE "STATION_HOSPITAL";
|
||||
DROP TABLE "SYS_APP_VERSION";
|
||||
DROP TABLE "USER_INFORMATION";
|
||||
@@ -0,0 +1,92 @@
|
||||
-- ============================================================
|
||||
-- System 服务数据库表名修改脚本(达梦 DM8)
|
||||
-- 规则:统一以 QH_ 开头,第二级三字母业务模块前缀,总长度 ≤ 25 位
|
||||
-- 生成日期:2026-03-10
|
||||
-- 涉及表数:76 张
|
||||
-- ============================================================
|
||||
|
||||
-- ===== COM 公共模块(4 张)=====
|
||||
ALTER TABLE "COMMON_EXPORTS_INFO" RENAME TO "QH_COM_EXPORTS_INFO";
|
||||
ALTER TABLE "COMMON_EXPORTS_ITEM" RENAME TO "QH_COM_EXPORTS_ITEM";
|
||||
ALTER TABLE "COMMON_IMPORTS" RENAME TO "QH_COM_IMPORTS";
|
||||
ALTER TABLE "COMMON_IMPORTS_DETAIL" RENAME TO "QH_COM_IMPORTS_DETAIL";
|
||||
|
||||
-- ===== HLT 健康模块(6 张)=====
|
||||
ALTER TABLE "HEALTH_CONSULT_RESOURCE" RENAME TO "QH_HLT_CONSULT_RESOURCE";
|
||||
ALTER TABLE "HEALTH_HOLIDAY" RENAME TO "QH_HLT_HOLIDAY";
|
||||
ALTER TABLE "HEALTH_USER_DOCTOR_EX" RENAME TO "QH_HLT_DOCTOR_EX";
|
||||
ALTER TABLE "HEALTH_USER_EMPLOYEE_EX" RENAME TO "QH_HLT_USER_EMPLOYEE_EX";
|
||||
ALTER TABLE "HEALTH_USER_OPERATOR_EX" RENAME TO "QH_HLT_USER_OPERATOR_EX";
|
||||
ALTER TABLE "HEALTH_USER_STATION_EX" RENAME TO "QH_HLT_USER_STATION_EX";
|
||||
|
||||
-- ===== SCL 体测模块(2 张)=====
|
||||
ALTER TABLE "SCALE_HEIGHT" RENAME TO "QH_SCL_HEIGHT";
|
||||
ALTER TABLE "SCALE_PERSONAL" RENAME TO "QH_SCL_PERSONAL";
|
||||
|
||||
-- ===== SYS 系统模块(52 张)=====
|
||||
ALTER TABLE "SYS_ANNOUNCEMENT" RENAME TO "QH_SYS_ANNOUNCEMENT";
|
||||
ALTER TABLE "SYS_ANNOUNCEMENT_SEND" RENAME TO "QH_SYS_ANNOUNCEMENT_SEND";
|
||||
ALTER TABLE "SYS_BANNER" RENAME TO "QH_SYS_BANNER";
|
||||
ALTER TABLE "SYS_CATEGORY" RENAME TO "QH_SYS_CATEGORY";
|
||||
ALTER TABLE "SYS_CHECK_RULE" RENAME TO "QH_SYS_CHECK_RULE";
|
||||
ALTER TABLE "SYS_COMMENT" RENAME TO "QH_SYS_COMMENT";
|
||||
ALTER TABLE "SYS_CONFIG" RENAME TO "QH_SYS_CONFIG";
|
||||
ALTER TABLE "SYS_DATA_LOG" RENAME TO "QH_SYS_DATA_LOG";
|
||||
ALTER TABLE "SYS_DATA_SOURCE" RENAME TO "QH_SYS_DATA_SOURCE";
|
||||
ALTER TABLE "SYS_DEPART" RENAME TO "QH_SYS_DEPART";
|
||||
ALTER TABLE "SYS_DEPART_GPS" RENAME TO "QH_SYS_DEPART_GPS";
|
||||
ALTER TABLE "SYS_DEPART_PERMISSION" RENAME TO "QH_SYS_DEPART_PERMISSION";
|
||||
ALTER TABLE "SYS_DEPART_ROLE" RENAME TO "QH_SYS_DEPART_ROLE";
|
||||
ALTER TABLE "SYS_DEPART_ROLE_PERMISSION" RENAME TO "QH_SYS_DEPT_ROLE_PERM";
|
||||
ALTER TABLE "SYS_DEPART_ROLE_USER" RENAME TO "QH_SYS_DEPART_ROLE_USER";
|
||||
ALTER TABLE "SYS_DICT" RENAME TO "QH_SYS_DICT";
|
||||
ALTER TABLE "SYS_DICT_ITEM" RENAME TO "QH_SYS_DICT_ITEM";
|
||||
ALTER TABLE "SYS_FILES" RENAME TO "QH_SYS_FILES";
|
||||
ALTER TABLE "SYS_FILL_RULE" RENAME TO "QH_SYS_FILL_RULE";
|
||||
ALTER TABLE "SYS_FORM_FILE" RENAME TO "QH_SYS_FORM_FILE";
|
||||
ALTER TABLE "SYS_GATEWAY_ROUTE" RENAME TO "QH_SYS_GATEWAY_ROUTE";
|
||||
ALTER TABLE "SYS_IOS_REDEEM" RENAME TO "QH_SYS_IOS_REDEEM";
|
||||
ALTER TABLE "SYS_LOG" RENAME TO "QH_SYS_LOG";
|
||||
ALTER TABLE "SYS_MESSAGE_NOTICE" RENAME TO "QH_SYS_MSG_NOTICE";
|
||||
ALTER TABLE "SYS_MESSAGE_NOTICE_SCOPE" RENAME TO "QH_SYS_MSG_NOTICE_SCOPE";
|
||||
ALTER TABLE "SYS_MESSAGE_REMIND" RENAME TO "QH_SYS_MSG_REMIND";
|
||||
ALTER TABLE "SYS_NOTICE" RENAME TO "QH_SYS_NOTICE";
|
||||
ALTER TABLE "SYS_NOTICE_READ_RECORD" RENAME TO "QH_SYS_NOTICE_READ_RECORD";
|
||||
ALTER TABLE "SYS_PACK_PERMISSION" RENAME TO "QH_SYS_PACK_PERMISSION";
|
||||
ALTER TABLE "SYS_PERMISSION" RENAME TO "QH_SYS_PERMISSION";
|
||||
ALTER TABLE "SYS_PERMISSION_DATA_RULE" RENAME TO "QH_SYS_PERM_DATA_RULE";
|
||||
ALTER TABLE "SYS_PERMISSION_V2" RENAME TO "QH_SYS_PERMISSION_V2";
|
||||
ALTER TABLE "SYS_POSITION" RENAME TO "QH_SYS_POSITION";
|
||||
ALTER TABLE "SYS_POSITION_CLASSIFY" RENAME TO "QH_SYS_POSITION_CLASSIFY";
|
||||
ALTER TABLE "SYS_QUARTZ_JOB" RENAME TO "QH_SYS_QUARTZ_JOB";
|
||||
ALTER TABLE "SYS_ROLE" RENAME TO "QH_SYS_ROLE";
|
||||
ALTER TABLE "SYS_ROLE_INDEX" RENAME TO "QH_SYS_ROLE_INDEX";
|
||||
ALTER TABLE "SYS_ROLE_PERMISSION" RENAME TO "QH_SYS_ROLE_PERMISSION";
|
||||
ALTER TABLE "SYS_SMS" RENAME TO "QH_SYS_SMS";
|
||||
ALTER TABLE "SYS_SMS_TEMPLATE" RENAME TO "QH_SYS_SMS_TEMPLATE";
|
||||
ALTER TABLE "SYS_TENANT" RENAME TO "QH_SYS_TENANT";
|
||||
ALTER TABLE "SYS_TENANT_PACK" RENAME TO "QH_SYS_TENANT_PACK";
|
||||
ALTER TABLE "SYS_TENANT_PACK_PERMS" RENAME TO "QH_SYS_TENANT_PACK_PERMS";
|
||||
ALTER TABLE "SYS_TENANT_PACK_USER" RENAME TO "QH_SYS_TENANT_PACK_USER";
|
||||
ALTER TABLE "SYS_THIRD_ACCOUNT" RENAME TO "QH_SYS_THIRD_ACCOUNT";
|
||||
ALTER TABLE "SYS_USER" RENAME TO "QH_SYS_USER";
|
||||
ALTER TABLE "SYS_USER_AGENT" RENAME TO "QH_SYS_USER_AGENT";
|
||||
ALTER TABLE "SYS_USER_DEPART" RENAME TO "QH_SYS_USER_DEPART";
|
||||
ALTER TABLE "SYS_USER_DEPART_CHANGE_APPLY" RENAME TO "QH_SYS_DEPT_CHG_APPLY";
|
||||
ALTER TABLE "SYS_USER_DEVICE" RENAME TO "QH_SYS_USER_DEVICE";
|
||||
ALTER TABLE "SYS_USER_EMERGENCY_CONTACT" RENAME TO "QH_SYS_USR_EMERG_CONTACT";
|
||||
ALTER TABLE "SYS_USER_FAMILY_MEMBERS" RENAME TO "QH_SYS_USR_FAMILY_MBR";
|
||||
ALTER TABLE "SYS_USER_FAMILY_MEMBERS_REQUEST" RENAME TO "QH_SYS_USR_FAM_MBR_REQ";
|
||||
ALTER TABLE "SYS_USER_POST" RENAME TO "QH_SYS_USER_POST";
|
||||
ALTER TABLE "SYS_USER_ROLE" RENAME TO "QH_SYS_USER_ROLE";
|
||||
ALTER TABLE "SYS_USER_TENANT" RENAME TO "QH_SYS_USER_TENANT";
|
||||
ALTER TABLE "SYS_VERSION_APP" RENAME TO "QH_SYS_VERSION_APP";
|
||||
ALTER TABLE "SYS_VERSION_INFO" RENAME TO "QH_SYS_VERSION_INFO";
|
||||
|
||||
-- ===== USR 用户模块(12 张)=====
|
||||
ALTER TABLE "TBL_USER_WX_RELATION" RENAME TO "QH_USR_WX_RELATION";
|
||||
ALTER TABLE "USER_DATA_RECORD_BLOOD_ABO" RENAME TO "QH_USR_DATA_RCD_BLOOD_ABO";
|
||||
ALTER TABLE "USER_DATA_RECORD_BLOOD_PRESSURE" RENAME TO "QH_USR_DATA_RCD_BLD_PRS";
|
||||
ALTER TABLE "USER_DATA_RECORD_BMI" RENAME TO "QH_USR_DATA_RCD_BMI";
|
||||
ALTER TABLE "USER_DATA_RECORD_BWH" RENAME TO "QH_USR_DATA_RCD_BWH";
|
||||
ALTER TABLE "USER_WEIGHT_BIND" RENAME TO "QH_USR_WEIGHT_BIND";
|
||||
@@ -0,0 +1,69 @@
|
||||
-- ============================================================
|
||||
-- System 服务无用表删除脚本
|
||||
-- 说明:以下表在当前业务中已无实际使用,从原项目迁移而来
|
||||
-- 注意:QH_SYS_QUARTZ_JOB 和 QH_SYS_TENANT 谨慎处理,暂不删除
|
||||
-- 生成日期:2026-03-11
|
||||
-- 涉及表数:18 张
|
||||
-- ============================================================
|
||||
|
||||
|
||||
-- ============================================================
|
||||
-- 第一份:原表名(迁移前)
|
||||
-- ============================================================
|
||||
|
||||
-- HLT 健康模块
|
||||
DROP TABLE "HEALTH_USER_STATION_EX";
|
||||
|
||||
-- SCL 体测模块
|
||||
DROP TABLE "SCALE_HEIGHT";
|
||||
DROP TABLE "SCALE_PERSONAL";
|
||||
|
||||
-- SYS 系统模块
|
||||
DROP TABLE "SYS_FORM_FILE";
|
||||
DROP TABLE "SYS_IOS_REDEEM";
|
||||
DROP TABLE "SYS_PACK_PERMISSION";
|
||||
DROP TABLE "SYS_TENANT_PACK";
|
||||
DROP TABLE "SYS_TENANT_PACK_PERMS";
|
||||
DROP TABLE "SYS_TENANT_PACK_USER";
|
||||
DROP TABLE "SYS_THIRD_ACCOUNT";
|
||||
DROP TABLE "SYS_USER_FAMILY_MEMBERS";
|
||||
DROP TABLE "SYS_USER_FAMILY_MEMBERS_REQUEST";
|
||||
|
||||
-- USR 用户模块
|
||||
DROP TABLE "TBL_USER_WX_RELATION";
|
||||
DROP TABLE "USER_DATA_RECORD_BLOOD_PRESSURE";
|
||||
DROP TABLE "USER_DATA_RECORD_BLOOD_ABO";
|
||||
DROP TABLE "USER_DATA_RECORD_BMI";
|
||||
DROP TABLE "USER_DATA_RECORD_BWH";
|
||||
DROP TABLE "USER_WEIGHT_BIND";
|
||||
|
||||
|
||||
-- ============================================================
|
||||
-- 第二份:新表名(迁移后,QH_ 命名规范)
|
||||
-- ============================================================
|
||||
|
||||
-- HLT 健康模块
|
||||
DROP TABLE "QH_HLT_USER_STATION_EX";
|
||||
|
||||
-- SCL 体测模块
|
||||
DROP TABLE "QH_SCL_HEIGHT";
|
||||
DROP TABLE "QH_SCL_PERSONAL";
|
||||
|
||||
-- SYS 系统模块
|
||||
DROP TABLE "QH_SYS_FORM_FILE";
|
||||
DROP TABLE "QH_SYS_IOS_REDEEM";
|
||||
DROP TABLE "QH_SYS_PACK_PERMISSION";
|
||||
DROP TABLE "QH_SYS_TENANT_PACK";
|
||||
DROP TABLE "QH_SYS_TENANT_PACK_PERMS";
|
||||
DROP TABLE "QH_SYS_TENANT_PACK_USER";
|
||||
DROP TABLE "QH_SYS_THIRD_ACCOUNT";
|
||||
DROP TABLE "QH_SYS_USR_FAMILY_MBR";
|
||||
DROP TABLE "QH_SYS_USR_FAM_MBR_REQ";
|
||||
|
||||
-- USR 用户模块
|
||||
DROP TABLE "QH_USR_WX_RELATION";
|
||||
DROP TABLE "QH_USR_DATA_RCD_BLD_PRS";
|
||||
DROP TABLE "QH_USR_DATA_RCD_BLOOD_ABO";
|
||||
DROP TABLE "QH_USR_DATA_RCD_BMI";
|
||||
DROP TABLE "QH_USR_DATA_RCD_BWH";
|
||||
DROP TABLE "QH_USR_WEIGHT_BIND";
|
||||
@@ -0,0 +1,64 @@
|
||||
-- 删除青海相关库
|
||||
DROP TABLE IF EXISTS CON_DOCTOR_FOLLOW_QH;
|
||||
DROP TABLE IF EXISTS CON_DOCTOR_SATISFY_QH;
|
||||
DROP TABLE IF EXISTS CON_EVALUATE_QH;
|
||||
DROP TABLE IF EXISTS CON_FAMILY_MEMBERS_QH;
|
||||
DROP TABLE IF EXISTS CON_HEALTH_INFO_ANSWER_QH;
|
||||
DROP TABLE IF EXISTS CON_HEALTH_INFO_CHILD_QH;
|
||||
DROP TABLE IF EXISTS CON_HEALTH_INFO_QH;
|
||||
DROP TABLE IF EXISTS CON_HELPER_ONLINE_QH;
|
||||
DROP TABLE IF EXISTS CON_HELPER_QH;
|
||||
DROP TABLE IF EXISTS CON_HELPER_SCHEDULING_HISTORY_QH;
|
||||
DROP TABLE IF EXISTS CON_HELPER_SCHEDULING_QH;
|
||||
DROP TABLE IF EXISTS CON_HOSPITAL_FOLLOW_QH;
|
||||
DROP TABLE IF EXISTS CON_MEDICAL_RECORDS_QH;
|
||||
DROP TABLE IF EXISTS CON_SESSION_QH;
|
||||
|
||||
-- 修改表名
|
||||
ALTER TABLE CON_COST_LOG RENAME TO QH_CON_COST_LOG;
|
||||
ALTER TABLE CON_COST_STATISTICS RENAME TO QH_CON_COST_STAT;
|
||||
ALTER TABLE CON_DEPARTMENT RENAME TO QH_CON_DEPT;
|
||||
ALTER TABLE CON_DOCTOR RENAME TO QH_CON_DOCTOR;
|
||||
ALTER TABLE CON_DOCTOR_CARD RENAME TO QH_CON_DOC_CARD;
|
||||
ALTER TABLE CON_DOCTOR_CHANGE_LOG RENAME TO QH_CON_DOC_CHG_LOG;
|
||||
ALTER TABLE CON_DOCTOR_FOLLOW RENAME TO QH_CON_DOC_FOLLOW;
|
||||
ALTER TABLE CON_DOCTOR_SATISFY RENAME TO QH_CON_DOC_SATISFY;
|
||||
ALTER TABLE CON_DOCTOR_SCHEDULING RENAME TO QH_CON_DOC_SCHD;
|
||||
ALTER TABLE CON_DOCTOR_SCHEDULING_DATE RENAME TO QH_CON_DOC_SCHD_DT;
|
||||
ALTER TABLE CON_EVALUATE RENAME TO QH_CON_EVALUATE;
|
||||
ALTER TABLE CON_FAMILY_MEMBERS RENAME TO QH_CON_FAMMEM;
|
||||
ALTER TABLE CON_HABIT_PARAM RENAME TO QH_CON_HABIT_PARM;
|
||||
ALTER TABLE CON_HEALTH_INFO RENAME TO QH_CON_HEALTH;
|
||||
ALTER TABLE CON_HEALTH_INFO_ANSWER RENAME TO QH_CON_HEALTH_ANS;
|
||||
ALTER TABLE CON_HEALTH_INFO_CHILD RENAME TO QH_CON_HEALTH_CHD;
|
||||
ALTER TABLE CON_HELPER RENAME TO QH_CON_HELPER;
|
||||
ALTER TABLE CON_HELPER_ONLINE RENAME TO QH_CON_HELPER_ONLN;
|
||||
ALTER TABLE CON_HELPER_REST RENAME TO QH_CON_HELPER_REST;
|
||||
ALTER TABLE CON_HELPER_SCHEDULING RENAME TO QH_CON_HELPER_SCHD;
|
||||
ALTER TABLE CON_HELPER_SCHEDULING_HISTORY RENAME TO QH_CON_HELPER_SCHD_HIS;
|
||||
ALTER TABLE CON_HOSPITAL_FOLLOW RENAME TO QH_CON_HOSP_FOLLOW;
|
||||
ALTER TABLE CON_KNOWLEDGE RENAME TO QH_CON_KNOW;
|
||||
ALTER TABLE CON_KNOWLEDGE_CATEGORY RENAME TO QH_CON_KNOW_CATE;
|
||||
ALTER TABLE CON_MEDICAL_RECORDS RENAME TO QH_CON_MEDREC;
|
||||
ALTER TABLE CON_NOTICE RENAME TO QH_CON_NOTICE;
|
||||
ALTER TABLE CON_PAUSE_SERVICE RENAME TO QH_CON_PAUSE_SRVC;
|
||||
ALTER TABLE CON_PHRASES RENAME TO QH_CON_PHRASES;
|
||||
ALTER TABLE CON_PROPOSE RENAME TO QH_CON_PROPOSE;
|
||||
ALTER TABLE CON_RESOURCE RENAME TO QH_CON_RESOURCE;
|
||||
ALTER TABLE CON_SCHEDULING RENAME TO QH_CON_SCHD;
|
||||
ALTER TABLE CON_SERVICE RENAME TO QH_CON_SRVC;
|
||||
ALTER TABLE CON_SESSION RENAME TO QH_CON_SESSION;
|
||||
ALTER TABLE CON_SESSION_RESERVATION_DATE RENAME TO QH_CON_SESS_RESV_DT;
|
||||
ALTER TABLE CON_SESSION_VIDEO_INFO RENAME TO QH_CON_SESS_VID;
|
||||
ALTER TABLE CON_SETTLE_CONFIG_COST RENAME TO QH_CON_STL_CFG_COST;
|
||||
ALTER TABLE CON_SETTLE_CONFIG_PERIOD RENAME TO QH_CON_STL_CFG_PRD;
|
||||
ALTER TABLE CON_SETTLE_MAIN RENAME TO QH_CON_STL_MAIN;
|
||||
ALTER TABLE CON_SETTLE_RESULT RENAME TO QH_CON_STL_RSLT;
|
||||
ALTER TABLE CON_SETTLE_RESULT_ITEM RENAME TO QH_CON_STL_RSLT_ITM;
|
||||
ALTER TABLE CON_SETTLE_RESULT_PERIOD RENAME TO QH_CON_STL_RSLT_PRD;
|
||||
ALTER TABLE CON_SICKS RENAME TO QH_CON_SICKS;
|
||||
ALTER TABLE HOSPITAL_DEPARTMENT RENAME TO QH_CON_HOSP_DEPT;
|
||||
ALTER TABLE IM_GROUP_SYNC_RECORD RENAME TO QH_CON_IM_GRP_SYNC;
|
||||
ALTER TABLE IM_MSG_READ_LOG RENAME TO QH_CON_IM_MSG_RDLOG;
|
||||
ALTER TABLE IM_MSG_RECORD_ALL RENAME TO QH_CON_IM_MSG_ALL;
|
||||
ALTER TABLE SYS_LOG RENAME TO QH_SYS_LOG;
|
||||
@@ -30,10 +30,6 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
|
||||
+16
-2
@@ -25,6 +25,7 @@ import org.springframework.core.task.TaskExecutor;
|
||||
import org.springframework.jdbc.support.JdbcTransactionManager;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.util.List;
|
||||
@@ -125,8 +126,21 @@ public class BatchAutoConfiguration {
|
||||
@BatchDataSource ObjectProvider<DataSource> batchDataSource,
|
||||
BatchProperties properties
|
||||
) {
|
||||
return new BatchDataSourceScriptDatabaseInitializer(batchDataSource.getIfAvailable(() -> dataSource),
|
||||
properties.getJdbc());
|
||||
DataSource dataSourceToUse = batchDataSource.getIfAvailable(() -> dataSource);
|
||||
BatchProperties.Jdbc jdbc = properties.getJdbc();
|
||||
// 达梦数据库兼容处理:设置platform绕过构造器中的自动类型检测
|
||||
if (!StringUtils.hasText(jdbc.getPlatform())) {
|
||||
jdbc.setPlatform("dm");
|
||||
}
|
||||
// 重写afterPropertiesSet()跳过SQL脚本初始化:
|
||||
// 父类会先断言SQL文件存在再检查initializeSchema mode,导致找不到schema-dm.sql时报错
|
||||
// Batch元数据表已通过数据迁移创建,无需自动建表
|
||||
return new BatchDataSourceScriptDatabaseInitializer(dataSourceToUse, jdbc) {
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
// 跳过Batch元数据表的自动建表,防止找不到schema-dm.sql文件报错
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+7
@@ -34,6 +34,13 @@ public class CustomBatchConfigurer extends BasicBatchConfigurer {
|
||||
this.taskExecutor = taskExecutor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize() {
|
||||
// 达梦数据库兼容处理:跳过Spring Batch数据库类型自动检测
|
||||
// BasicBatchConfigurer.initialize()中DatabaseType.fromProductName()无法识别"DM DBMS"产品名
|
||||
// 保持父类默认隔离级别ISOLATION_SERIALIZABLE,DM8与此兼容
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JobLauncher createJobLauncher() throws Exception {
|
||||
SimpleJobLauncher jobLauncher = new SimpleJobLauncher();
|
||||
|
||||
+12
-13
@@ -11,19 +11,18 @@
|
||||
a.icon,
|
||||
a.points,
|
||||
CASE
|
||||
WHEN a.frequency = 1 THEN -- 单次
|
||||
IF(COUNT(b.id) > 0, 1, 0)
|
||||
WHEN a.frequency = 2 THEN -- 日/次
|
||||
IF(COUNT(CASE WHEN DATE(b.create_time) = CURDATE() THEN 1 END) > 0, 1, 0)
|
||||
WHEN a.frequency = 3 THEN -- 周/次
|
||||
IF(COUNT(CASE WHEN YEARWEEK(b.create_time, 1) = YEARWEEK(CURDATE(), 1) THEN 1 END) > 0, 1, 0)
|
||||
WHEN a.frequency = 4 THEN -- 月/次
|
||||
IF(COUNT(CASE WHEN DATE_FORMAT(b.create_time, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m') THEN 1 END) > 0, 1, 0)
|
||||
WHEN a.frequency = 5 THEN -- 季度/次
|
||||
IF(COUNT(CASE WHEN QUARTER(b.create_time) = QUARTER(CURDATE()) AND YEAR(b.create_time) = YEAR(CURDATE()) THEN 1
|
||||
END) > 0, 1, 0)
|
||||
WHEN a.frequency = 6 THEN -- 年/次
|
||||
IF(COUNT(CASE WHEN YEAR(b.create_time) = YEAR(CURDATE()) THEN 1 END) > 0, 1, 0)
|
||||
WHEN a.frequency = 1 THEN
|
||||
CASE WHEN COUNT(b.id) > 0 THEN 1 ELSE 0 END
|
||||
WHEN a.frequency = 2 THEN
|
||||
CASE WHEN COUNT(CASE WHEN TRUNC(b.create_time) = TRUNC(SYSDATE) THEN 1 END) > 0 THEN 1 ELSE 0 END
|
||||
WHEN a.frequency = 3 THEN
|
||||
CASE WHEN COUNT(CASE WHEN TO_CHAR(b.create_time, 'IYYY-IW') = TO_CHAR(SYSDATE, 'IYYY-IW') THEN 1 END) > 0 THEN 1 ELSE 0 END
|
||||
WHEN a.frequency = 4 THEN
|
||||
CASE WHEN COUNT(CASE WHEN TO_CHAR(b.create_time, 'YYYY-MM') = TO_CHAR(SYSDATE, 'YYYY-MM') THEN 1 END) > 0 THEN 1 ELSE 0 END
|
||||
WHEN a.frequency = 5 THEN
|
||||
CASE WHEN COUNT(CASE WHEN TO_CHAR(b.create_time, 'Q') = TO_CHAR(SYSDATE, 'Q') AND EXTRACT(YEAR FROM b.create_time) = EXTRACT(YEAR FROM SYSDATE) THEN 1 END) > 0 THEN 1 ELSE 0 END
|
||||
WHEN a.frequency = 6 THEN
|
||||
CASE WHEN COUNT(CASE WHEN EXTRACT(YEAR FROM b.create_time) = EXTRACT(YEAR FROM SYSDATE) THEN 1 END) > 0 THEN 1 ELSE 0 END
|
||||
ELSE 0
|
||||
END AS clockInStatus
|
||||
FROM
|
||||
|
||||
+1
-1
@@ -459,7 +459,7 @@ public class UserPointsServiceImpl extends ServiceImpl<UserPointsMapper, UserPoi
|
||||
List<UserPointsDetails> details = userPointsDetailsMapper.selectList(new LambdaQueryWrapper<UserPointsDetails>()
|
||||
.eq(UserPointsDetails::getUserId, userId)
|
||||
.eq(UserPointsDetails::getChangeType, HealthBankConstants.CHANGE_TYPE_ADD)
|
||||
.apply("DATE_FORMAT(create_time, '%Y-%m-%d') = {0}", DateUtil.today())
|
||||
.apply("TO_CHAR(create_time, 'YYYY-MM-DD') = {0}", DateUtil.today())
|
||||
);
|
||||
double sum = details.stream().map(UserPointsDetails::getPoints).mapToDouble(BigDecimal::doubleValue).sum();
|
||||
userPoints.setLatestAddDaySum(BigDecimal.valueOf(sum).add(pointsRule.getPoints()));
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ import java.util.Date;
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName(value = "con_session_view")
|
||||
@TableName(value = "con_session")
|
||||
public class ConSessionView implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@TableField(value = "id")
|
||||
@@ -77,7 +77,7 @@ public class ConSessionView implements Serializable {
|
||||
@TableField(value = "medical_records_id")
|
||||
@Schema(description = "")
|
||||
private String medicalRecordsId;
|
||||
@TableField(value = "`status`")
|
||||
@TableField(value = "status")
|
||||
@Schema(description = "")
|
||||
private Integer status;
|
||||
@TableField(value = "del_flag")
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ public interface ConDepartmentMapper extends BaseMapper<ConDepartment> , MPJBase
|
||||
@Select("SELECT * FROM con_department WHERE status = '1' and del_flag = '0' and id = #{departmentId} order by tf_top desc,sort")
|
||||
public ConDepartment selectDepartmentNameById(String departmentId);
|
||||
|
||||
@Select("SELECT GROUP_CONCAT(id) FROM con_department WHERE status = '1' and del_flag = '0' and officeparid = #{departmentId}")
|
||||
@Select("SELECT LISTAGG(id, ',') WITHIN GROUP (ORDER BY id) FROM con_department WHERE status = '1' and del_flag = '0' and officeparid = #{departmentId}")
|
||||
public String selectDepartmentIdByLevelOneId(String departmentId);
|
||||
|
||||
@Select("SELECT count(1) FROM con_department WHERE status = '1' and del_flag = '0' and office_level = 1")
|
||||
|
||||
+4
-4
@@ -117,7 +117,7 @@ public interface ConDoctorMapper extends BaseMapper<ConDoctor> , MPJBaseMapper<C
|
||||
*/
|
||||
List<ConDoctor> getFreeDoctor(CondepartmentId departmentId);
|
||||
|
||||
@Select("select id,sicks_name as sicksName from con_sicks where status = 1 and del_flag = 0 and FIND_IN_SET(id,#{sickIds})")
|
||||
@Select("select id,sicks_name as sicksName from con_sicks where status = 1 and del_flag = 0 and INSTR(',' || #{sickIds} || ',', ',' || id || ',') > 0")
|
||||
List<Map<String, String>> selectSickName(String sickIds);
|
||||
|
||||
@Select("SELECT * FROM con_doctor WHERE status = '1' AND del_flag = '0'")
|
||||
@@ -136,11 +136,11 @@ public interface ConDoctorMapper extends BaseMapper<ConDoctor> , MPJBaseMapper<C
|
||||
@Update("update con_doctor set audio_status = #{audioStatus},tf_jump_holiday= #{tfJumpHoliday} WHERE status = '1' and del_flag = '0' and id = #{id}")
|
||||
int updateAudioStatus(String id, String audioStatus, String tfJumpHoliday);
|
||||
|
||||
@Select("select count(1) from con_doctor where del_flag = '0' AND status = 1 and doctor_status != 3 AND FIND_IN_SET(#{sickId},good_at_sickness)")
|
||||
@Select("select count(1) from con_doctor where del_flag = '0' AND status = 1 and doctor_status != 3 AND INSTR(',' || #{sickId} || ',', ',' || good_at_sickness || ',') > 0")
|
||||
int selectDoctorNumBySickId(String sickId);
|
||||
|
||||
|
||||
@Select("select count(1) from con_doctor where del_flag = '0' AND status = 1 AND doctor_status != 3 AND FIND_IN_SET(department_id,#{departmentId})")
|
||||
@Select("select count(1) from con_doctor where del_flag = '0' AND status = 1 AND doctor_status != 3 AND INSTR(',' || #{departmentId} || ',', ',' || department_id || ',') > 0")
|
||||
int selectDoctorNumByDepartmentId(String departmentId);
|
||||
|
||||
List<ConDoctor> selectListByQuery(@Param("conDoctor") ConDoctor conDoctor);
|
||||
@@ -170,7 +170,7 @@ public interface ConDoctorMapper extends BaseMapper<ConDoctor> , MPJBaseMapper<C
|
||||
|
||||
|
||||
|
||||
@Select("select count(1) from con_doctor where del_flag = '0' AND status = 1 AND FIND_IN_SET(department_id,#{departmentId}) and resource_id = #{resourceId} and doctor_status != 3")
|
||||
@Select("select count(1) from con_doctor where del_flag = '0' AND status = 1 AND INSTR(',' || #{departmentId} || ',', ',' || department_id || ',') > 0 and resource_id = #{resourceId} and doctor_status != 3")
|
||||
int selectDoctorNumByDepartmentIdAndResourceId(String departmentId,String resourceId);
|
||||
|
||||
|
||||
|
||||
+4
-4
@@ -20,7 +20,7 @@ public interface ConDoctorSchedulingDateMapper extends BaseMapper<ConDoctorSched
|
||||
|
||||
IPage<ConDoctorSchedulingDate> queryPageList(IPage<ConDoctorSchedulingDate> page, @Param("conDoctorSchedulingDate") ConDoctorSchedulingDate conDoctorSchedulingDate);
|
||||
|
||||
@Select("SELECT * FROM con_doctor_scheduling_date WHERE status = '1' and del_flag = '0' and user_id = #{doctorId} and scheduling_date >= DATE_FORMAT(SYSDATE(),'%Y-%m-%d') order by scheduling_date")
|
||||
@Select("SELECT * FROM con_doctor_scheduling_date WHERE status = '1' and del_flag = '0' and user_id = #{doctorId} and scheduling_date >= TO_CHAR(SYSDATE,'YYYY-MM-DD') order by scheduling_date")
|
||||
public List<ConDoctorSchedulingDateListDO> selectDoctorById(String doctorId);
|
||||
|
||||
@Select("SELECT * FROM con_doctor_scheduling_date WHERE status = '1' and del_flag = '0' and id = #{id}")
|
||||
@@ -34,11 +34,11 @@ public interface ConDoctorSchedulingDateMapper extends BaseMapper<ConDoctorSched
|
||||
public int updateScheduleAddMinus(String id);
|
||||
|
||||
|
||||
@Select("SELECT * FROM con_doctor_scheduling_date WHERE status = '1' and del_flag = '0' and user_id = #{doctorId} and scheduling_date >= DATE_FORMAT(#{schedulingDate},'%Y-%m-%d')")
|
||||
@Select("SELECT * FROM con_doctor_scheduling_date WHERE status = '1' and del_flag = '0' and user_id = #{doctorId} and scheduling_date >= TO_CHAR(#{schedulingDate},'YYYY-MM-DD')")
|
||||
public List<ConDoctorSchedulingDateListDO> selectDoctorScheduleDateById(String doctorId, Date schedulingDate);
|
||||
|
||||
|
||||
@Select("SELECT * FROM con_doctor_scheduling_date WHERE status = '1' and del_flag = '0' and user_id = #{userId} and scheduling_date >= DATE(NOW()) and week = #{week}")
|
||||
@Select("SELECT * FROM con_doctor_scheduling_date WHERE status = '1' and del_flag = '0' and user_id = #{userId} and scheduling_date >= TRUNC(SYSDATE) and week = #{week}")
|
||||
public List<ConDoctorSchedulingDateListDO> selectDoctorSchedulingByWeekAndUserId(String userId, String week);
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public interface ConDoctorSchedulingDateMapper extends BaseMapper<ConDoctorSched
|
||||
public int updateScheduleNum(String schedulingNum, String id);
|
||||
|
||||
|
||||
@Select("SELECT * FROM con_doctor_scheduling_date WHERE status = '1' and del_flag = '0' and user_id = #{doctorId} and scheduling_date = DATE_FORMAT(#{schedulingDate},'%Y-%m-%d') and type = #{type}")
|
||||
@Select("SELECT * FROM con_doctor_scheduling_date WHERE status = '1' and del_flag = '0' and user_id = #{doctorId} and scheduling_date = TO_CHAR(#{schedulingDate},'YYYY-MM-DD') and type = #{type}")
|
||||
public List<ConDoctorSchedulingDateListDO> selectDoctorScheduleDate(String doctorId, Date schedulingDate, String type);
|
||||
|
||||
Boolean insertBatchSomeColumn(@Param("list") List<ConDoctorSchedulingDate> list);
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ public interface ConDoctorSchedulingMapper extends BaseMapper<ConDoctorSchedulin
|
||||
@Update("update con_doctor_scheduling set del_flag = 1 WHERE status = '1' and del_flag = '0' and user_id = #{userId}")
|
||||
public int deleteDoctorSchedule(String userId);
|
||||
|
||||
@Select("SELECT * FROM con_doctor_scheduling WHERE status = '1' and del_flag = '0' and user_id = #{userId} and scheduling_date >= DATE(NOW()) and week = #{week}")
|
||||
@Select("SELECT * FROM con_doctor_scheduling WHERE status = '1' and del_flag = '0' and user_id = #{userId} and scheduling_date >= TRUNC(SYSDATE) and week = #{week}")
|
||||
public List<ConDoctorSchedulingDO> selectDoctorSchedulingByWeekAndUserId(String userId, String week);
|
||||
|
||||
Boolean updateBatchById(@Param("list") List<ConDoctorScheduling> schedulingList);
|
||||
|
||||
-2
@@ -30,6 +30,4 @@ public interface ConHelperSchedulingMapper extends BaseMapper<ConHelperSchedulin
|
||||
@Select("SELECT * FROM con_helper_scheduling WHERE week = #{week} and del_flag = '0' and status = '1'")
|
||||
public List<ConHelperScheduling> getYesterDayScheduling(Integer week);
|
||||
|
||||
@Select("SELECT * FROM con_helper_scheduling_qh WHERE week = #{week} and del_flag = '0' and status = '1'")
|
||||
public List<ConHelperScheduling> getYesterDaySchedulingQh(Integer week);
|
||||
}
|
||||
|
||||
+1
-1
@@ -36,6 +36,6 @@ public interface ConMedicalRecordsMapper extends BaseMapper<ConMedicalRecords> {
|
||||
ConMedicalRecords selectByMemberIdAndUserId(String memberId, String userId);
|
||||
|
||||
|
||||
@Select("SELECT * FROM con_medical_records_view WHERE status = '1' and del_flag = '0' and id = #{id}")
|
||||
@Select("SELECT * FROM con_medical_records WHERE status = '1' and del_flag = '0' and id = #{id}")
|
||||
public ConMedicalRecordsDO selectConMedicalRecordsViewInfoById(String id);
|
||||
}
|
||||
|
||||
+2
-2
@@ -56,8 +56,8 @@ public interface ConResourceMapper extends BaseMapper<ConResource> {
|
||||
List<HospitalDepartment> selectResourceInfoByDepartId(@Param("idList") List<String> idList);
|
||||
|
||||
|
||||
@Select("SELECT c.id,c.resource_name as resourceName FROM con_resource c WHERE EXISTS (SELECT 1 FROM con_doctor d WHERE c.id = d.resource_id and d.del_flag = 0 and d.`status` = 1)" +
|
||||
"and c.del_flag = 0 and c.`status` = 1 ORDER BY c.tf_top DESC,c.sort")
|
||||
@Select("SELECT c.id,c.resource_name as resourceName FROM con_resource c WHERE EXISTS (SELECT 1 FROM con_doctor d WHERE c.id = d.resource_id and d.del_flag = 0 and d.status = 1)" +
|
||||
"and c.del_flag = 0 and c.status = 1 ORDER BY c.tf_top DESC,c.sort")
|
||||
public List<ConResourceDO> selectHospitalListVersionTwo();
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ public interface ConServiceMapper extends BaseMapper<ConService> {
|
||||
ConService selectConServiceByDoctrId(String doctorId);
|
||||
|
||||
|
||||
@Select("select count(1) from con_service where service_status = 0 and doctor_id = #{doctorId} and del_flag = 0 and status = 1 and DATE_FORMAT(#{scheduleDate}, '%Y-%m-%d') >= DATE_FORMAT(start_day, '%Y-%m-%d') and DATE_FORMAT(#{scheduleDate}, '%Y-%m-%d') <= DATE_FORMAT(end_day, '%Y-%m-%d')")
|
||||
@Select("select count(1) from con_service where service_status = 0 and doctor_id = #{doctorId} and del_flag = 0 and status = 1 and TO_CHAR(#{scheduleDate}, 'YYYY-MM-DD') >= TO_CHAR(start_day, 'YYYY-MM-DD') and TO_CHAR(#{scheduleDate}, 'YYYY-MM-DD') <= TO_CHAR(end_day, 'YYYY-MM-DD')")
|
||||
int selectConServiceByDoctrIdExist(String doctorId, Date scheduleDate);
|
||||
|
||||
}
|
||||
|
||||
+12
-20
@@ -114,24 +114,24 @@ public interface ConSessionMapper extends BaseMapper<ConSession> , MPJBaseMapper
|
||||
@Select("select * from con_session where im_id = #{imId} and to_account = #{toAccount} and del_flag = 0 and status = 1")
|
||||
ConSession selectConSessionByImId(String imId, String toAccount);
|
||||
|
||||
@Update("update con_session set reply_time = NOW() where im_id = #{imId}")
|
||||
@Update("update con_session set reply_time = SYSDATE where im_id = #{imId}")
|
||||
int updateSessionReplyTime(String imId);
|
||||
|
||||
|
||||
@Select("select * from con_session where im_id = #{imId} and del_flag = 0 and status = 1")
|
||||
ConSession selectConSessionByImIdOnly(String imId);
|
||||
|
||||
@Update("update con_session set content_status = 4 where TIMESTAMPDIFF(HOUR,reply_time,now()) >= 4 and content_status = 3 and content_type = 1")
|
||||
@Update("update con_session set content_status = 4 where (SYSDATE - CAST(reply_time AS DATE)) * 24 >= 4 and content_status = 3 and content_type = 1")
|
||||
int sessionSendMessageExpire();
|
||||
|
||||
|
||||
@Update("update con_session set content_status = 8 where TIMESTAMPDIFF(HOUR,create_time,now()) >= 24 and content_type = 1 and (content_status = 1 or content_status = 2)")
|
||||
@Update("update con_session set content_status = 8 where (SYSDATE - CAST(create_time AS DATE)) * 24 >= 24 and content_type = 1 and (content_status = 1 or content_status = 2)")
|
||||
int sessionSendMessageExpireAnother();
|
||||
|
||||
@Update("update con_session set content_status = 8 where DATE(NOW()) > session_date and content_type = 2 and (content_status = 1 or content_status = 2)")
|
||||
@Update("update con_session set content_status = 8 where TRUNC(SYSDATE) > session_date and content_type = 2 and (content_status = 1 or content_status = 2)")
|
||||
int sessionSendMessageExpireVideo();
|
||||
|
||||
@Update("update con_session set content_status = 4 where DATE(NOW()) > session_date and content_type = 2 and content_status = 3 ")
|
||||
@Update("update con_session set content_status = 4 where TRUNC(SYSDATE) > session_date and content_type = 2 and content_status = 3 ")
|
||||
int sessionSendMessageExpireVideoAnother();
|
||||
|
||||
@Select("select * from con_session where del_flag = 0 and status = 1 and from_account = #{fromAccount} and session_type = #{sessionType} and content_status = 3 limit 1")
|
||||
@@ -178,7 +178,7 @@ public interface ConSessionMapper extends BaseMapper<ConSession> , MPJBaseMapper
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Update("update con_session set content_status = 5 where session_type != 1 and content_status = 3 and timestampdiff(HOUR,reply_time,NOW()) >= #{expireHour} and tf_reply = 1")
|
||||
@Update("update con_session set content_status = 5 where session_type != 1 and content_status = 3 and (SYSDATE - CAST(reply_time AS DATE)) * 24 >= #{expireHour} and tf_reply = 1")
|
||||
int changeEndUserAndProfessiorHelper(String expireHour);
|
||||
|
||||
/**
|
||||
@@ -186,7 +186,7 @@ public interface ConSessionMapper extends BaseMapper<ConSession> , MPJBaseMapper
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Update("update con_session set content_status = 4 where session_type = 1 and content_type = 1 and content_status = 3 and timestampdiff(HOUR,reply_time,NOW()) >= #{expireHour} and tf_reply = 1")
|
||||
@Update("update con_session set content_status = 4 where session_type = 1 and content_type = 1 and content_status = 3 and (SYSDATE - CAST(reply_time AS DATE)) * 24 >= #{expireHour} and tf_reply = 1")
|
||||
int endSession(String expireHour);
|
||||
|
||||
/**
|
||||
@@ -194,7 +194,7 @@ public interface ConSessionMapper extends BaseMapper<ConSession> , MPJBaseMapper
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Update("update con_session set content_status = 8 where content_type != 2 and timestampdiff(HOUR,create_time,NOW()) >= #{expireHour} and tf_reply = 0")
|
||||
@Update("update con_session set content_status = 8 where content_type != 2 and (SYSDATE - CAST(create_time AS DATE)) * 24 >= #{expireHour} and tf_reply = 0")
|
||||
int expireMeaaage(String expireHour);
|
||||
|
||||
|
||||
@@ -240,21 +240,13 @@ public interface ConSessionMapper extends BaseMapper<ConSession> , MPJBaseMapper
|
||||
@Param("fromAccount")String fromAccount);
|
||||
|
||||
|
||||
@Select("select * from con_session_view where im_id = #{imId} and del_flag = 0 and status = 1")
|
||||
@Select("select * from con_session where im_id = #{imId} and del_flag = 0 and status = 1")
|
||||
ConSession selectConSessionByImIdOnlyBackUp(String imId);
|
||||
|
||||
|
||||
@Update("update con_session_qh set reply_time = NOW() where im_id = #{imId}")
|
||||
int updateSessionReplyTimeBackUp(String imId);
|
||||
|
||||
@Update("update con_session_qh set tf_reply = 1 where id = #{id}")
|
||||
int updateConSessionTfReplyBackUp(String id);
|
||||
|
||||
|
||||
@Select("select * from con_session_view where id = #{id} and del_flag = 0 and status = 1")
|
||||
@Select("select * from con_session where id = #{id} and del_flag = 0 and status = 1")
|
||||
ConSession selectConSessionByIdView(String id);
|
||||
|
||||
@Select("select * from con_session_view where im_id = #{id} and del_flag = 0 and status = 1")
|
||||
@Select("select * from con_session where im_id = #{id} and del_flag = 0 and status = 1")
|
||||
ConSession selectConSessionByIdViewAndImId(String imId);
|
||||
|
||||
@Update("update con_session set user_tf_reply = 1 where id = #{id}")
|
||||
@@ -282,7 +274,7 @@ public interface ConSessionMapper extends BaseMapper<ConSession> , MPJBaseMapper
|
||||
List<ConSessionDO> selectSessionListByUserIdHelperAnother(IPage<ConSessionDO> page, @Param("contentType") String contentType, @Param("state") String state, @Param("userId") String userId);
|
||||
|
||||
|
||||
@Select("select * from con_session where session_type = 1 and content_type = 1 and content_status = 3 and timestampdiff(HOUR,reply_time,NOW()) >= #{expireHour} and tf_reply = 1")
|
||||
@Select("select * from con_session where session_type = 1 and content_type = 1 and content_status = 3 and (SYSDATE - CAST(reply_time AS DATE)) * 24 >= #{expireHour} and tf_reply = 1")
|
||||
List<ConSession> selectEndSession(String expireHour);
|
||||
|
||||
|
||||
|
||||
+4
-4
@@ -55,11 +55,11 @@ public interface ConSicksMapper extends BaseMapper<ConSicks> {
|
||||
|
||||
List<ConSicks> selectListByIdList(@Param("idList") List<String> idList);
|
||||
|
||||
@Select("select count(1) from con_sicks where del_flag = 0 and status = 1 and FIND_IN_SET(department_id,#{departmentId})")
|
||||
@Select("select count(1) from con_sicks where del_flag = 0 and status = 1 and INSTR(',' || #{departmentId} || ',', ',' || department_id || ',') > 0")
|
||||
int selectSickNumByDepartment(String departmentId);
|
||||
|
||||
|
||||
@Select("select id from con_sicks where del_flag = 0 and status = 1 and FIND_IN_SET(department_id,#{departmentId})")
|
||||
@Select("select id from con_sicks where del_flag = 0 and status = 1 and INSTR(',' || #{departmentId} || ',', ',' || department_id || ',') > 0")
|
||||
List<String> selectSickNumByDepartmentByDepartment(String departmentId);
|
||||
|
||||
|
||||
@@ -71,11 +71,11 @@ public interface ConSicksMapper extends BaseMapper<ConSicks> {
|
||||
List<ConSicks> selectSickByTopAndHaveDoctor();
|
||||
|
||||
|
||||
@Select("select id,department_id as departmentId,sicks_name as sicksName,descript from con_sicks where del_flag = 0 and status = 1 and FIND_IN_SET(department_id,#{departmentId}) order by tf_top desc,sort")
|
||||
@Select("select id,department_id as departmentId,sicks_name as sicksName,descript from con_sicks where del_flag = 0 and status = 1 and INSTR(',' || #{departmentId} || ',', ',' || department_id || ',') > 0 order by tf_top desc,sort")
|
||||
List<ConSicksDO> selectSickListByDepartment(String departmentId);
|
||||
|
||||
|
||||
@Select("select GROUP_CONCAT(id) from con_sicks where department_id = #{departmentId}")
|
||||
@Select("select LISTAGG(id, ',') WITHIN GROUP (ORDER BY id) from con_sicks where department_id = #{departmentId}")
|
||||
String selectSickListByDepartmentIdAnother(String departmentId);
|
||||
|
||||
@Update("update con_sicks set department_id = #{departmentOne} where department_id = #{departmentTwo}")
|
||||
|
||||
+7
-7
@@ -73,7 +73,7 @@
|
||||
and cct.operate_type = '5'
|
||||
</if>
|
||||
<if test='date != "1"'>
|
||||
and DATE_FORMAT(cct.income_time, '%Y-%m')=#{date}
|
||||
and TO_CHAR(cct.income_time, 'YYYY-MM')=#{date}
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
and cct.user_id = #{userId}
|
||||
@@ -87,8 +87,8 @@
|
||||
FROM con_session cs
|
||||
where cs.content_type is not null
|
||||
and cs.content_type <> '4'
|
||||
and DATE_FORMAT(cs.create_time, '%Y-%m') = #{date}
|
||||
group by cs.content_type, DATE_FORMAT(cs.create_time, '%Y-%m')
|
||||
and TO_CHAR(cs.create_time, 'YYYY-MM') = #{date}
|
||||
group by cs.content_type, TO_CHAR(cs.create_time, 'YYYY-MM')
|
||||
</select>
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
and cs.content_type <> '4'
|
||||
and cs.to_account = #{userId} and session_type = 1
|
||||
<if test="date != null and date != ''">
|
||||
and DATE_FORMAT(cs.create_time, '%Y-%m') = #{date}
|
||||
and TO_CHAR(cs.create_time, 'YYYY-MM') = #{date}
|
||||
</if>
|
||||
group by cs.content_type, session_status
|
||||
</select>
|
||||
@@ -108,7 +108,7 @@
|
||||
from con_cost_statistics ccs
|
||||
<where>
|
||||
<if test='conCostStatistics.startDate != null and conCostStatistics.endDate != null'>
|
||||
and ccs.income_time between DATE_FORMAT(#{conCostStatistics.startDate}, '%Y-%m-%d 00:00:00') and DATE_FORMAT(#{conCostStatistics.endDate}, '%Y-%m-%d 23:59:59')
|
||||
and ccs.income_time between TRUNC(#{conCostStatistics.startDate}) and TRUNC(#{conCostStatistics.endDate}) + 1 - 1/86400
|
||||
</if>
|
||||
<if test='conCostStatistics.operateType != null and conCostStatistics.operateType != "" and conCostStatistics.operateType == "0"'>
|
||||
and ccs.operate_type != '5'
|
||||
@@ -162,7 +162,7 @@
|
||||
<select id="groupByTypehListNew" resultType="String">
|
||||
select
|
||||
count(1)
|
||||
from con_session_view
|
||||
from con_session
|
||||
where
|
||||
session_type = 1 and to_account = #{userId} and content_type = #{type}
|
||||
<if test="state != null and state != '' and state == '1'.toString()">
|
||||
@@ -172,7 +172,7 @@
|
||||
and content_status > 3
|
||||
</if>
|
||||
<if test="date != null and date != ''">
|
||||
and DATE_FORMAT(create_time, '%Y-%m') = #{date}
|
||||
and TO_CHAR(create_time, 'YYYY-MM') = #{date}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByDoctorIds" resultType="com.renkang.consultation.entity.ConCostStatistics">
|
||||
|
||||
+12
-22
@@ -74,7 +74,7 @@
|
||||
where status = 1
|
||||
and del_flag = 0
|
||||
<if test="officeparid == null">
|
||||
and ifnull(officeparid,'') = ''
|
||||
and NVL(officeparid,'') = ''
|
||||
</if>
|
||||
<if test="officeparid != null">
|
||||
and officeparid = #{officeparid}
|
||||
@@ -97,25 +97,16 @@
|
||||
order by tf_top desc, sort
|
||||
</select>
|
||||
<select id="selectChildAll" resultType="com.renkang.consultation.entity.ConDepartment">
|
||||
SELECT *
|
||||
FROM (
|
||||
SELECT d1.*,
|
||||
@pv := CONCAT(@pv, ',', d1.id) AS path
|
||||
FROM
|
||||
con_department AS d1
|
||||
JOIN
|
||||
(SELECT @pv := #{departmentId}) AS initial
|
||||
WHERE
|
||||
FIND_IN_SET(d1.officeparid
|
||||
, @pv)
|
||||
> 0
|
||||
) AS subquery
|
||||
ORDER BY LENGTH(path)
|
||||
SELECT * FROM con_department
|
||||
WHERE id != #{departmentId}
|
||||
START WITH id = #{departmentId}
|
||||
CONNECT BY PRIOR id = officeparid
|
||||
ORDER BY LEVEL, id
|
||||
</select>
|
||||
|
||||
<select id="getOneDepartList" resultType="com.renkang.consultation.entity.ConDepartment">
|
||||
SELECT *
|
||||
FROM `con_department`
|
||||
FROM con_department
|
||||
WHERE office_level = 1
|
||||
and del_flag = 0
|
||||
and status = 1
|
||||
@@ -123,7 +114,7 @@
|
||||
|
||||
<select id="getTwoDepartList" resultType="com.renkang.consultation.entity.ConDepartment">
|
||||
SELECT *
|
||||
FROM `con_department`
|
||||
FROM con_department
|
||||
WHERE office_level = 2
|
||||
and del_flag = 0
|
||||
and status = 1
|
||||
@@ -133,10 +124,10 @@
|
||||
SELECT *
|
||||
from con_doctor
|
||||
where department_id in
|
||||
(SELECT id FROM `con_department` WHERE office_level in (1, 2) and del_flag = 0 and status = 1)
|
||||
(SELECT id FROM con_department WHERE office_level in (1, 2) and del_flag = 0 and status = 1)
|
||||
and del_flag = 0
|
||||
and status = 1
|
||||
ORDER BY doctor_status DESC;
|
||||
ORDER BY doctor_status DESC
|
||||
</select>
|
||||
|
||||
<select id="selectChildById" resultType="com.renkang.consultation.entity.ConDepartment">
|
||||
@@ -146,12 +137,11 @@
|
||||
|
||||
<select id="selectHospitalDepartmentId" resultType="com.renkang.consultation.entity.ConDepartmentDO">
|
||||
select
|
||||
distinct a.department_id as "id",
|
||||
a.department_id as "id",
|
||||
b.department_name as "departmentName"
|
||||
from hospital_department a left join con_department b on a.department_id = b.id
|
||||
where a.hospital_id = #{hospitalId} and b.office_level = 1
|
||||
GROUP BY a.department_id,b.department_name
|
||||
order by b.tf_top desc,b.sort
|
||||
</select>
|
||||
|
||||
<select id="getMedicalDepartmentList" resultType="com.renkang.consultation.vo.MedicalDepartmentVO">
|
||||
@@ -174,7 +164,7 @@
|
||||
(case when (select count(1) from con_department cd2 where cd2.officeparid = cdd.id)>0 then 0 else 1 end) as isLeaf,
|
||||
officeparid as parentId
|
||||
from con_department cdd
|
||||
where if(officeparid is null or officeparid = '','0',officeparid) = #{pid}
|
||||
where CASE WHEN (officeparid IS NULL OR officeparid = '') THEN '0' ELSE officeparid END = #{pid}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
UPDATE con_doctor_scheduling
|
||||
SET
|
||||
week = #{item.week},
|
||||
`type` = #{item.type},
|
||||
"TYPE" = #{item.type},
|
||||
am_num = #{item.amNum},
|
||||
pm_num = #{item.pmNum},
|
||||
tf_jump_holiday = #{item.tfJumpHoliday},
|
||||
|
||||
+7
-7
@@ -2,31 +2,31 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.renkang.consultation.mapper.ConHelperSchedulingHistoryMapper">
|
||||
<select id="queryPageList" resultType="com.renkang.consultation.entity.ConHelperSchedulingHistory">
|
||||
select `time` from con_helper_scheduling_history
|
||||
select "time" from con_helper_scheduling_history
|
||||
<where>
|
||||
<if test="dto.startTime != null and dto.startTime!='' and dto.endTime != null and dto.endTime != ''">
|
||||
and `time` >= #{dto.startTime} and `time` <= #{dto.endTime}
|
||||
and "time" >= #{dto.startTime} and "time" <= #{dto.endTime}
|
||||
</if>
|
||||
<if test="dto.week != null and dto.week!=''">
|
||||
and week = #{dto.week}
|
||||
</if>
|
||||
and status = 1 and del_flag = 0 GROUP BY `time` order by `time` desc
|
||||
and status = 1 and del_flag = 0 GROUP BY "time" order by "time" desc
|
||||
</where>
|
||||
</select>
|
||||
<select id="pageByScheduleTime" resultType="java.lang.String">
|
||||
SELECT DATE_FORMAT(time, '%Y-%m-%d') AS `time` FROM con_helper_scheduling_history
|
||||
SELECT TO_CHAR("time", 'YYYY-MM-DD') AS scheduleTime FROM con_helper_scheduling_history
|
||||
<where>
|
||||
<!-- 日期范围条件 -->
|
||||
<if test="dto.startTime != null and dto.startTime != ''">
|
||||
AND `time` >= DATE_FORMAT(#{dto.startTime}, '%Y-%m-%d 00:00:00')
|
||||
AND "time" >= TO_DATE(#{dto.startTime}, 'YYYY-MM-DD HH24:MI:SS')
|
||||
</if>
|
||||
<if test="dto.endTime != null and dto.endTime != ''">
|
||||
AND `time` <= DATE_FORMAT(#{dto.endTime}, '%Y-%m-%d 23:59:59')
|
||||
AND "time" <= TO_DATE(#{dto.endTime}, 'YYYY-MM-DD HH24:MI:SS')
|
||||
</if>
|
||||
<if test="dto.week != null and dto.week != ''">
|
||||
and week = #{dto.week}
|
||||
</if>
|
||||
and status = 1 and del_flag = 0 GROUP BY `time` order by `time` desc
|
||||
and status = 1 and del_flag = 0 GROUP BY "time" order by "time" desc
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
+4
-4
@@ -21,7 +21,7 @@
|
||||
AND cr.address LIKE CONCAT('%', #{conResource.province}, '%')
|
||||
</if>
|
||||
<if test="conResource.level != null and conResource.level != ''">
|
||||
AND cr.`level` = #{conResource.level}
|
||||
AND cr."level" = #{conResource.level}
|
||||
</if>
|
||||
<if test="conResource.status != null and conResource.status != ''">
|
||||
AND cr.status = #{conResource.status}
|
||||
@@ -31,8 +31,8 @@
|
||||
</select>
|
||||
|
||||
<select id="selectBatchIds" resultType="com.renkang.consultation.entity.ConResource">
|
||||
SELECT id, resource_name, longitude, latitude, type, second_type, aidrange, gd_id, url, province, city, area,
|
||||
address, level, img, synopsis, sort, status, del_flag, create_by, create_time, update_by, update_time, memo,
|
||||
SELECT id, resource_name, longitude, latitude, "TYPE", second_type, aidrange, gd_id, url, province, city, area,
|
||||
address, "LEVEL", img, synopsis, sort, "STATUS", del_flag, create_by, create_time, update_by, update_time, memo,
|
||||
key_departments, user_score, user_score_num, resource_detail, tf_top
|
||||
FROM con_resource
|
||||
WHERE id IN
|
||||
@@ -42,7 +42,7 @@
|
||||
</select>
|
||||
<select id="selectHostitalList" resultType="com.renkang.consultation.vo.ConsultResourceVO">
|
||||
select id,
|
||||
`resource_name` as `name`
|
||||
resource_name as name
|
||||
from con_resource
|
||||
where del_flag = 0
|
||||
order by sort
|
||||
|
||||
+12
-12
@@ -542,8 +542,8 @@
|
||||
<foreach item="id" collection="doctorIds" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
AND YEAR(session_date) = YEAR(CURRENT_DATE())
|
||||
AND MONTH(session_date) = MONTH(CURRENT_DATE())
|
||||
AND EXTRACT(YEAR FROM session_date) = EXTRACT(YEAR FROM SYSDATE)
|
||||
AND EXTRACT(MONTH FROM session_date) = EXTRACT(MONTH FROM SYSDATE)
|
||||
</select>
|
||||
|
||||
|
||||
@@ -667,10 +667,10 @@
|
||||
|
||||
<!-- 日期范围条件 -->
|
||||
<if test="conSession.startDate != null and conSession.startDate != ''">
|
||||
AND c.create_time >= DATE_FORMAT(#{conSession.startDate}, '%Y-%m-%d 00:00:00')
|
||||
AND c.create_time >= TRUNC(#{conSession.startDate})
|
||||
</if>
|
||||
<if test="conSession.endDate != null and conSession.endDate != ''">
|
||||
AND c.create_time <= DATE_FORMAT(#{conSession.endDate}, '%Y-%m-%d 23:59:59')
|
||||
AND c.create_time <= TRUNC(#{conSession.endDate}) + 1 - 1/86400
|
||||
</if>
|
||||
|
||||
<!-- ID 和账户条件 -->
|
||||
@@ -715,7 +715,7 @@
|
||||
<select id="selectSessionProfessorIngNewNew" resultType="String">
|
||||
select
|
||||
count(1)
|
||||
from con_session_view
|
||||
from con_session
|
||||
where status = '1' and del_flag = 0
|
||||
and session_type = 1
|
||||
and to_account = #{toAccount}
|
||||
@@ -750,7 +750,7 @@
|
||||
<select id="selectSessionProfessorIngNewNewNew" resultType="String">
|
||||
select
|
||||
count(1)
|
||||
from con_session_view
|
||||
from con_session
|
||||
where status = '1' and del_flag = 0
|
||||
and session_type = 1
|
||||
and to_account = #{toAccount}
|
||||
@@ -795,7 +795,7 @@
|
||||
create_time as "createTime",
|
||||
im_id as "imId",
|
||||
tf_reply as "tfReply"
|
||||
from con_session_view
|
||||
from con_session
|
||||
where status = '1' and del_flag = 0 and session_type = 1 and (to_account = #{doctorId} or third_account =
|
||||
#{doctorId})
|
||||
<if test="contentType != null and contentType != ''">
|
||||
@@ -842,7 +842,7 @@
|
||||
create_time as "createTime",
|
||||
im_id as "imId",
|
||||
tf_reply as "tfReply"
|
||||
from con_session_view
|
||||
from con_session
|
||||
where status = '1'
|
||||
and content_type = '1'
|
||||
and del_flag = 0
|
||||
@@ -878,7 +878,7 @@
|
||||
create_time as "createTime",
|
||||
im_id as "imId",
|
||||
tf_reply as "tfReply"
|
||||
from con_session_view
|
||||
from con_session
|
||||
where status = '1'
|
||||
and content_type = '1'
|
||||
and del_flag = 0
|
||||
@@ -909,7 +909,7 @@
|
||||
create_time as "createTime",
|
||||
im_id as "imId",
|
||||
tf_reply as "tfReply"
|
||||
from con_session_view
|
||||
from con_session
|
||||
where status = '1' and user_tf_reply = 1 and del_flag = 0 and session_type = 1 and (to_account = #{doctorId} or third_account =
|
||||
#{doctorId})
|
||||
<if test="contentType != null and contentType != ''">
|
||||
@@ -945,7 +945,7 @@
|
||||
<select id="selectSessionProfessorIngNewNewAnother" resultType="String">
|
||||
select
|
||||
count(1)
|
||||
from con_session_view
|
||||
from con_session
|
||||
where status = '1' and del_flag = 0
|
||||
and session_type = 1
|
||||
and user_tf_reply = 1
|
||||
@@ -981,7 +981,7 @@
|
||||
<select id="selectSessionProfessorIngNewNewNewAnother" resultType="String">
|
||||
select
|
||||
count(1)
|
||||
from con_session_view
|
||||
from con_session
|
||||
where status = '1' and del_flag = 0
|
||||
and session_type = 1
|
||||
and to_account = #{toAccount}
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@
|
||||
<!--@mbg.generated-->
|
||||
id, member_id, from_account, to_account, end_time, content_type, reservation_time,
|
||||
session_type, from_name, member_name, to_name, im_id, session_time, third_account,
|
||||
third_name, cost, char_date, medical_records_id, `status`, del_flag, create_by, create_time,
|
||||
third_name, cost, char_date, medical_records_id, "STATUS", del_flag, create_by, create_time,
|
||||
update_by, update_time, memo, content_status, session_date, week, am_pm, scheduling_date_id,
|
||||
job_status, member_sex, member_age, session_status, doctor_start_time, doctor_end_time,
|
||||
reject_reason, reason_type, org_code, from_type, tf_reply, reply_time, user_tf_reply,
|
||||
|
||||
+2
-1
@@ -2,9 +2,10 @@ package com.renkang;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
@SpringBootApplication(scanBasePackages = {"com.renkang", "org.jeecg"})
|
||||
@SpringBootApplication(scanBasePackages = {"com.renkang", "org.jeecg"},exclude = QuartzAutoConfiguration .class)
|
||||
@EnableFeignClients(basePackages = {"com.renkang", "org.jeecg"})
|
||||
public class HealthConsultationCloudApplication {
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
PROFILE_NAME=dev
|
||||
SERVER_PORT=7010
|
||||
NACOS_SERVER_ADDR=localhost:8848
|
||||
NACOS_USERNAME=nacos
|
||||
NACOS_PASSWORD=nacos
|
||||
NACOS_NAMESPACE=f3f65fb2-303b-4bf7-bccb-4755886503c1
|
||||
NACOS_SERVER_ADDR=192.168.1.80:8848
|
||||
NACOS_USERNAME=xjuser
|
||||
NACOS_PASSWORD=Aa135790!123
|
||||
NACOS_NAMESPACE=xjxc-space-common
|
||||
NACOS_NAMESPACE_DISCOVERY=xjxc-space-common
|
||||
NACOS_GROUP=dev
|
||||
FILE_SERVER_URL=http://fileserver.yg.dt.io
|
||||
|
||||
@@ -21,7 +21,7 @@ spring:
|
||||
password: ${spring.cloud.nacos.password}
|
||||
discovery:
|
||||
enabled: true
|
||||
namespace: ${NACOS_NAMESPACE:}
|
||||
namespace: ${NACOS_NAMESPACE_DISCOVERY:}
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
server-addr: ${spring.cloud.nacos.server-addr}
|
||||
username: ${spring.cloud.nacos.username}
|
||||
|
||||
+1
@@ -345,6 +345,7 @@ public class AedEquipmentManger implements Serializable {
|
||||
*/
|
||||
@Excel(name = "型号", width = 15)
|
||||
@Schema(title = "型号")
|
||||
@TableField("MODEL_NUMBER")
|
||||
private String model;
|
||||
/**
|
||||
* 来源字典 设备类型 1:立式 ,2:挂式,3:车载
|
||||
|
||||
+3
@@ -1,5 +1,6 @@
|
||||
package com.renkang.emergency.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -81,12 +82,14 @@ public class TblQimoNotice implements Serializable {
|
||||
*/
|
||||
@Schema(title = "通话接通时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@Excel(name = "通话接通时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("BEGIN_TIME")
|
||||
private java.util.Date begin;
|
||||
/**
|
||||
* 通话结束时间
|
||||
*/
|
||||
@Schema(title = "通话结束时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@Excel(name = "通话结束时间", width = 15, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("END_TIME")
|
||||
private java.util.Date end;
|
||||
/**
|
||||
* 来电进入技能组时间
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ public interface AedEquipmentMangerMapper extends BaseMapper<AedEquipmentManger>
|
||||
* 按单位统计aed设备数量
|
||||
* @return 统计数据
|
||||
*/
|
||||
@Select(value = "SELECT LEFT(depart_code,6) as orgCode, count(1) as aedCount FROM `aed_equipment_manger` where del_flag = 0 GROUP BY LEFT(depart_code,6)")
|
||||
@Select(value = "SELECT SUBSTR(depart_code,1,6) as orgCode, count(1) as aedCount FROM aed_equipment_manger where del_flag = 0 GROUP BY SUBSTR(depart_code,1,6)")
|
||||
List<JSONObject> statisticAedByOrgCode();
|
||||
|
||||
List<AedLocationEquipment> getLocation(@Param("idList") List<Long> idList);
|
||||
|
||||
+3
-3
@@ -12,7 +12,7 @@
|
||||
aem.host_model as hostModel,
|
||||
aem.host_serial_num as hostSerialNum,
|
||||
aem.battery_life as batteryLife,
|
||||
aem.`status` AS STATUS,
|
||||
aem."status" AS STATUS,
|
||||
aem.control_org_name AS controlDept,
|
||||
aem.manage_user_name AS custodian,
|
||||
aem.manage_user_mobile AS custodianTel,
|
||||
@@ -53,7 +53,7 @@
|
||||
aem.NAME AS NAME,
|
||||
aem.org_code AS orgCode,
|
||||
aem.CODE AS code,
|
||||
aem.`status` AS STATUS,
|
||||
aem."status" AS STATUS,
|
||||
aem.control_org_name AS controlDept,
|
||||
aem.custodian AS custodian,
|
||||
aem.custodian_tel AS custodianTel,
|
||||
@@ -89,7 +89,7 @@
|
||||
t2.manage_user_name,
|
||||
t2.manage_user_mobile
|
||||
FROM
|
||||
`aed_equipment_maintain` t1
|
||||
"aed_equipment_maintain" t1
|
||||
LEFT JOIN aed_equipment_manger t2 ON t1.equipment_id = t2.id
|
||||
<where>
|
||||
<if test="name !=null and name !=''">
|
||||
|
||||
-1
@@ -25,7 +25,6 @@
|
||||
operate_instruction as operateInstruction,
|
||||
operate_video as operateVideo,
|
||||
disclaimer as disclaimer,
|
||||
control_org_name as controlOrgName,
|
||||
manage_user_name as manageUserName,
|
||||
manage_user_mobile as manageUserMobile,
|
||||
mfrs_Mobile as mfrsMobile,
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@
|
||||
t2.install_address,
|
||||
t2.status
|
||||
FROM
|
||||
`aed_equipment_train` t1
|
||||
"aed_equipment_train" t1
|
||||
LEFT JOIN aed_equipment_manger t2 ON t1.equipment_id = t2.id
|
||||
<where>
|
||||
and t1.flag = #{trainType}
|
||||
|
||||
+2
-2
@@ -25,11 +25,11 @@ public interface EmergencySeriousDiseaseMapper extends BaseMapper<EmergencySerio
|
||||
public List<EmergencySeriousDisease> selectEmergencySeriousDiseaseListByState(IPage<EmergencySeriousDisease> page, @Param("state") String state, @Param("userId") String userId);
|
||||
|
||||
|
||||
@Update("update emergency_serious_disease set state = 8 where state = 1 and desire_time < now()")
|
||||
@Update("update emergency_serious_disease set state = 8 where state = 1 and desire_time < SYSDATE")
|
||||
public int updateEmergencyStateOne();
|
||||
|
||||
|
||||
@Update("update emergency_serious_disease set state = 5 where state = 4 and reservation_time < now()")
|
||||
@Update("update emergency_serious_disease set state = 5 where state = 4 and reservation_time < SYSDATE")
|
||||
public int updateEmergencyStateTeo();
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
DELETE t1
|
||||
FROM emergency_schedules_new_item t1
|
||||
INNER JOIN emergency_new_schedules t2 ON t1.schedules_id = t2.id
|
||||
WHERE t2.schedules_time > NOW()
|
||||
WHERE t2.schedules_time > SYSDATE
|
||||
AND t1.user_id = #{userId}
|
||||
</delete>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<where>
|
||||
and t1.type = #{type}
|
||||
<if test="name != null and name != ''">
|
||||
AND t1.realname like concat('%',#{name},'%')
|
||||
AND t1.realname like '%' || #{name} || '%'
|
||||
</if>
|
||||
<if test="centerIds != null and centerIds.size > 0">
|
||||
and t1.center_id in
|
||||
|
||||
+2
-2
@@ -6,11 +6,11 @@
|
||||
SELECT t1.user_id as userId,
|
||||
t3.realname as userName,
|
||||
t3.type as userType
|
||||
FROM `emergency_schedules_new_item` t1
|
||||
FROM emergency_schedules_new_item t1
|
||||
LEFT JOIN emergency_new_schedules t2 ON t1.schedules_id = t2.id
|
||||
left join emergency_profession_user t3 on t1.user_id = t3.user_id
|
||||
WHERE t2.center_id = #{centerId}
|
||||
AND date_format(t2.schedules_time, '%Y-%m-%d') = #{time}
|
||||
AND TO_CHAR(t2.schedules_time, 'YYYY-MM-DD') = #{time}
|
||||
ORDER BY
|
||||
t3.type,
|
||||
t1.sort
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@
|
||||
FROM emergency_schedules_new_item t1
|
||||
LEFT JOIN emergency_new_schedules t2 ON t1.schedules_id = t2.id
|
||||
WHERE
|
||||
YEAR ( t2.schedules_time ) = #{year}
|
||||
AND MONTH ( t2.schedules_time ) = #{month}
|
||||
EXTRACT(YEAR FROM t2.schedules_time) = #{year}
|
||||
AND EXTRACT(MONTH FROM t2.schedules_time) = #{month}
|
||||
and t2.schedules_time is not null
|
||||
AND t1.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
+10
-9
@@ -51,13 +51,13 @@
|
||||
<where>
|
||||
and a.del_flag = '0' and a.status = 1
|
||||
<if test="emergencySeriousDisease.realname != null">
|
||||
AND a.realname like concat('%',#{emergencySeriousDisease.realname},'%')
|
||||
AND a.realname like '%' || #{emergencySeriousDisease.realname} || '%'
|
||||
</if>
|
||||
<if test="emergencySeriousDisease.reservationOffice != null">
|
||||
AND a.reservation_office like concat('%',#{emergencySeriousDisease.reservationOffice},'%')
|
||||
AND a.reservation_office like '%' || #{emergencySeriousDisease.reservationOffice} || '%'
|
||||
</if>
|
||||
<if test="emergencySeriousDisease.reservationDoctor != null">
|
||||
AND a.reservation_doctor like concat('%',#{emergencySeriousDisease.reservationDoctor},'%')
|
||||
AND a.reservation_doctor like '%' || #{emergencySeriousDisease.reservationDoctor} || '%'
|
||||
</if>
|
||||
<if test="emergencySeriousDisease.hospitalId != null">
|
||||
AND a.hospital_id = #{emergencySeriousDisease.hospitalId}
|
||||
@@ -66,10 +66,10 @@
|
||||
AND a.register_category = #{emergencySeriousDisease.registerCategory}
|
||||
</if>
|
||||
<if test="emergencySeriousDisease.desireTime != null">
|
||||
AND DATE(a.desire_time) = DATE(#{emergencySeriousDisease.desireTime})
|
||||
AND TRUNC(a.desire_time) = TRUNC(#{emergencySeriousDisease.desireTime})
|
||||
</if>
|
||||
<if test="emergencySeriousDisease.reservationTime != null">
|
||||
AND DATE(a.reservation_time) = DATE(#{emergencySeriousDisease.reservationTime})
|
||||
AND TRUNC(a.reservation_time) = TRUNC(#{emergencySeriousDisease.reservationTime})
|
||||
</if>
|
||||
<if test="emergencySeriousDisease.operatorId != null">
|
||||
AND a.operator_id = #{emergencySeriousDisease.operatorId}
|
||||
@@ -88,15 +88,16 @@
|
||||
<where>
|
||||
and a.del_flag = '0' and a.status = 1 and user_id = #{userId}
|
||||
<if test="state != null and state != '' and state == '1'.toString()">
|
||||
AND (`state` <![CDATA[ <= ]]> 4 or state = 7)
|
||||
AND ("state" <![CDATA[ <= ]]> 4 or state = 7)
|
||||
</if>
|
||||
<if test="state != null and state != '' and state == '2'.toString()">
|
||||
AND `state` <![CDATA[ > ]]> 4 and state != 7
|
||||
AND "state" <![CDATA[ > ]]> 4 and state != 7
|
||||
</if>
|
||||
</where>
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
<select id="dutyTeam" resultType="java.lang.Integer">
|
||||
select * from (
|
||||
SELECT t8.num
|
||||
from (SELECT t1.user_type AS type,
|
||||
count(1) AS num
|
||||
@@ -104,12 +105,12 @@
|
||||
LEFT JOIN emergency_new_schedules t2 ON t1.schedules_id = t2.id
|
||||
LEFT JOIN emergency_profession_user t3 ON t3.center_id = t2.center_id
|
||||
WHERE t3.user_id = #{userId}
|
||||
AND DATE ( t2.schedules_time) = CURRENT_DATE
|
||||
AND TRUNC(t2.schedules_time) = TRUNC(SYSDATE)
|
||||
GROUP BY
|
||||
t1.user_type
|
||||
) t8
|
||||
ORDER BY
|
||||
t8.num
|
||||
LIMIT 1
|
||||
) WHERE ROWNUM = 1
|
||||
</select>
|
||||
</mapper>
|
||||
+5
-5
@@ -11,7 +11,7 @@
|
||||
WHERE operation_user_id is not null
|
||||
and operation_user_id != ''
|
||||
and session_now = 1
|
||||
and DATE_FORMAT(create_time, '%Y-%m-%d') = #{targetDateStr}
|
||||
and TO_CHAR(create_time, 'YYYY-MM-DD') = #{targetDateStr}
|
||||
GROUP BY
|
||||
operation_user_id
|
||||
</select>
|
||||
@@ -26,7 +26,7 @@
|
||||
WHERE major_user_id is not null
|
||||
and major_user_id != ''
|
||||
and session_now = 1
|
||||
and DATE_FORMAT(create_time, '%Y-%m-%d') = #{targetDateStr}
|
||||
and TO_CHAR(create_time, 'YYYY-MM-DD') = #{targetDateStr}
|
||||
GROUP BY
|
||||
major_user_id
|
||||
</select>
|
||||
@@ -38,11 +38,11 @@
|
||||
salvage_user_sex = #{sex}
|
||||
</if>
|
||||
<if test="depart != null and depart != ''">
|
||||
and salvage_user_depart like concat('', #{depart}, '%')
|
||||
and salvage_user_depart like #{depart} || '%'
|
||||
</if>
|
||||
and del_flag = 0
|
||||
</where>
|
||||
GROUP BY Initiator_type;
|
||||
GROUP BY Initiator_type
|
||||
</select>
|
||||
|
||||
<select id="emergencyNum" resultType="com.renkang.emergency.archives.model.vo.EmergencyNum">
|
||||
@@ -58,7 +58,7 @@
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="type != null and type != '' and '0'.toString().equals(type)">
|
||||
AND year(create_time) = year(now())
|
||||
AND EXTRACT(YEAR FROM create_time) = EXTRACT(YEAR FROM SYSDATE)
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY center_id
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
id,
|
||||
name
|
||||
from emergency_resource
|
||||
where FIND_IN_SET(id,#{hospitalIds})
|
||||
where INSTR(',' || #{hospitalIds} || ',', ',' || id || ',') > 0
|
||||
and status = 1 and del_flag = 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
+3
-3
@@ -11,7 +11,7 @@
|
||||
and type = #{amOrPm}
|
||||
</if>
|
||||
<if test="date != null and date != ''">
|
||||
and DATE_FORMAT(schedule_time, '%Y-%m-%d') = #{date}
|
||||
and TO_CHAR(schedule_time, 'YYYY-MM-DD') = #{date}
|
||||
</if>
|
||||
and status = 1
|
||||
and del_flag = 0
|
||||
@@ -30,7 +30,7 @@
|
||||
user_sex
|
||||
FROM emergency_schedule_custom
|
||||
WHERE user_id = #{userId}
|
||||
AND YEAR (schedule_time) = #{year}
|
||||
AND MONTH (schedule_time) = #{month}
|
||||
AND EXTRACT(YEAR FROM schedule_time) = #{year}
|
||||
AND EXTRACT(MONTH FROM schedule_time) = #{month}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
+5
-5
@@ -11,7 +11,7 @@
|
||||
and type = #{amOrPm}
|
||||
</if>
|
||||
<if test="date != null and date != ''">
|
||||
and DATE_FORMAT(schedule_time, '%Y-%m-%d') = #{date}
|
||||
and TO_CHAR(schedule_time, 'YYYY-MM-DD') = #{date}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
@@ -22,16 +22,16 @@
|
||||
<select id="scheduleRecord" resultType="com.renkang.emergency.entity.ScheduleRecord">
|
||||
SELECT
|
||||
id,schedule_time,type,user_type,user_name,user_id,user_sex,
|
||||
MONTH(schedule_time) AS month,
|
||||
DAY(schedule_time) AS day
|
||||
EXTRACT(MONTH FROM schedule_time) AS month,
|
||||
EXTRACT(DAY FROM schedule_time) AS day
|
||||
FROM
|
||||
emergency_schedule_record
|
||||
<where>
|
||||
<if test="year != null and year != ''">
|
||||
and YEAR (schedule_time) = #{year}
|
||||
and EXTRACT(YEAR FROM schedule_time) = #{year}
|
||||
</if>
|
||||
<if test="month != null and month != ''">
|
||||
and MONTH(schedule_time) = #{month}
|
||||
and EXTRACT(MONTH FROM schedule_time) = #{month}
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
and user_id = #{userId}
|
||||
|
||||
+6
-6
@@ -3,27 +3,27 @@
|
||||
<mapper namespace="com.renkang.emergency.mapper.TblBaseHospitalMapper">
|
||||
|
||||
<select id="getHospitalList" resultType="com.renkang.emergency.entity.TblBaseHospitalVo">
|
||||
SELECT id,`name`,latitude lat ,longitude lon,`type`
|
||||
SELECT id,name,latitude lat ,longitude lon,type
|
||||
FROM emergency_resource
|
||||
WHERE 1 = 1 and del_flag = 0
|
||||
<if test="type != null and type.length() > 0">
|
||||
AND `type` = #{type}
|
||||
AND type = #{type}
|
||||
</if>
|
||||
<if test="hospitalName != null and hospitalName.length() > 0">
|
||||
AND `name` LIKE CONCAT('%', #{hospitalName}, '%')
|
||||
AND name LIKE CONCAT('%', #{hospitalName}, '%')
|
||||
</if>
|
||||
ORDER BY id
|
||||
</select>
|
||||
|
||||
<select id="getHospitalListNew" resultType="com.renkang.emergency.entity.TblBaseHospitalVo">
|
||||
SELECT id,`name`,latitude lat ,longitude lon,`type`
|
||||
SELECT id,name,latitude lat ,longitude lon,type
|
||||
FROM emergency_resource
|
||||
WHERE 1 = 1 and del_flag = 0 and type != 3
|
||||
<if test="type != null and type != ''">
|
||||
AND `type` = #{type}
|
||||
AND type = #{type}
|
||||
</if>
|
||||
<if test="hospitalName != null and hospitalName.length() > 0">
|
||||
AND `name` LIKE CONCAT('%', #{hospitalName}, '%')
|
||||
AND name LIKE CONCAT('%', #{hospitalName}, '%')
|
||||
</if>
|
||||
ORDER BY id
|
||||
</select>
|
||||
|
||||
+3
-3
@@ -15,13 +15,13 @@
|
||||
) AS sub_query
|
||||
<where>
|
||||
<if test="condition != null and condition != '' and condition == 2">
|
||||
YEAR(help_time) = YEAR(NOW())
|
||||
EXTRACT(YEAR FROM help_time) = EXTRACT(YEAR FROM SYSDATE)
|
||||
</if>
|
||||
<if test="condition != null and condition != '' and condition == 3">
|
||||
DATE_FORMAT(help_time, '%Y%m') = DATE_FORMAT(CURDATE(), '%Y%m')
|
||||
TO_CHAR(help_time, 'YYYYMM') = TO_CHAR(SYSDATE, 'YYYYMM')
|
||||
</if>
|
||||
<if test="condition != null and condition != '' and condition == 4">
|
||||
YEARWEEK(date_format(help_time, '%Y-%m-%d')) = YEARWEEK(now())
|
||||
TO_CHAR(help_time, 'IYYY-IW') = TO_CHAR(SYSDATE, 'IYYY-IW')
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY type
|
||||
|
||||
+4
-4
@@ -9,16 +9,16 @@
|
||||
<where>
|
||||
del_flag = 0
|
||||
<if test="type != null and type == 0">
|
||||
-- 周
|
||||
AND YEARWEEK(start_time, 1) = YEARWEEK(NOW(), 1)
|
||||
-- 周(使用 ISO 年-周 比较)
|
||||
AND TO_CHAR(start_time, 'IYYY-IW') = TO_CHAR(SYSDATE, 'IYYY-IW')
|
||||
</if>
|
||||
<if test="type != null and type == 1">
|
||||
-- 月
|
||||
AND DATE_FORMAT(start_time,'%Y%m')=DATE_FORMAT(CURDATE(),'%Y%m')
|
||||
AND TO_CHAR(start_time,'YYYYMM') = TO_CHAR(SYSDATE,'YYYYMM')
|
||||
</if>
|
||||
<if test="type != null and type == 2">
|
||||
-- 年
|
||||
AND YEAR(start_time) =YEAR(NOW())
|
||||
AND EXTRACT(YEAR FROM start_time) = EXTRACT(YEAR FROM SYSDATE)
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY injury_level
|
||||
|
||||
+16
-6
@@ -332,9 +332,18 @@ public class IEmergencyCenterServiceImpl extends ServiceImpl<EmergencyCenterMapp
|
||||
|
||||
@Override
|
||||
public EmergencyCenter getCenterDetail() {
|
||||
EmergencyCenterAdmin centerAdmin = centerAdminService.getOne(new LambdaQueryWrapper<EmergencyCenterAdmin>()
|
||||
LambdaQueryWrapper<EmergencyCenterAdmin> wrapper = new LambdaQueryWrapper<EmergencyCenterAdmin>()
|
||||
.eq(EmergencyCenterAdmin::getUserId, GlobalUtils.getLoginUser().getId())
|
||||
.orderByDesc(EmergencyCenterAdmin::getCreateTime).last("limit 1"));
|
||||
.orderByDesc(EmergencyCenterAdmin::getCreateTime);
|
||||
|
||||
Page<EmergencyCenterAdmin> page = new Page<>(1, 1);
|
||||
IPage<EmergencyCenterAdmin> pageResult = centerAdminService.page(page, wrapper);
|
||||
|
||||
EmergencyCenterAdmin centerAdmin = null;
|
||||
if (pageResult.getRecords() != null && !pageResult.getRecords().isEmpty()) {
|
||||
centerAdmin = pageResult.getRecords().get(0);
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(centerAdmin)) {
|
||||
return new EmergencyCenter();
|
||||
}
|
||||
@@ -354,7 +363,7 @@ public class IEmergencyCenterServiceImpl extends ServiceImpl<EmergencyCenterMapp
|
||||
.like(EmergencyCenter::getServiceScope, "," + departCode)
|
||||
.or()
|
||||
.eq(EmergencyCenter::getServiceScope, departCode)
|
||||
).last("limit 1");
|
||||
).last("FETCH FIRST 1 ROWS ONLY");
|
||||
EmergencyCenter center = getOne(centerWrapper);
|
||||
if (ObjectUtil.isEmpty(center)) {
|
||||
centerWrapper = new LambdaQueryWrapper<>();
|
||||
@@ -366,7 +375,7 @@ public class IEmergencyCenterServiceImpl extends ServiceImpl<EmergencyCenterMapp
|
||||
.like(EmergencyCenter::getServiceScope, "," + orgCode)
|
||||
.or()
|
||||
.eq(EmergencyCenter::getServiceScope, orgCode)
|
||||
).last("limit 1");
|
||||
).last("FETCH FIRST 1 ROWS ONLY");
|
||||
center = getOne(centerWrapper);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(center)) {
|
||||
@@ -379,8 +388,9 @@ public class IEmergencyCenterServiceImpl extends ServiceImpl<EmergencyCenterMapp
|
||||
.like(EmergencyCenter::getServiceScope, "," + userOrgCode)
|
||||
.or()
|
||||
.eq(EmergencyCenter::getServiceScope, userOrgCode)
|
||||
).last("limit 1");
|
||||
center = getOne(centerWrapper);
|
||||
);
|
||||
List<EmergencyCenter> list = list(centerWrapper);
|
||||
center = CollUtil.isEmpty(list) ? null : list.get(0);
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(center)) {
|
||||
// 值班时间
|
||||
|
||||
+6
-6
@@ -110,13 +110,13 @@ public class TblUserHelpServiceImpl extends ServiceImpl<TblUserHelpMapper, TblUs
|
||||
// 1:全部,2:年,3:月,4:周
|
||||
switch (dto.getCondition()) {
|
||||
case "2":
|
||||
queryWrapper.apply("DATE_FORMAT(help_time,'%Y') = DATE_FORMAT(NOW(),'%Y')");
|
||||
queryWrapper.apply("EXTRACT(YEAR FROM help_time) = EXTRACT(YEAR FROM SYSDATE)");
|
||||
break;
|
||||
case "3":
|
||||
queryWrapper.apply("DATE_FORMAT(help_time,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')");
|
||||
queryWrapper.apply("TO_CHAR(help_time,'YYYY-MM') = TO_CHAR(SYSDATE,'YYYY-MM')");
|
||||
break;
|
||||
case "4":
|
||||
queryWrapper.apply("YEARWEEK(date_format(help_time,'%Y-%m-%d'), 1) = YEARWEEK(now(), 1)");
|
||||
queryWrapper.apply("TO_CHAR(help_time,'IYYY-IW') = TO_CHAR(SYSDATE,'IYYY-IW')");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -224,13 +224,13 @@ public class TblUserHelpServiceImpl extends ServiceImpl<TblUserHelpMapper, TblUs
|
||||
// 1:全部,2:年,3:月,4:周
|
||||
switch (condition) {
|
||||
case "2":
|
||||
queryWrapper.apply("DATE_FORMAT(help_time,'%Y') = DATE_FORMAT(NOW(),'%Y')");
|
||||
queryWrapper.apply("EXTRACT(YEAR FROM help_time) = EXTRACT(YEAR FROM SYSDATE)");
|
||||
break;
|
||||
case "3":
|
||||
queryWrapper.apply("DATE_FORMAT(help_time,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')");
|
||||
queryWrapper.apply("TO_CHAR(help_time,'YYYY-MM') = TO_CHAR(SYSDATE,'YYYY-MM')");
|
||||
break;
|
||||
case "4":
|
||||
queryWrapper.apply("YEARWEEK(date_format(help_time,'%Y-%m-%d')) = YEARWEEK(now())");
|
||||
queryWrapper.apply("TO_CHAR(help_time,'IYYY-IW') = TO_CHAR(SYSDATE,'IYYY-IW')");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -2,9 +2,10 @@ package com.renkang;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
@SpringBootApplication(scanBasePackages = {"com.renkang", "org.jeecg"})
|
||||
@SpringBootApplication(scanBasePackages = {"com.renkang", "org.jeecg"},exclude = QuartzAutoConfiguration.class)
|
||||
@EnableFeignClients(basePackages = {"org.jeecg", "com.renkang"})
|
||||
public class HealthEmergencyCloudApplication {
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
PROFILE_NAME=dev
|
||||
SERVER_PORT=7011
|
||||
NACOS_SERVER_ADDR=localhost:8848
|
||||
NACOS_USERNAME=nacos
|
||||
NACOS_PASSWORD=nacos
|
||||
NACOS_NAMESPACE=f3f65fb2-303b-4bf7-bccb-4755886503c1
|
||||
NACOS_SERVER_ADDR=192.168.1.80:8848
|
||||
NACOS_USERNAME=xjuser
|
||||
NACOS_PASSWORD=Aa135790!123
|
||||
NACOS_NAMESPACE=xjxc-space-common
|
||||
NACOS_NAMESPACE_DISCOVERY=xjxc-space-common
|
||||
NACOS_GROUP=dev
|
||||
FILE_SERVER_URL=http://fileserver.yg.dt.io
|
||||
|
||||
@@ -21,7 +21,7 @@ spring:
|
||||
password: ${spring.cloud.nacos.password}
|
||||
discovery:
|
||||
enabled: true
|
||||
namespace: ${NACOS_NAMESPACE:}
|
||||
namespace: ${NACOS_NAMESPACE_DISCOVERY:}
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
server-addr: ${spring.cloud.nacos.server-addr}
|
||||
username: ${spring.cloud.nacos.username}
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ public class WatchDataWorkoutTrace implements Serializable {
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Schema(title = "时间戳")
|
||||
@TableField("`utc_time`")
|
||||
@TableField("utc_time")
|
||||
private java.util.Date utcTime;
|
||||
/**
|
||||
* 数据是否合法
|
||||
|
||||
@@ -56,6 +56,12 @@
|
||||
<groupId>com.renkang</groupId>
|
||||
<artifactId>font-resources</artifactId>
|
||||
</dependency>
|
||||
<!-- MySQL 驱动 (用于 Spring Batch 数据源兼容) -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
+3
-3
@@ -894,7 +894,7 @@ public class WatchDataApiServiceImpl implements WatchDataApiService {
|
||||
WatchStatUserInfoDaySleep::getDataDate)
|
||||
.eq(WatchStatUserInfoDaySleep::getUserId, userId)
|
||||
.orderByDesc(WatchStatUserInfoDaySleep::getDataDate)
|
||||
.last("limit 1");
|
||||
.last("FETCH FIRST 1 ROWS ONLY");
|
||||
|
||||
WatchStatUserInfoDaySleep data = watchStatUserInfoDaySleepMapper.selectOne(queryWrapper);
|
||||
|
||||
@@ -1016,7 +1016,7 @@ public class WatchDataApiServiceImpl implements WatchDataApiService {
|
||||
queryWrapper.eq(WatchData::getUserid, userId)
|
||||
.orderByDesc(WatchData::getLastUpdateTime)
|
||||
.eq(WatchData::getType, type)
|
||||
.last("limit 1");
|
||||
.last("FETCH FIRST 1 ROWS ONLY");
|
||||
WatchData watchData = watchDataMapper.selectOne(queryWrapper);
|
||||
if (watchData == null) {
|
||||
return null;
|
||||
@@ -1033,7 +1033,7 @@ public class WatchDataApiServiceImpl implements WatchDataApiService {
|
||||
QueryWrapper<T> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id", userId)
|
||||
.orderByDesc("data_date")
|
||||
.last("limit 1");
|
||||
.last("FETCH FIRST 1 ROWS ONLY");
|
||||
return queryWrapper.lambda();
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -32,6 +32,6 @@ public interface WatchDataHeartRateMapper extends MPJBaseMapper<WatchDataHeartRa
|
||||
* @param bindUserId
|
||||
* @return
|
||||
*/
|
||||
@Select("select * from watch_data_heart_rate where bind_user_id = #{bindUserId} and data_date = (select MAX(data_date) from watch_data_heart_rate where bind_user_id = #{bindUserId})")
|
||||
@Select("SELECT * FROM watch_data_heart_rate WHERE bind_user_id = #{bindUserId} AND data_date = (SELECT MAX(data_date) FROM watch_data_heart_rate WHERE bind_user_id = #{bindUserId})")
|
||||
List<WatchDataHeartRate> latestDataTempByUserId(@Param("bindUserId") String bindUserId);
|
||||
}
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ public interface WatchDataSpo2Mapper extends MPJBaseMapper<WatchDataSpo2> {
|
||||
* @param bindUserId
|
||||
* @return
|
||||
*/
|
||||
@Select("select * from watch_data_spo2 where bind_user_id = #{bindUserId} and data_date = (select MAX(data_date) from watch_data_spo2 where bind_user_id = #{bindUserId})")
|
||||
@Select("SELECT * FROM watch_data_spo2 WHERE bind_user_id = #{bindUserId} AND data_date = (SELECT MAX(data_date) FROM watch_data_spo2 WHERE bind_user_id = #{bindUserId})")
|
||||
List<WatchDataSpo2> latestDataTempByUserId(@Param("bindUserId") String bindUserId);
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ public interface WatchDataStressMapper extends MPJBaseMapper<WatchDataStress> {
|
||||
|
||||
IPage<WatchDataStress> selectStressByYear(IPage<WatchDataStress> page, StatisticsReq req);
|
||||
|
||||
@Select("select * from watch_data_stress where bind_user_id = #{bindUserId} order by start_time_stamp desc limit 1")
|
||||
@Select("SELECT * FROM (SELECT * FROM watch_data_stress WHERE bind_user_id = #{bindUserId} ORDER BY start_time_stamp DESC) WHERE ROWNUM = 1")
|
||||
WatchDataStress selectWatchDataStressByUserId(@Param("bindUserId") String bindUserId);
|
||||
|
||||
/**
|
||||
@@ -29,7 +29,7 @@ public interface WatchDataStressMapper extends MPJBaseMapper<WatchDataStress> {
|
||||
* @param bindUserId
|
||||
* @return
|
||||
*/
|
||||
@Select("select * from watch_data_stress where bind_user_id = #{bindUserId} and data_date = (select MAX(data_date) from watch_data_stress where bind_user_id = #{bindUserId})")
|
||||
@Select("SELECT * FROM watch_data_stress WHERE bind_user_id = #{bindUserId} AND data_date = (SELECT MAX(data_date) FROM watch_data_stress WHERE bind_user_id = #{bindUserId})")
|
||||
List<WatchDataStress> latestDataTempByUserId(@Param("bindUserId") String bindUserId);
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@ public interface WatchDataTemperatureMapper extends MPJBaseMapper<WatchDataTempe
|
||||
|
||||
IPage<WatchDataTemperature> selectTempByYear(@Param("page") IPage<WatchDataTemperature> page, @Param("req") StatisticsReq req);
|
||||
|
||||
@Select("select * from watch_data_temperature where bind_user_id = #{bindUserId} and Date(data_date) = Date(#{dateTime}) order by time_stamp")
|
||||
@Select("SELECT * FROM watch_data_temperature WHERE bind_user_id = #{bindUserId} AND data_date = #{dateTime} ORDER BY time_stamp")
|
||||
List<WatchDataTemperature> selectTempByUserId(@Param("bindUserId") String bindUserId,@Param("dateTime") Date dateTime);
|
||||
|
||||
/**
|
||||
@@ -31,6 +31,6 @@ public interface WatchDataTemperatureMapper extends MPJBaseMapper<WatchDataTempe
|
||||
* @param bindUserId
|
||||
* @return
|
||||
*/
|
||||
@Select("select * from watch_data_temperature where bind_user_id = #{bindUserId} and data_date = (select MAX(data_date) from watch_data_temperature where bind_user_id = #{bindUserId})")
|
||||
@Select("SELECT * FROM watch_data_temperature WHERE bind_user_id = #{bindUserId} AND data_date = (SELECT MAX(data_date) FROM watch_data_temperature WHERE bind_user_id = #{bindUserId})")
|
||||
List<WatchDataTemperature> latestDataTempByUserId(@Param("bindUserId") String bindUserId);
|
||||
}
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ public interface WatchDeviceMapper extends MPJBaseMapper<WatchDevice> {
|
||||
|
||||
List<String> selectDeviceUserId(@Param("deptId") String deptId);
|
||||
|
||||
@Select(value = "SELECT LEFT(org_code,6) as orgCode, count(1) as medicalCount FROM `watch_device` GROUP BY LEFT(org_code,6)")
|
||||
@Select(value = "SELECT SUBSTR(org_code, 1, 6) as orgCode, COUNT(1) as medicalCount FROM watch_device GROUP BY SUBSTR(org_code, 1, 6)")
|
||||
List<JSONObject> getWatchSum();
|
||||
|
||||
List<WearCount> selectWearCount(@Param("orgCodeList") List<String> orgCodeList);
|
||||
|
||||
+16
-16
@@ -16,10 +16,10 @@ import java.util.Map;
|
||||
@Mapper
|
||||
public interface WatchMapper {
|
||||
|
||||
@Select("SELECT DATEDIFF(NOW(), (SELECT bind_date FROM watch_bind_his WHERE bind_user_id = #{id} ORDER BY bind_date DESC limit 1)) AS days")
|
||||
@Select("SELECT TRUNC(SYSDATE - CAST(bind_date AS DATE)) AS days FROM (SELECT bind_date FROM watch_bind_his WHERE bind_user_id = #{id} ORDER BY bind_date DESC FETCH FIRST 1 ROWS ONLY)")
|
||||
Integer getUseDays(@Param("id") String id);
|
||||
|
||||
@Select("select length(nm.status) minutes,DATE_FORMAT(n.data_date,'%Y-%m-%d') dataDate from watch_data_sleep_new_minute nm left join watch_data_sleep_new n on nm.sleep_id = n.id where n.id = ( select id from watch_data_sleep_new WHERE bind_user_id = #{id} order by data_date desc limit 1) and nm.STATUS not like '%55%' limit 1")
|
||||
@Select("SELECT LENGTH(nm.status) minutes, TO_CHAR(n.data_date,'YYYY-MM-DD') dataDate FROM watch_data_sleep_new_minute nm LEFT JOIN watch_data_sleep_new n ON nm.sleep_id = n.id WHERE n.id = (SELECT id FROM watch_data_sleep_new WHERE bind_user_id = #{id} ORDER BY data_date DESC FETCH FIRST 1 ROWS ONLY) AND nm.STATUS NOT LIKE '%55%' AND ROWNUM = 1")
|
||||
WatchDataDTO getDataSleep(@Param("id") String id);
|
||||
|
||||
/**
|
||||
@@ -27,44 +27,44 @@ public interface WatchMapper {
|
||||
* @param id 用户 ID
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT long_duration_total minutes, data_date dataDate FROM watch_stat_user_info_day_sleep WHERE user_id = #{id} and long_duration_total > 0 ORDER BY data_date DESC LIMIT 1;")
|
||||
@Select("SELECT long_duration_total minutes, data_date dataDate FROM watch_stat_user_info_day_sleep WHERE user_id = #{id} AND long_duration_total > 0 ORDER BY data_date DESC FETCH FIRST 1 ROWS ONLY")
|
||||
WatchDataDTO getDataSleepNew(@Param("id") String id);
|
||||
|
||||
@Select("SELECT AVG(TIMESTAMPDIFF(MINUTE, d.fall_asleep_time, d.wake_up_time)) AS aveMinute FROM watch_data_sleep_new_day d LEFT JOIN watch_data_sleep_new n ON d.sleep_id = n.id WHERE n.id IN (SELECT id FROM watch_data_sleep_new WHERE bind_user_id = #{id})")
|
||||
@Select("SELECT AVG(ROUND((CAST(d.wake_up_time AS DATE) - CAST(d.fall_asleep_time AS DATE)) * 24 * 60)) AS aveMinute FROM watch_data_sleep_new_day d LEFT JOIN watch_data_sleep_new n ON d.sleep_id = n.id WHERE n.id IN (SELECT id FROM watch_data_sleep_new WHERE bind_user_id = #{id})")
|
||||
Double getAverageSleep(@Param("id") String id);
|
||||
|
||||
@Select("select MAX(data_value) dataValue,data_date dataDate from watch_data_steps force index(bind_user_id) where bind_user_id = #{id} group by data_date order by data_date desc limit 1")
|
||||
@Select("SELECT MAX(data_value) dataValue, data_date dataDate FROM watch_data_steps WHERE bind_user_id = #{id} ORDER BY data_date DESC FETCH FIRST 1 ROWS ONLY")
|
||||
WatchDataDTO getDataSteps(@Param("id") String id);
|
||||
|
||||
@Select("SELECT SUM(data_value) FROM watch_data_distance WHERE bind_user_id = #{id}")
|
||||
Integer getDataDistance(@Param("id") String id);
|
||||
|
||||
@Select("SELECT CAST(data_value as SIGNED) dataValue,data_date dataDate from watch_data_heart_rate where bind_user_id = #{id} order by time_stamp desc limit 1")
|
||||
@Select("SELECT CAST(data_value AS INTEGER) dataValue, data_date dataDate FROM watch_data_heart_rate WHERE bind_user_id = #{id} ORDER BY time_stamp DESC FETCH FIRST 1 ROWS ONLY")
|
||||
WatchDataDTO getHeartRate(@Param("id") String id);
|
||||
|
||||
@Select("SELECT CAST(data_value as SIGNED ) dataValue,data_date dataDate from watch_data_spo2 where bind_user_id = #{id} order by time_stamp desc limit 1")
|
||||
@Select("SELECT CAST(data_value AS INTEGER) dataValue, data_date dataDate FROM watch_data_spo2 WHERE bind_user_id = #{id} ORDER BY time_stamp DESC FETCH FIRST 1 ROWS ONLY")
|
||||
WatchDataDTO getDataSpo2(@Param("id") String id);
|
||||
|
||||
@Select("select cast(data_value as SIGNED ) dataValue,data_date dataDate from watch_data_stress where bind_user_id = #{id} order by end_time_stamp desc limit 1")
|
||||
@Select("SELECT CAST(data_value AS INTEGER) dataValue, data_date dataDate FROM watch_data_stress WHERE bind_user_id = #{id} ORDER BY end_time_stamp DESC FETCH FIRST 1 ROWS ONLY")
|
||||
WatchDataDTO getStress(@Param("id") String id);
|
||||
|
||||
@Select("select data_value dataValue,data_date dataDate from watch_data_temperature where bind_user_id = #{id} order by time_stamp desc limit 1")
|
||||
@Select("SELECT data_value dataValue, data_date dataDate FROM watch_data_temperature WHERE bind_user_id = #{id} ORDER BY time_stamp DESC FETCH FIRST 1 ROWS ONLY")
|
||||
WatchDataDTO getTemp(@Param("id") String id);
|
||||
|
||||
@Select("SELECT * FROM watch_data_sleep_new_minute WHERE sleep_id IN (SELECT id FROM watch_data_sleep_new WHERE sleep_flag= '1' AND bind_user_id = #{id} AND data_date = #{date})")
|
||||
List<WatchDataSleepNewMinute> getNewMinuteList(@Param("id") String id, @Param("date") Date date);
|
||||
|
||||
@Select("SELECT DISTINCT data_date dateDate FROM watch_data_sleep_new WHERE DATE_FORMAT( data_date, '%Y-%m' ) = DATE_FORMAT(#{date}, '%Y-%m' ) AND bind_user_id = #{id} AND sleep_flag = '1'")
|
||||
@Select("SELECT DISTINCT data_date dateDate FROM watch_data_sleep_new WHERE TO_CHAR( data_date, 'YYYY-MM' ) = TO_CHAR(#{date}, 'YYYY-MM' ) AND bind_user_id = #{id} AND sleep_flag = '1'")
|
||||
List<Date> getSleepNewDateList(@Param("id") String id, @Param("date") Date date);
|
||||
|
||||
List<Map<String, Object>> selectData(@Param("id") String id, @Param("format") String format, @Param("date") String date);
|
||||
|
||||
@Select("select max(data_value) `maxValue`,min(data_value) `minValue`,max(skin_tempera) maxSkinValue,min(skin_tempera) minSkinValue from watch_data_temperature where bind_user_id = #{id} and data_date = #{date}")
|
||||
@Select("select max(data_value) maxValue,min(data_value) minValue,max(skin_tempera) maxSkinValue,min(skin_tempera) minSkinValue from watch_data_temperature where bind_user_id = #{id} and data_date = #{date}")
|
||||
Map<String, Object> getMapValue(@Param("id") String id, @Param("date") Date date);
|
||||
|
||||
List<Map<String, Object>> getData(@Param("id") String id, @Param("format") String format, @Param("date") String date);
|
||||
|
||||
@Select("select max(data_value) `maxValue`,min(data_value) `minValue` from watch_data_heart_rate where bind_user_id = #{id} and data_date = #{date}")
|
||||
@Select("select max(data_value) maxValue,min(data_value) minValue from watch_data_heart_rate where bind_user_id = #{id} and data_date = #{date}")
|
||||
Map<String, Object> getMapRate(@Param("id") String id, @Param("date") Date date);
|
||||
|
||||
Map<String, Object> getMapRateValue(@Param("id") String id, @Param("date") Date date);
|
||||
@@ -73,15 +73,15 @@ public interface WatchMapper {
|
||||
|
||||
List<Map<String, Object>> getMapDataValueFormat(@Param("id") String id, @Param("date") String date, @Param("format") String format);
|
||||
|
||||
@Select("select max(data_value) `maxValue`,min(data_value) `minValue` ,round(avg(data_value)) `avgValue` from watch_data_stress where bind_user_id = #{id} and data_date = #{date}")
|
||||
@Select("select max(data_value) maxValue,min(data_value) minValue ,round(avg(data_value)) avgValue from watch_data_stress where bind_user_id = #{id} and data_date = #{date}")
|
||||
Map<String, Object> getMapStress(@Param("id") String id, @Param("date") Date date);
|
||||
|
||||
List<Map<String, Object>> getMapStressValueFormat(@Param("id") String id, @Param("date") String date, @Param("format") String format);
|
||||
|
||||
@Select("select max(data_value) `maxValue`,min(data_value) `minValue` from watch_data_spo2 where bind_user_id = #{id} and data_date = #{date}")
|
||||
@Select("select max(data_value) maxValue,min(data_value) minValue from watch_data_spo2 where bind_user_id = #{id} and data_date = #{date}")
|
||||
Map<String, Object> getMapSpo2(@Param("id") String id, @Param("date") Date date);
|
||||
|
||||
@Select("select data_value lastValue from watch_data_spo2 where bind_user_id = #{id} and data_date = #{date} order by time_stamp desc limit 1")
|
||||
@Select("SELECT data_value lastValue FROM watch_data_spo2 WHERE bind_user_id = #{id} AND data_date = #{date} ORDER BY time_stamp DESC FETCH FIRST 1 ROWS ONLY")
|
||||
Map<String, Object> getMapNewSpo2(@Param("id") String id, @Param("date") Date date);
|
||||
|
||||
List<Map<String, Object>> getMapSpo2Format(@Param("id") String id, @Param("date") String date, @Param("format") String format);
|
||||
@@ -95,6 +95,6 @@ public interface WatchMapper {
|
||||
|
||||
Map<String, Object> getAverageDay(@Param("id") String id);
|
||||
|
||||
@Select("SELECT watch_no FROM watch_bind_his WHERE bind_user_id = #{id} AND bind_date <= #{date} ORDER BY bind_date DESC limit 1")
|
||||
@Select("SELECT watch_no FROM watch_bind_his WHERE bind_user_id = #{id} AND bind_date <= #{date} ORDER BY bind_date DESC FETCH FIRST 1 ROWS ONLY")
|
||||
String getWatchNo(@Param("id") String id, @Param("date") String date);
|
||||
}
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public interface WatchMonitorDataMapper extends BaseMapper<WatchMonitorData>, MP
|
||||
|
||||
List<WatchMonitorData> getMonitorErrorNumsNew(@Param("orgCodes")List<String> orgCodes, @Param("start") Date start, @Param("end") Date end);
|
||||
|
||||
@Select("select count(1) from watch_monitor_data where bind_user_id = #{userId} and YEAR(warn_time) = #{year} and event_type = 'fall_down'")
|
||||
@Select("SELECT COUNT(1) FROM watch_monitor_data WHERE bind_user_id = #{userId} AND EXTRACT(YEAR FROM warn_time) = #{year} AND event_type = 'fall_down'")
|
||||
int selectUserFallNum(String userId,String year);
|
||||
|
||||
List<WatchMonitorData> selectParams(@Param("req") AloneReq req);
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ public interface WatchStatUserInfoDayStressMapper extends MPJBaseMapper<WatchSta
|
||||
List<WatchDataStressRes> selectStressByYear(@Param("dateYear") Date dateYear, @Param("userId")String userId);
|
||||
|
||||
|
||||
@Select("select * from watch_stat_user_info_day_stress where user_id = #{userId} DATE(data_date) = DATE(#{dataDate}) limit 1")
|
||||
@Select("SELECT * FROM watch_stat_user_info_day_stress WHERE user_id = #{userId} AND data_date = #{dataDate} AND ROWNUM = 1")
|
||||
WatchDataStressRes selectStressByUserIdAndDate(@Param("dateTime") Date dateTime, @Param("userId")String userId);
|
||||
|
||||
void insertStat(WatchStatUserInfoDayStress watchStatUserInfoDayStress);
|
||||
|
||||
+1
-1
@@ -64,6 +64,6 @@ public interface WatchUserDataMapper extends BaseMapper<WatchUserData> {
|
||||
* @param watchNo
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT MAX(data_date) FROM `watch_user_data` where bind_user_id = #{userId} and watch_no = #{watchNo}")
|
||||
@Select("SELECT MAX(data_date) FROM watch_user_data where bind_user_id = #{userId} and watch_no = #{watchNo}")
|
||||
Date lastDataDate(@Param("userId") String userId,@Param("watchNo") String watchNo);
|
||||
}
|
||||
|
||||
+3
-3
@@ -51,7 +51,7 @@ public class WatchStatisticsProvider {
|
||||
sb.append(orgCodeStr)
|
||||
.append(" as org_code, event_type, count(distinct bind_user_id) as warning_count ")
|
||||
.append("from watch_monitor_data ")
|
||||
.append("where warn_time between date_format(#{start}, '%Y-%m-%d 00:00:00') and date_format(#{end}, '%Y-%m-%d 23:59:59') ")
|
||||
.append("where warn_time between TRUNC(#{start}) and TRUNC(#{end}) + 1 - 1/86400 ")
|
||||
.append("and event_type in ('heart_rate','spo2','stress','temperature_anomalies') ");
|
||||
if (StrUtil.isNotEmpty(filter.getOrgCodeLeaf())) {
|
||||
sb.append("and org_code like CONCAT(#{orgCodeLeaf},'%')");
|
||||
@@ -65,11 +65,11 @@ public class WatchStatisticsProvider {
|
||||
public String wearingDetail() {
|
||||
return "SELECT " +
|
||||
" max(wd.bind_user_id) as bind_user_id," +
|
||||
" max(distinct wbh.bind_date) as bind_date," +
|
||||
" max(wbh.bind_date) as bind_date," +
|
||||
" count(distinct wud.data_date) as date_count," +
|
||||
" wd.watch_no," +
|
||||
" max(wd.org_code) as watch_org_code," +
|
||||
" GROUP_CONCAT(distinct wud.data_date order by wud.data_date) as date_list" +
|
||||
" LISTAGG(wud.data_date, ',') WITHIN GROUP (ORDER BY wud.data_date) as date_list" +
|
||||
" FROM watch_device wd" +
|
||||
" LEFT JOIN watch_bind_his wbh" +
|
||||
" ON wd.watch_no = wbh.watch_no AND wd.bind_user_id = wbh.bind_user_id AND wbh.bind_end_date IS NULL" +
|
||||
|
||||
+5
-3
@@ -3,6 +3,7 @@
|
||||
<mapper namespace="com.renkang.watch.mapper.ArchivesBodyTypeMapper">
|
||||
|
||||
<select id="selectHeartRateData" resultType="com.renkang.watch.entity.ArchivesBodyType">
|
||||
SELECT * FROM (
|
||||
SELECT
|
||||
temp.*
|
||||
FROM
|
||||
@@ -17,7 +18,8 @@
|
||||
watch_data
|
||||
WHERE
|
||||
userid = #{userId}
|
||||
AND type = 1 UNION ALL
|
||||
AND type = 1
|
||||
UNION ALL
|
||||
SELECT
|
||||
user_id AS userId,
|
||||
data_value AS dataValue,
|
||||
@@ -32,7 +34,7 @@
|
||||
) temp
|
||||
ORDER BY
|
||||
temp.createDate DESC
|
||||
LIMIT 1;
|
||||
) WHERE ROWNUM = 1
|
||||
</select>
|
||||
<select id="selectTemperatureData" resultType="com.renkang.watch.entity.ArchivesBodyType">
|
||||
SELECT
|
||||
@@ -62,9 +64,9 @@
|
||||
user_id = #{userId}
|
||||
AND type = 5
|
||||
) temp
|
||||
WHERE ROWNUM = 1
|
||||
ORDER BY
|
||||
temp.createDate DESC
|
||||
LIMIT 1;
|
||||
</select>
|
||||
<select id="analysisHeartRateListData" resultType="com.renkang.watch.entity.ArchivesBodyType">
|
||||
SELECT
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
`watch_data_heart_rate`
|
||||
"watch_data_heart_rate"
|
||||
WHERE
|
||||
YEAR ( data_date )= #{req.dateYear}
|
||||
EXTRACT(YEAR FROM data_date) = #{req.dateYear}
|
||||
AND
|
||||
bind_user_id=#{req.userId}
|
||||
order by data_date desc,time_stamp desc
|
||||
|
||||
+163
-99
@@ -88,18 +88,18 @@
|
||||
|
||||
<select id="selectSevenActiveList" resultType="com.renkang.watch.entity.WatchData">
|
||||
select
|
||||
orgcode, IFNULL(COUNT(DISTINCT userid),0) AS "type"
|
||||
orgcode, NVL(COUNT(DISTINCT userid),0) AS "type"
|
||||
from watch_data
|
||||
WHERE last_update_time >= CURDATE() - INTERVAL 6 DAY
|
||||
WHERE last_update_time >= SYSDATE - 6
|
||||
GROUP BY orgcode
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectThirtyActiveList" resultType="com.renkang.watch.entity.WatchData">
|
||||
select
|
||||
orgcode, IFNULL(COUNT(DISTINCT userid),0) AS "type"
|
||||
orgcode, NVL(COUNT(DISTINCT userid),0) AS "type"
|
||||
from watch_data
|
||||
WHERE last_update_time >= CURDATE() - INTERVAL 29 DAY
|
||||
WHERE last_update_time >= SYSDATE - 29
|
||||
GROUP BY orgcode
|
||||
</select>
|
||||
|
||||
@@ -127,89 +127,113 @@
|
||||
SELECT count(1)
|
||||
FROM watch_data
|
||||
WHERE watch_no = #{watchNo}
|
||||
AND last_update_time >= CURDATE() - INTERVAL 7 DAY
|
||||
AND last_update_time >= SYSDATE - 7
|
||||
</select>
|
||||
|
||||
<insert id="insertHeartRate">
|
||||
insert into watch_data(id, userid, username, orgcode, watch_no, type, data_value, last_update_time)
|
||||
(select #{id,jdbcType=VARCHAR}, bind_user_id, #{username,jdbcType=VARCHAR}, #{orgcode,jdbcType=VARCHAR}, watch_no, 1, data_value, data_date
|
||||
from watch_data_heart_rate force index (bind_user_id)
|
||||
from (select bind_user_id, watch_no, data_value, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
||||
from watch_data_heart_rate
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
order by time_stamp desc
|
||||
limit 1);
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR})
|
||||
where rn = 1);
|
||||
</insert>
|
||||
|
||||
<update id="updateHeartRate">
|
||||
update watch_data wd left join (select bind_user_id, data_value, data_date
|
||||
from watch_data_heart_rate force index (bind_user_id)
|
||||
update watch_data wd
|
||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||
wd.data_value = (select data_value from (
|
||||
select bind_user_id, data_value, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
||||
from watch_data_heart_rate
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
order by time_stamp desc
|
||||
limit 1) d on d.bind_user_id = wd.userid
|
||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||
wd.data_value = d.data_value,
|
||||
wd.last_update_time = d.data_date
|
||||
) where rn = 1),
|
||||
wd.last_update_time = (select data_date from (
|
||||
select bind_user_id, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
||||
from watch_data_heart_rate
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
) where rn = 1)
|
||||
where wd.userid = #{userid,jdbcType=VARCHAR}
|
||||
and wd.watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
and wd.`type` = 1;
|
||||
and wd."type" = 1;
|
||||
</update>
|
||||
|
||||
<insert id="insertSpo2">
|
||||
insert into watch_data(id, userid, username, orgcode, watch_no, type, data_value, last_update_time)
|
||||
(select #{id,jdbcType=VARCHAR}, bind_user_id, #{username,jdbcType=VARCHAR}, #{orgcode,jdbcType=VARCHAR}, watch_no, 2, data_value, data_date
|
||||
from watch_data_spo2 force index (bind_user_id_index)
|
||||
from (select bind_user_id, watch_no, data_value, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
||||
from watch_data_spo2
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
order by time_stamp desc
|
||||
limit 1);
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR})
|
||||
where rn = 1);
|
||||
</insert>
|
||||
|
||||
<update id="updateSpo2">
|
||||
update watch_data wd left join (select bind_user_id, data_value, data_date
|
||||
from watch_data_spo2 force index (bind_user_id_index)
|
||||
update watch_data wd
|
||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||
wd.data_value = (select data_value from (
|
||||
select bind_user_id, data_value, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
||||
from watch_data_spo2
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
order by time_stamp desc
|
||||
limit 1) d on d.bind_user_id = wd.userid
|
||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||
wd.data_value = d.data_value,
|
||||
wd.last_update_time = d.data_date
|
||||
) where rn = 1),
|
||||
wd.last_update_time = (select data_date from (
|
||||
select bind_user_id, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
||||
from watch_data_spo2
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
) where rn = 1)
|
||||
where userid = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
and `type` = 2;
|
||||
and "type" = 2;
|
||||
</update>
|
||||
|
||||
<insert id="insertStress">
|
||||
insert into watch_data(id, userid, username, orgcode, watch_no, type, data_value, last_update_time)
|
||||
(select #{id,jdbcType=VARCHAR}, bind_user_id, #{username,jdbcType=VARCHAR}, #{orgcode,jdbcType=VARCHAR}, watch_no, 3, data_value, data_date
|
||||
from watch_data_stress force index (bind_user_id)
|
||||
from (select bind_user_id, watch_no, data_value, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY start_time_stamp desc) as rn
|
||||
from watch_data_stress
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
order by start_time_stamp desc
|
||||
limit 1);
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR})
|
||||
where rn = 1);
|
||||
</insert>
|
||||
|
||||
<update id="updateStress">
|
||||
update watch_data wd left join (select bind_user_id, data_value, data_date
|
||||
from watch_data_stress force index (bind_user_id)
|
||||
update watch_data wd
|
||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||
wd.data_value = (select data_value from (
|
||||
select bind_user_id, data_value, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY start_time_stamp desc) as rn
|
||||
from watch_data_stress
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
order by start_time_stamp desc
|
||||
limit 1) d on d.bind_user_id = wd.userid
|
||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||
wd.data_value = d.data_value,
|
||||
wd.last_update_time = d.data_date
|
||||
) where rn = 1),
|
||||
wd.last_update_time = (select data_date from (
|
||||
select bind_user_id, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY start_time_stamp desc) as rn
|
||||
from watch_data_stress
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
) where rn = 1)
|
||||
where userid = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
and `type` = 3;
|
||||
and "type" = 3;
|
||||
</update>
|
||||
|
||||
<insert id="insertSleep">
|
||||
insert into watch_data(id, userid, username, orgcode, watch_no, type, data_value, last_update_time)
|
||||
(select #{id,jdbcType=VARCHAR}, bind_user_id,
|
||||
#{username,jdbcType=VARCHAR}, #{orgcode,jdbcType=VARCHAR}, #{watchNo,jdbcType=VARCHAR}, 4,
|
||||
sum(time_to_sec(timediff(sm.end_time, sm.start_time))) / 60 as deep_light_times, data_date
|
||||
NVL(SUM(EXTRACT(HOUR FROM (sm.end_time - sm.start_time)) * 60 + EXTRACT(MINUTE FROM (sm.end_time - sm.start_time))), 0) as deep_light_times, data_date
|
||||
from watch_data_sleep_new s
|
||||
left join watch_data_sleep_new_minute sm on s.id = sm.sleep_id
|
||||
where s.bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
@@ -217,13 +241,13 @@
|
||||
and s.sleep_flag = '1'
|
||||
group by s.bind_user_id, s.watch_no, s.data_date
|
||||
order by data_date desc
|
||||
limit 1);
|
||||
FETCH FIRST 1 ROWS ONLY);
|
||||
</insert>
|
||||
|
||||
<update id="updateSleep">
|
||||
update watch_data wd left join (select s.bind_user_id,
|
||||
sum(time_to_sec(timediff(sm.end_time, sm.start_time))) / 60 as deep_light_times,
|
||||
data_date
|
||||
update watch_data wd
|
||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||
wd.data_value = (select NVL(SUM(EXTRACT(HOUR FROM (sm.end_time - sm.start_time)) * 60 + EXTRACT(MINUTE FROM (sm.end_time - sm.start_time))), 0)
|
||||
from watch_data_sleep_new s
|
||||
left join watch_data_sleep_new_minute sm on s.id = sm.sleep_id
|
||||
where s.bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
@@ -231,118 +255,158 @@
|
||||
and s.sleep_flag = '1'
|
||||
group by s.bind_user_id, s.watch_no, s.data_date
|
||||
order by data_date desc
|
||||
limit 1) d on d.bind_user_id = wd.userid
|
||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||
wd.data_value = d.deep_light_times,
|
||||
wd.last_update_time = d.data_date
|
||||
FETCH FIRST 1 ROWS ONLY),
|
||||
wd.last_update_time = (select data_date from (
|
||||
select data_date
|
||||
from watch_data_sleep_new
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
and sleep_flag = '1'
|
||||
order by data_date desc
|
||||
) where ROWNUM = 1)
|
||||
where userid = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
and `type` = 4;
|
||||
and "type" = 4;
|
||||
</update>
|
||||
|
||||
<insert id="insertTemperature">
|
||||
insert into watch_data(id, userid, username, orgcode, watch_no, type, data_value, last_update_time)
|
||||
(select #{id,jdbcType=VARCHAR}, bind_user_id, #{username,jdbcType=VARCHAR}, #{orgcode,jdbcType=VARCHAR}, watch_no, 5, data_value, data_date
|
||||
from watch_data_temperature force index (bind_user_id)
|
||||
from (select bind_user_id, watch_no, data_value, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
||||
from watch_data_temperature
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
order by time_stamp desc
|
||||
limit 1);
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR})
|
||||
where rn = 1);
|
||||
</insert>
|
||||
|
||||
<update id="updateTemperature">
|
||||
update watch_data wd left join (select bind_user_id, data_value, data_date
|
||||
from watch_data_temperature force index (bind_user_id)
|
||||
update watch_data wd
|
||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||
wd.data_value = (select data_value from (
|
||||
select bind_user_id, data_value, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
||||
from watch_data_temperature
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
order by time_stamp desc
|
||||
limit 1) d on d.bind_user_id = wd.userid
|
||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||
wd.data_value = d.data_value,
|
||||
wd.last_update_time = d.data_date
|
||||
) where rn = 1),
|
||||
wd.last_update_time = (select data_date from (
|
||||
select bind_user_id, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
||||
from watch_data_temperature
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
) where rn = 1)
|
||||
where userid = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
and `type` = 5;
|
||||
and "type" = 5;
|
||||
</update>
|
||||
|
||||
<insert id="insertWorkout">
|
||||
insert into watch_data(id, userid, username, orgcode, watch_no, type, data_value, last_update_time)
|
||||
(select #{id,jdbcType=VARCHAR}, bind_user_id, #{username,jdbcType=VARCHAR}, #{orgcode,jdbcType=VARCHAR}, watch_no, 6, sum(calorie), data_date
|
||||
from watch_data_workout force index (bind_user_id)
|
||||
from (select bind_user_id, watch_no, sum(calorie) as calorie, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
||||
from watch_data_workout
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
group by bind_user_id, watch_no, data_date
|
||||
order by data_date desc
|
||||
limit 1);
|
||||
group by bind_user_id, watch_no, data_date)
|
||||
where rn = 1);
|
||||
</insert>
|
||||
|
||||
<update id="updateWorkout">
|
||||
update watch_data wd left join (select bind_user_id, sum(calorie) as data_value, data_date
|
||||
from watch_data_workout force index (bind_user_id)
|
||||
update watch_data wd
|
||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||
wd.data_value = (select sum(calorie) from (
|
||||
select bind_user_id, watch_no, sum(calorie) as calorie, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
||||
from watch_data_workout
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
group by bind_user_id, watch_no, data_date
|
||||
order by data_date desc
|
||||
limit 1) d on d.bind_user_id = wd.userid
|
||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||
wd.data_value = d.data_value,
|
||||
wd.last_update_time = d.data_date
|
||||
) where rn = 1),
|
||||
wd.last_update_time = (select data_date from (
|
||||
select bind_user_id, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
||||
from watch_data_workout
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
group by bind_user_id, watch_no, data_date
|
||||
) where rn = 1)
|
||||
where userid = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
and `type` = 6;
|
||||
and "type" = 6;
|
||||
</update>
|
||||
|
||||
<insert id="insertDistance">
|
||||
insert into watch_data(id, userid, username, orgcode, watch_no, type, data_value, last_update_time)
|
||||
(select #{id,jdbcType=VARCHAR}, bind_user_id, #{username,jdbcType=VARCHAR}, #{orgcode,jdbcType=VARCHAR}, watch_no, 7, max(data_value), data_date
|
||||
from watch_data_distance force index (bind_user_id)
|
||||
from (select bind_user_id, watch_no, max(data_value) as data_value, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
||||
from watch_data_distance
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
group by bind_user_id, watch_no, data_date
|
||||
order by data_date desc
|
||||
limit 1);
|
||||
group by bind_user_id, watch_no, data_date)
|
||||
where rn = 1);
|
||||
</insert>
|
||||
|
||||
<update id="updateDistance">
|
||||
update watch_data wd left join (select bind_user_id,max(data_value) as data_value, data_date
|
||||
from watch_data_distance force index (bind_user_id)
|
||||
update watch_data wd
|
||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||
wd.data_value = (select max(data_value) from (
|
||||
select bind_user_id, watch_no, max(data_value) as data_value, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
||||
from watch_data_distance
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
group by bind_user_id, watch_no, data_date
|
||||
order by data_date desc
|
||||
limit 1) d on d.bind_user_id = wd.userid
|
||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||
wd.data_value = d.data_value,
|
||||
wd.last_update_time = d.data_date
|
||||
) where rn = 1),
|
||||
wd.last_update_time = (select data_date from (
|
||||
select bind_user_id, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
||||
from watch_data_distance
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
group by bind_user_id, watch_no, data_date
|
||||
) where rn = 1)
|
||||
where userid = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
and `type` = 7;
|
||||
and "type" = 7;
|
||||
</update>
|
||||
|
||||
<insert id="insertSteps">
|
||||
insert into watch_data(id, userid, username, orgcode, watch_no, type, data_value, last_update_time)
|
||||
(select #{id,jdbcType=VARCHAR}, bind_user_id, #{username,jdbcType=VARCHAR}, #{orgcode,jdbcType=VARCHAR}, watch_no, 8, max(data_value), data_date
|
||||
from watch_data_steps force index (bind_user_id)
|
||||
from (select bind_user_id, watch_no, max(data_value) as data_value, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
||||
from watch_data_steps
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
group by bind_user_id, watch_no, data_date
|
||||
order by data_date desc
|
||||
limit 1);
|
||||
group by bind_user_id, watch_no, data_date)
|
||||
where rn = 1);
|
||||
</insert>
|
||||
|
||||
<update id="updateSteps">
|
||||
update watch_data wd left join (select bind_user_id,max(data_value) as data_value, data_date
|
||||
from watch_data_steps force index (bind_user_id)
|
||||
update watch_data wd
|
||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||
wd.data_value = (select max(data_value) from (
|
||||
select bind_user_id, watch_no, max(data_value) as data_value, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
||||
from watch_data_steps
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
group by bind_user_id, watch_no, data_date
|
||||
order by data_date desc
|
||||
limit 1) d on d.bind_user_id = wd.userid
|
||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||
wd.data_value = d.data_value,
|
||||
wd.last_update_time = d.data_date
|
||||
) where rn = 1),
|
||||
wd.last_update_time = (select data_date from (
|
||||
select bind_user_id, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
||||
from watch_data_steps
|
||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
group by bind_user_id, watch_no, data_date
|
||||
) where rn = 1)
|
||||
where userid = #{userid,jdbcType=VARCHAR}
|
||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||
and `type` = 8;
|
||||
and "type" = 8;
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
+3
-3
@@ -34,7 +34,7 @@
|
||||
wdsnm.start_time as startTime,
|
||||
wdsnm.end_time as endTime,
|
||||
wdsnm.sleep_type as sleepType,
|
||||
TIMESTAMPDIFF(MINUTE,wdsnm.start_time,wdsnm.end_time) as times
|
||||
EXTRACT(MINUTE FROM (wdsnm.end_time - wdsnm.start_time)) as times
|
||||
from
|
||||
watch_data_sleep_new wdsn
|
||||
inner join watch_data_sleep_new_minute wdsnm on wdsnm.sleep_id=wdsn.id
|
||||
@@ -55,13 +55,13 @@
|
||||
</if>
|
||||
<if test="req.flag!=null and req.flag==3">
|
||||
<if test="req.dateMonth!=null">
|
||||
and DATE_FORMAT(wdsn.data_date,'%Y-%m') =DATE_FORMAT(#{req.dateMonth},'%Y-%m')
|
||||
and TO_CHAR(wdsn.data_date,'YYYY-MM') = TO_CHAR(#{req.dateMonth},'YYYY-MM')
|
||||
</if>
|
||||
|
||||
</if>
|
||||
<if test="req.flag!=null and req.flag==4">
|
||||
<if test="req.dateYear!=null">
|
||||
and year(wdsn.data_date) =#{req.dateYear}
|
||||
and EXTRACT(YEAR FROM wdsn.data_date) = #{req.dateYear}
|
||||
</if>
|
||||
</if>
|
||||
</where>
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
`watch_data_spo2`
|
||||
"watch_data_spo2"
|
||||
WHERE
|
||||
YEAR ( data_date )= #{req.dateYear}
|
||||
EXTRACT(YEAR FROM data_date) = #{req.dateYear}
|
||||
AND
|
||||
bind_user_id=#{req.userId}
|
||||
order by data_date desc,time_stamp desc
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
`watch_data_stress`
|
||||
"watch_data_stress"
|
||||
WHERE
|
||||
YEAR ( data_date )= #{req.dateYear}
|
||||
EXTRACT(YEAR FROM data_date) = #{req.dateYear}
|
||||
AND
|
||||
bind_user_id=#{req.userId}
|
||||
order by data_date desc,start_time_stamp asc ,end_time_stamp asc
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
`watch_data_temperature`
|
||||
"watch_data_temperature"
|
||||
WHERE
|
||||
YEAR ( data_date )= #{req.dateYear}
|
||||
EXTRACT(YEAR FROM data_date) = #{req.dateYear}
|
||||
AND
|
||||
bind_user_id=#{req.userId}
|
||||
order by data_date desc,
|
||||
|
||||
+22
-16
@@ -5,7 +5,7 @@
|
||||
<select id="selectSportCostList" resultType="com.renkang.watch.entity.WatchDataWorkout">
|
||||
SELECT
|
||||
DATE(start_time_stamp) as "dataDate",
|
||||
IFNULL(SUM(calorie),0) AS calorie,
|
||||
NVL(SUM(calorie),0) AS calorie,
|
||||
SUM(
|
||||
CASE
|
||||
WHEN workout_type IN (1, 3, 11, 12, 13, 17, 18, 102, 103, 107, 108, 109, 110, 112, 113, 114, 115, 116, 117, 118, 119, 120, 122, 127, 129, 137, 138, 142, 143, 151, 153, 154, 155, 156, 157, 163, 164, 166, 167, 169, 177, 179, 180, 181, 182, 183) THEN calorie * 0.30
|
||||
@@ -19,25 +19,25 @@
|
||||
WHEN workout_type IN (2, 4, 5, 6, 7, 8, 9, 10, 14, 15, 16, 19, 20, 21, 101, 104, 105, 106, 111, 121, 123, 124, 125, 126, 128, 130, 131, 132, 133, 134, 135, 136, 139, 140, 141, 144, 145, 146, 147, 148, 149, 150, 158, 159, 160, 161, 162, 165, 168, 170, 171, 172, 173, 174, 175, 176, 178, 184, 185) THEN calorie-FLOOR(calorie * 0.50)
|
||||
ELSE 0
|
||||
END
|
||||
) AS sugarCalories
|
||||
) AS sugarCalories,
|
||||
SUM(NVL(EXTRACT(SECOND FROM (end_time_stamp - start_time_stamp)) +
|
||||
EXTRACT(MINUTE FROM (end_time_stamp - start_time_stamp)) * 60 +
|
||||
EXTRACT(HOUR FROM (end_time_stamp - start_time_stamp)) * 3600, 0)) as "totalTime"
|
||||
FROM
|
||||
watch_data_workout
|
||||
WHERE
|
||||
FIND_IN_SET(workout_type,'1,2,3,109,144,6,7,101,113,145')
|
||||
and bind_user_id = #{watchDataWorkout.bindUserId}
|
||||
INSTR(',' || '1,2,3,109,144,6,7,101,113,145' || ',', ',' || workout_type || ',') > 0
|
||||
<if test="watchDataWorkout.endTime != null and watchDataWorkout.startTime != null">
|
||||
and DATE(start_time_stamp) >= DATE(#{watchDataWorkout.startTime})
|
||||
and DATE(start_time_stamp) <= DATE(#{watchDataWorkout.endTime})
|
||||
</if>
|
||||
GROUP BY
|
||||
dataDate
|
||||
order by dataDate
|
||||
and bind_user_id = #{watchDataWorkout.bindUserId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectSportCostTotal" resultType="com.renkang.watch.entity.WatchDataWorkout">
|
||||
SELECT
|
||||
IFNULL(SUM(calorie),0) AS calorie,
|
||||
NVL(SUM(calorie),0) AS calorie,
|
||||
SUM(
|
||||
CASE
|
||||
WHEN workout_type IN (1, 3, 11, 12, 13, 17, 18, 102, 103, 107, 108, 109, 110, 112, 113, 114, 115, 116, 117, 118, 119, 120, 122, 127, 129, 137, 138, 142, 143, 151, 153, 154, 155, 156, 157, 163, 164, 166, 167, 169, 177, 179, 180, 181, 182, 183) THEN calorie * 0.30
|
||||
@@ -88,27 +88,31 @@
|
||||
ELSE 0
|
||||
END
|
||||
AS sugarCalories,
|
||||
IFNULL(TIMESTAMPDIFF(SECOND, start_time_stamp, end_time_stamp),0) as "totalTime"
|
||||
NVL(EXTRACT(SECOND FROM (end_time_stamp - start_time_stamp)) +
|
||||
EXTRACT(MINUTE FROM (end_time_stamp - start_time_stamp)) * 60 +
|
||||
EXTRACT(HOUR FROM (end_time_stamp - start_time_stamp)) * 3600, 0) as "totalTime"
|
||||
from
|
||||
watch_data_workout
|
||||
WHERE
|
||||
bind_user_id = #{watchDataWorkout.bindUserId}
|
||||
and DATE(start_time_stamp) = DATE(#{watchDataWorkout.dataDate})
|
||||
and FIND_IN_SET(workout_type,'1,2,3,109,144,6,7,101,113,145')
|
||||
and INSTR(',' || '1,2,3,109,144,6,7,101,113,145' || ',', ',' || workout_type || ',') > 0
|
||||
order by start_time_stamp desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectselectSportTimingTotal" resultType="com.renkang.watch.entity.WatchDataWorkout">
|
||||
select
|
||||
IFNULL(SUM(calorie),0) as "calorie",
|
||||
IFNULL(SUM(TIMESTAMPDIFF(SECOND, start_time_stamp, end_time_stamp)),0) as "totalTime"
|
||||
NVL(SUM(calorie),0) as "calorie",
|
||||
NVL(SUM(EXTRACT(SECOND FROM (end_time_stamp - start_time_stamp)) +
|
||||
EXTRACT(MINUTE FROM (end_time_stamp - start_time_stamp)) * 60 +
|
||||
EXTRACT(HOUR FROM (end_time_stamp - start_time_stamp)) * 3600),0) as "totalTime"
|
||||
from
|
||||
watch_data_workout
|
||||
WHERE
|
||||
bind_user_id = #{watchDataWorkout.bindUserId}
|
||||
and DATE(start_time_stamp) = DATE(#{watchDataWorkout.dataDate})
|
||||
and FIND_IN_SET(workout_type,'1,2,3,109,144,6,7,101,113,145')
|
||||
and INSTR(',' || '1,2,3,109,144,6,7,101,113,145' || ',', ',' || workout_type || ',') > 0
|
||||
</select>
|
||||
|
||||
|
||||
@@ -193,7 +197,7 @@
|
||||
bind_user_id = #{watchDataWorkout.bindUserId}
|
||||
and DATE(start_time_stamp) >= DATE(#{watchDataWorkout.startTime})
|
||||
and DATE(start_time_stamp) <= DATE(#{watchDataWorkout.endTime})
|
||||
and FIND_IN_SET(workout_type,'1,2,3,109,144,6,7,101,113,145')
|
||||
and INSTR(',' || '1,2,3,109,144,6,7,101,113,145' || ',', ',' || workout_type || ',') > 0
|
||||
order by start_time_stamp
|
||||
</select>
|
||||
|
||||
@@ -240,8 +244,10 @@
|
||||
|
||||
<select id="selectselectSportTimingTotalNew" resultType="com.renkang.watch.entity.WatchDataWorkout">
|
||||
select
|
||||
IFNULL(SUM(calorie),0) as "calorie",
|
||||
IFNULL(SUM(TIMESTAMPDIFF(SECOND, start_time_stamp, end_time_stamp)),0) as "totalTime",
|
||||
NVL(SUM(calorie),0) as "calorie",
|
||||
NVL(SUM(EXTRACT(SECOND FROM (end_time_stamp - start_time_stamp)) +
|
||||
EXTRACT(MINUTE FROM (end_time_stamp - start_time_stamp)) * 60 +
|
||||
EXTRACT(HOUR FROM (end_time_stamp - start_time_stamp)) * 3600),0) as "totalTime",
|
||||
MIN(start_time_stamp) AS "dataDate"
|
||||
from
|
||||
watch_data_workout
|
||||
|
||||
+12
-6
@@ -16,9 +16,9 @@
|
||||
END AS watch_status,
|
||||
wd.bind_date,
|
||||
wd.bind_user_id,
|
||||
GROUP_CONCAT(wds.wd_type) AS wd_types,
|
||||
GROUP_CONCAT(wds.switch_flag) AS switch_flags,
|
||||
GROUP_CONCAT(IFNULL(wds.update_date, '') SEPARATOR ',') AS update_dates
|
||||
LISTAGG(wds.wd_type, ',') WITHIN GROUP (ORDER BY wds.wd_type) AS wd_types,
|
||||
LISTAGG(wds.switch_flag, ',') WITHIN GROUP (ORDER BY wds.switch_flag) AS switch_flags,
|
||||
LISTAGG(NVL(TO_CHAR(wds.update_date, 'YYYY-MM-DD HH24:MI:SS'), '') || ',') WITHIN GROUP (ORDER BY wds.update_date) AS update_dates
|
||||
FROM
|
||||
watch_device wd
|
||||
LEFT JOIN
|
||||
@@ -45,7 +45,13 @@
|
||||
${permissionSql}
|
||||
</where>
|
||||
GROUP BY
|
||||
wd.id,wd.watch_no, wd.dept_id, wd.create_date, watch_status, wd.bind_date, wd.bind_user_id
|
||||
wd.id, wd.watch_no, wd.dept_id, wd.create_date,
|
||||
CASE
|
||||
WHEN wd.bind_user_id IS NULL THEN 0
|
||||
WHEN wd.bind_user_id = '' THEN 0
|
||||
ELSE 1
|
||||
END,
|
||||
wd.bind_date, wd.bind_user_id
|
||||
ORDER BY
|
||||
wd.create_date DESC;
|
||||
</select>
|
||||
@@ -147,7 +153,7 @@
|
||||
count(1)
|
||||
from watch_device
|
||||
where org_code = #{orgCode}
|
||||
and Date(create_date) <![CDATA[ <= ]]> #{endDate}
|
||||
and TRUNC(create_date) <![CDATA[ <= ]]> #{endDate}
|
||||
</select>
|
||||
|
||||
|
||||
@@ -425,7 +431,7 @@
|
||||
COALESCE(steps.step_value, 0) AS stepValue,
|
||||
COALESCE(steps.last_upload_time, NULL) AS stepTime,
|
||||
COALESCE(workout.start_time_stamp, NULL) AS durationTime,
|
||||
COALESCE(TIMESTAMPDIFF(MINUTE, workout.start_time_stamp, workout.end_time_stamp),0) AS durationTotalValue,
|
||||
COALESCE(EXTRACT(MINUTE FROM (workout.end_time_stamp - workout.start_time_stamp)),0) AS durationTotalValue,
|
||||
workout.workout_type AS workoutType,
|
||||
|
||||
COALESCE(hr.errorNum, 0) AS rateAbnormalValue,
|
||||
|
||||
+18
-20
@@ -6,7 +6,7 @@
|
||||
s.data_value stepsValue,
|
||||
d.data_value distanceValue,
|
||||
c.data_value calorieValue,
|
||||
DATE_FORMAT(s.data_date, '%Y-%m-%d') dataDate
|
||||
TO_CHAR(s.data_date, 'YYYY-MM-DD') dataDate
|
||||
FROM
|
||||
watch_data_steps s
|
||||
LEFT JOIN watch_data_distance d ON s.bind_user_id = d.bind_user_id
|
||||
@@ -15,7 +15,7 @@
|
||||
AND s.data_date = c.data_date
|
||||
WHERE
|
||||
s.bind_user_id = #{id}
|
||||
AND DATE_FORMAT(s.data_date, #{format}) = #{date}
|
||||
AND TO_CHAR(s.data_date, #{format}) = #{date}
|
||||
ORDER BY
|
||||
s.data_date ASC
|
||||
</select>
|
||||
@@ -29,36 +29,33 @@
|
||||
watch_data_temperature
|
||||
WHERE
|
||||
bind_user_id = #{id}
|
||||
AND DATE_FORMAT( data_date, #{format}) = #{date}
|
||||
AND TO_CHAR(data_date, #{format}) = #{date}
|
||||
ORDER BY
|
||||
data_date ASC
|
||||
</select>
|
||||
<select id="getMapRateValue" resultType="java.util.Map">
|
||||
SELECT
|
||||
max( data_value ) `maxValue`,
|
||||
min( data_value ) `minValue`
|
||||
max( data_value ) maxValue,
|
||||
min( data_value ) minValue
|
||||
FROM
|
||||
watch_monitor_data
|
||||
WHERE
|
||||
event_type = 'heart_rate'
|
||||
AND data_value != NULL
|
||||
AND bind_user_id = #{id}
|
||||
AND data_date BETWEEN (
|
||||
DATE_SUB(#{date}, INTERVAL WEEKDAY(#{date}) DAY ))
|
||||
AND (
|
||||
DATE_SUB(#{date}, INTERVAL WEEKDAY(#{date}) - 6 DAY ))
|
||||
AND data_date BETWEEN TRUNC(#{date}, 'IW') AND TRUNC(#{date}, 'IW') + 6
|
||||
</select>
|
||||
<select id="getMapRateValueFormat" resultType="java.util.Map">
|
||||
SELECT
|
||||
max( data_value ) `maxValue`,
|
||||
min( data_value ) `minValue`
|
||||
max( data_value ) maxValue,
|
||||
min( data_value ) minValue
|
||||
FROM
|
||||
watch_monitor_data
|
||||
WHERE
|
||||
event_type = 'heart_rate'
|
||||
AND data_value != NULL
|
||||
AND bind_user_id = #{id}
|
||||
AND DATE_FORMAT( data_date, #{format} ) = #{date}
|
||||
AND TO_CHAR(data_date, #{format}) = #{date}
|
||||
</select>
|
||||
<select id="getMapDataValueFormat" resultType="java.util.Map">
|
||||
SELECT
|
||||
@@ -68,7 +65,7 @@
|
||||
watch_data_heart_rate
|
||||
WHERE
|
||||
bind_user_id = #{id}
|
||||
AND DATE_FORMAT( data_date, #{format} ) = #{date}
|
||||
AND TO_CHAR(data_date, #{format}) = #{date}
|
||||
ORDER BY
|
||||
time_stamp ASC
|
||||
</select>
|
||||
@@ -80,7 +77,7 @@
|
||||
watch_data_stress
|
||||
WHERE
|
||||
bind_user_id = #{id}
|
||||
AND DATE_FORMAT( data_date, #{format}) = #{date}
|
||||
AND TO_CHAR(data_date, #{format}) = #{date}
|
||||
ORDER BY
|
||||
start_time_stamp DESC
|
||||
</select>
|
||||
@@ -92,7 +89,7 @@
|
||||
watch_data_spo2
|
||||
WHERE
|
||||
bind_user_id = #{id}
|
||||
AND DATE_FORMAT( data_date,#{format}) = #{date}
|
||||
AND TO_CHAR(data_date, #{format}) = #{date}
|
||||
ORDER BY
|
||||
time_stamp DESC
|
||||
</select>
|
||||
@@ -109,18 +106,19 @@
|
||||
WHERE
|
||||
bind_user_id = #{id}
|
||||
AND event_type = #{type}
|
||||
AND DATE_FORMAT( data_date, '%Y-%m' ) = #{date}
|
||||
AND TO_CHAR(data_date, 'YYYY-MM') = #{date}
|
||||
ORDER BY
|
||||
data_date DESC
|
||||
LIMIT #{startNo}, #{pageSize}
|
||||
OFFSET #{startNo} ROWS FETCH NEXT #{pageSize} ROWS ONLY
|
||||
</select>
|
||||
<select id="getAverageDay" resultType="java.util.Map">
|
||||
SELECT
|
||||
CAST( AVG( total_minutes ) AS UNSIGNED ) AS minutes,
|
||||
ROUND( AVG( total_minutes ) ) AS minutes,
|
||||
( SELECT COUNT(*) FROM watch_data_sleep_new_day WHERE sleep_id IN ( SELECT id FROM watch_data_sleep_new WHERE
|
||||
bind_user_id = #{id}) ) AS sum
|
||||
FROM
|
||||
( SELECT TIMESTAMPDIFF( MINUTE, fall_asleep_time, wake_up_time ) AS total_minutes FROM watch_data_sleep_new_day
|
||||
WHERE sleep_id IN ( SELECT id FROM watch_data_sleep_new WHERE bind_user_id = #{id}) ) AS subquery;
|
||||
( SELECT ROUND((CAST(wake_up_time AS DATE) - CAST(fall_asleep_time AS DATE)) * 24 * 60) AS total_minutes
|
||||
FROM watch_data_sleep_new_day
|
||||
WHERE sleep_id IN ( SELECT id FROM watch_data_sleep_new WHERE bind_user_id = #{id}) ) subquery
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
+8
-8
@@ -7,7 +7,7 @@
|
||||
bind_user_id,
|
||||
count( DISTINCT bind_user_id )
|
||||
FROM
|
||||
`watch_monitor_data`
|
||||
"watch_monitor_data"
|
||||
<where>
|
||||
<if test="startTime!=null">
|
||||
and warn_time >= #{startTime}
|
||||
@@ -23,7 +23,7 @@
|
||||
SELECT
|
||||
count(*)
|
||||
FROM
|
||||
`watch_monitor_data`
|
||||
"watch_monitor_data"
|
||||
<where>
|
||||
and org_code like concat(#{orgCode},'%')
|
||||
<if test="type != null">
|
||||
@@ -173,7 +173,7 @@
|
||||
) as day_count,
|
||||
(select count(0)
|
||||
from watch_monitor_data
|
||||
where yearweek(data_date,1) = yearweek(curdate(),1)
|
||||
where TO_CHAR(data_date,'IYYY-IW') = TO_CHAR(SYSDATE,'IYYY-IW')
|
||||
<if test="orgCodes != null and orgCodes.size() > 0">
|
||||
and
|
||||
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
||||
@@ -183,7 +183,7 @@
|
||||
) as week_count,
|
||||
(select count(0)
|
||||
from watch_monitor_data
|
||||
where date_format(data_date, '%Y-%m') = date_format(curdate(), '%Y-%m')
|
||||
where TO_CHAR(data_date, 'YYYY-MM') = TO_CHAR(SYSDATE, 'YYYY-MM')
|
||||
<if test="orgCodes != null and orgCodes.size() > 0">
|
||||
and
|
||||
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
||||
@@ -195,9 +195,9 @@
|
||||
</select>
|
||||
|
||||
<select id="monitorDayStats" resultType="com.renkang.watch.api.bean.response.MonitorDayStats">
|
||||
select data_date as date, year(data_date) as year, month(data_date) as month, dayofmonth(data_date) as day, count(0) as count
|
||||
select data_date as date, EXTRACT(YEAR FROM data_date) as year, EXTRACT(MONTH FROM data_date) as month, EXTRACT(DAY FROM data_date) as day, count(0) as count
|
||||
from watch_monitor_data
|
||||
where date_format(data_date, '%Y-%m') = date_format(#{monthDate,jdbcType=DATE}, '%Y-%m')
|
||||
where TO_CHAR(data_date, 'YYYY-MM') = TO_CHAR(#{monthDate,jdbcType=DATE}, 'YYYY-MM')
|
||||
<if test="orgCodes != null and orgCodes.size() > 0">
|
||||
and
|
||||
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
||||
@@ -214,7 +214,7 @@
|
||||
WHERE
|
||||
lon_gd IS NOT NULL
|
||||
AND lat_gd IS NOT NULL
|
||||
AND ifnull(address_gd, '') = ''
|
||||
limit 100
|
||||
AND NVL(address_gd, '') = ''
|
||||
WHERE ROWNUM <= 100
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
+108
-130
@@ -6,18 +6,18 @@
|
||||
SELECT
|
||||
id as id ,
|
||||
user_id as userId,
|
||||
max_value as `maxValue`,
|
||||
max_value as maxValue,
|
||||
min_value as minValue,
|
||||
avg_value as avgValue,
|
||||
silence_max_value as silenceMaxValue,
|
||||
silence_avg_value as silenceAvgValue,
|
||||
silence_min_value as silenceMinValue,
|
||||
data_date as dataDate,
|
||||
DATE_FORMAT( data_date, '%m' ) AS dateStr
|
||||
TO_CHAR( data_date, 'MM' ) AS dateStr
|
||||
FROM
|
||||
`watch_stat_user_info_day_heart_rate`
|
||||
watch_stat_user_info_day_heart_rate
|
||||
WHERE
|
||||
YEAR ( data_date )= #{dateYear}
|
||||
EXTRACT(YEAR FROM data_date) = #{dateYear}
|
||||
and
|
||||
user_id=#{userId}
|
||||
|
||||
@@ -76,33 +76,33 @@
|
||||
watch_stat_user_info_day_heart_rate a
|
||||
LEFT JOIN
|
||||
(SELECT DISTINCT bind_user_id FROM watch_monitor_data
|
||||
WHERE warn_time BETWEEN DATE_SUB(CURDATE(), INTERVAL
|
||||
WHERE warn_time BETWEEN
|
||||
<choose>
|
||||
<when test="type == 'day'">0 DAY</when>
|
||||
<when test="type == 'week'">7 DAY</when>
|
||||
<when test="type == 'month'">1 MONTH</when>
|
||||
<when test="type == 'year'">1 YEAR</when>
|
||||
<otherwise>0 DAY</otherwise>
|
||||
<when test="type == 'day'">TRUNC(SYSDATE)</when>
|
||||
<when test="type == 'week'">TRUNC(SYSDATE) - 7</when>
|
||||
<when test="type == 'month'">ADD_MONTHS(TRUNC(SYSDATE), -1)</when>
|
||||
<when test="type == 'year'">ADD_MONTHS(TRUNC(SYSDATE), -12)</when>
|
||||
<otherwise>TRUNC(SYSDATE)</otherwise>
|
||||
</choose>
|
||||
) AND CURDATE()
|
||||
AND SYSDATE
|
||||
AND event_type = 'heart_rate') b
|
||||
ON
|
||||
a.user_id = b.bind_user_id
|
||||
WHERE
|
||||
a.data_date BETWEEN DATE_SUB(CURDATE(), INTERVAL
|
||||
a.data_date BETWEEN
|
||||
<choose>
|
||||
<when test="type == 'day'">0 DAY</when>
|
||||
<when test="type == 'week'">7 DAY</when>
|
||||
<when test="type == 'month'">1 MONTH</when>
|
||||
<when test="type == 'year'">1 YEAR</when>
|
||||
<otherwise>0 DAY</otherwise>
|
||||
<when test="type == 'day'">TRUNC(SYSDATE)</when>
|
||||
<when test="type == 'week'">TRUNC(SYSDATE) - 7</when>
|
||||
<when test="type == 'month'">ADD_MONTHS(TRUNC(SYSDATE), -1)</when>
|
||||
<when test="type == 'year'">ADD_MONTHS(TRUNC(SYSDATE), -12)</when>
|
||||
<otherwise>TRUNC(SYSDATE)</otherwise>
|
||||
</choose>
|
||||
) AND CURDATE()
|
||||
AND SYSDATE
|
||||
<if test="orgCode != null and orgCode != ''">
|
||||
AND a.org_code like concat('%',#{orgCode},'%')
|
||||
</if>
|
||||
GROUP BY
|
||||
a.user_id;
|
||||
a.user_id
|
||||
</select>
|
||||
|
||||
<select id="selectSpoDataByOrgCode" parameterType="com.renkang.watch.dto.BigScreenDTO" resultType="com.renkang.watch.vo.WatchDataVo">
|
||||
@@ -124,33 +124,33 @@
|
||||
watch_stat_user_info_day_spo2 a
|
||||
LEFT JOIN
|
||||
(SELECT DISTINCT bind_user_id FROM watch_monitor_data
|
||||
WHERE warn_time BETWEEN DATE_SUB(CURDATE(), INTERVAL
|
||||
WHERE warn_time BETWEEN
|
||||
<choose>
|
||||
<when test="type == 'day'">0 DAY</when>
|
||||
<when test="type == 'week'">7 DAY</when>
|
||||
<when test="type == 'month'">1 MONTH</when>
|
||||
<when test="type == 'year'">1 YEAR</when>
|
||||
<otherwise>0 DAY</otherwise>
|
||||
<when test="type == 'day'">TRUNC(SYSDATE)</when>
|
||||
<when test="type == 'week'">TRUNC(SYSDATE) - 7</when>
|
||||
<when test="type == 'month'">ADD_MONTHS(TRUNC(SYSDATE), -1)</when>
|
||||
<when test="type == 'year'">ADD_MONTHS(TRUNC(SYSDATE), -12)</when>
|
||||
<otherwise>TRUNC(SYSDATE)</otherwise>
|
||||
</choose>
|
||||
) AND CURDATE()
|
||||
AND SYSDATE
|
||||
AND event_type = 'spo') b
|
||||
ON
|
||||
a.user_id = b.bind_user_id
|
||||
WHERE
|
||||
a.data_date BETWEEN DATE_SUB(CURDATE(), INTERVAL
|
||||
a.data_date BETWEEN
|
||||
<choose>
|
||||
<when test="type == 'day'">0 DAY</when>
|
||||
<when test="type == 'week'">7 DAY</when>
|
||||
<when test="type == 'month'">1 MONTH</when>
|
||||
<when test="type == 'year'">1 YEAR</when>
|
||||
<otherwise>0 DAY</otherwise>
|
||||
<when test="type == 'day'">TRUNC(SYSDATE)</when>
|
||||
<when test="type == 'week'">TRUNC(SYSDATE) - 7</when>
|
||||
<when test="type == 'month'">ADD_MONTHS(TRUNC(SYSDATE), -1)</when>
|
||||
<when test="type == 'year'">ADD_MONTHS(TRUNC(SYSDATE), -12)</when>
|
||||
<otherwise>TRUNC(SYSDATE)</otherwise>
|
||||
</choose>
|
||||
) AND CURDATE()
|
||||
AND SYSDATE
|
||||
<if test="orgCode != null and orgCode != ''">
|
||||
AND a.org_code like concat('%',#{orgCode},'%')
|
||||
</if>
|
||||
GROUP BY
|
||||
a.user_id;
|
||||
a.user_id
|
||||
</select>
|
||||
<select id="selectStressDataByOrgCode" resultType="com.renkang.watch.vo.WatchDataVo">
|
||||
SELECT
|
||||
@@ -171,33 +171,33 @@
|
||||
watch_stat_user_info_day_stress a
|
||||
LEFT JOIN
|
||||
(SELECT DISTINCT bind_user_id FROM watch_monitor_data
|
||||
WHERE warn_time BETWEEN DATE_SUB(CURDATE(), INTERVAL
|
||||
WHERE warn_time BETWEEN
|
||||
<choose>
|
||||
<when test="type == 'day'">0 DAY</when>
|
||||
<when test="type == 'week'">7 DAY</when>
|
||||
<when test="type == 'month'">1 MONTH</when>
|
||||
<when test="type == 'year'">1 YEAR</when>
|
||||
<otherwise>0 DAY</otherwise>
|
||||
<when test="type == 'day'">TRUNC(SYSDATE)</when>
|
||||
<when test="type == 'week'">TRUNC(SYSDATE) - 7</when>
|
||||
<when test="type == 'month'">ADD_MONTHS(TRUNC(SYSDATE), -1)</when>
|
||||
<when test="type == 'year'">ADD_MONTHS(TRUNC(SYSDATE), -12)</when>
|
||||
<otherwise>TRUNC(SYSDATE)</otherwise>
|
||||
</choose>
|
||||
) AND CURDATE()
|
||||
AND SYSDATE
|
||||
AND event_type = 'stress') b
|
||||
ON
|
||||
a.user_id = b.bind_user_id
|
||||
WHERE
|
||||
a.data_date BETWEEN DATE_SUB(CURDATE(), INTERVAL
|
||||
a.data_date BETWEEN
|
||||
<choose>
|
||||
<when test="type == 'day'">0 DAY</when>
|
||||
<when test="type == 'week'">7 DAY</when>
|
||||
<when test="type == 'month'">1 MONTH</when>
|
||||
<when test="type == 'year'">1 YEAR</when>
|
||||
<otherwise>0 DAY</otherwise>
|
||||
<when test="type == 'day'">TRUNC(SYSDATE)</when>
|
||||
<when test="type == 'week'">TRUNC(SYSDATE) - 7</when>
|
||||
<when test="type == 'month'">ADD_MONTHS(TRUNC(SYSDATE), -1)</when>
|
||||
<when test="type == 'year'">ADD_MONTHS(TRUNC(SYSDATE), -12)</when>
|
||||
<otherwise>TRUNC(SYSDATE)</otherwise>
|
||||
</choose>
|
||||
) AND CURDATE()
|
||||
AND SYSDATE
|
||||
<if test="orgCode != null and orgCode != ''">
|
||||
AND a.org_code like concat('%',#{orgCode},'%')
|
||||
</if>
|
||||
GROUP BY
|
||||
a.user_id;
|
||||
a.user_id
|
||||
</select>
|
||||
<select id="selectTempDataByOrgCode" resultType="com.renkang.watch.vo.WatchDataVo">
|
||||
SELECT
|
||||
@@ -218,33 +218,33 @@
|
||||
watch_stat_user_info_day_temp a
|
||||
LEFT JOIN
|
||||
(SELECT DISTINCT bind_user_id FROM watch_monitor_data
|
||||
WHERE warn_time BETWEEN DATE_SUB(CURDATE(), INTERVAL
|
||||
WHERE warn_time BETWEEN
|
||||
<choose>
|
||||
<when test="type == 'day'">0 DAY</when>
|
||||
<when test="type == 'week'">7 DAY</when>
|
||||
<when test="type == 'month'">1 MONTH</when>
|
||||
<when test="type == 'year'">1 YEAR</when>
|
||||
<otherwise>0 DAY</otherwise>
|
||||
<when test="type == 'day'">TRUNC(SYSDATE)</when>
|
||||
<when test="type == 'week'">TRUNC(SYSDATE) - 7</when>
|
||||
<when test="type == 'month'">ADD_MONTHS(TRUNC(SYSDATE), -1)</when>
|
||||
<when test="type == 'year'">ADD_MONTHS(TRUNC(SYSDATE), -12)</when>
|
||||
<otherwise>TRUNC(SYSDATE)</otherwise>
|
||||
</choose>
|
||||
) AND CURDATE()
|
||||
AND SYSDATE
|
||||
AND event_type = 'temp') b
|
||||
ON
|
||||
a.user_id = b.bind_user_id
|
||||
WHERE
|
||||
a.data_date BETWEEN DATE_SUB(CURDATE(), INTERVAL
|
||||
a.data_date BETWEEN
|
||||
<choose>
|
||||
<when test="type == 'day'">0 DAY</when>
|
||||
<when test="type == 'week'">7 DAY</when>
|
||||
<when test="type == 'month'">1 MONTH</when>
|
||||
<when test="type == 'year'">1 YEAR</when>
|
||||
<otherwise>0 DAY</otherwise>
|
||||
<when test="type == 'day'">TRUNC(SYSDATE)</when>
|
||||
<when test="type == 'week'">TRUNC(SYSDATE) - 7</when>
|
||||
<when test="type == 'month'">ADD_MONTHS(TRUNC(SYSDATE), -1)</when>
|
||||
<when test="type == 'year'">ADD_MONTHS(TRUNC(SYSDATE), -12)</when>
|
||||
<otherwise>TRUNC(SYSDATE)</otherwise>
|
||||
</choose>
|
||||
) AND CURDATE()
|
||||
AND SYSDATE
|
||||
<if test="orgCode != null and orgCode != ''">
|
||||
AND a.org_code like concat('%',#{orgCode},'%')
|
||||
</if>
|
||||
GROUP BY
|
||||
a.user_id;
|
||||
a.user_id
|
||||
</select>
|
||||
<select id="selectSdcDataByOrgCode" resultType="com.renkang.watch.vo.WatchDataVo">
|
||||
SELECT
|
||||
@@ -253,42 +253,22 @@
|
||||
FROM
|
||||
watch_stat_user_info_day_sdc a
|
||||
WHERE
|
||||
a.data_date BETWEEN DATE_SUB(CURDATE(), INTERVAL
|
||||
a.data_date BETWEEN
|
||||
<choose>
|
||||
<when test="type == 'day'">0 DAY</when>
|
||||
<when test="type == 'week'">7 DAY</when>
|
||||
<when test="type == 'month'">1 MONTH</when>
|
||||
<when test="type == 'year'">1 YEAR</when>
|
||||
<otherwise>0 DAY</otherwise>
|
||||
<when test="type == 'day'">TRUNC(SYSDATE)</when>
|
||||
<when test="type == 'week'">TRUNC(SYSDATE) - 7</when>
|
||||
<when test="type == 'month'">ADD_MONTHS(TRUNC(SYSDATE), -1)</when>
|
||||
<when test="type == 'year'">ADD_MONTHS(TRUNC(SYSDATE), -12)</when>
|
||||
<otherwise>TRUNC(SYSDATE)</otherwise>
|
||||
</choose>
|
||||
) AND CURDATE()
|
||||
AND SYSDATE
|
||||
<if test="orgCode != null and orgCode != ''">
|
||||
AND a.org_code like concat('%',#{orgCode},'%')
|
||||
</if>
|
||||
GROUP BY
|
||||
a.user_id;
|
||||
a.user_id
|
||||
</select>
|
||||
<select id="selectSleepDataByOrgCode" resultType="com.renkang.watch.vo.BigScreenSleepVo">
|
||||
<!-- SELECT
|
||||
data_date,
|
||||
SUM(long_count) AS long_count,
|
||||
SUM(long_duration_total) AS long_duration,
|
||||
SUM(short_count) AS short_count,
|
||||
SUM(short_duration_total) AS short_duration,
|
||||
AVG(sleep_avg) AS average_duration,
|
||||
SUM(long_duration_total) + SUM(short_duration_total) AS sleep_duration,
|
||||
(COUNT(DISTINCT user_id) * 1440) - (SUM(long_duration_total) + SUM(short_duration_total)) AS awake_duration -->
|
||||
|
||||
<!-- SELECT
|
||||
data_date,
|
||||
SUM(COALESCE(deep_sleep_times, 0)) AS long_duration,
|
||||
SUM(COALESCE(light_sleep_times, 0)) AS short_duration,
|
||||
AVG(COALESCE(deep_sleep_times, 0) + COALESCE(light_sleep_times, 0)) AS average_duration,
|
||||
AVG(COALESCE(light_sleep_times, 0)) AS avg_short_duration,
|
||||
AVG(COALESCE(deep_sleep_times, 0)) AS avg_long_duration,
|
||||
SUM(COALESCE(deep_sleep_times, 0)) + SUM(COALESCE(light_sleep_times, 0)) AS sleep_duration
|
||||
上面这个是正常按照数据库取值的 但是 说深睡浅睡反了 下面的是反着取值的 待排查问题原因-->
|
||||
|
||||
SELECT
|
||||
data_date,
|
||||
SUM(COALESCE(light_sleep_times, 0)) AS long_duration,
|
||||
@@ -300,22 +280,22 @@
|
||||
FROM
|
||||
watch_stat_user_info_day_sleep
|
||||
WHERE
|
||||
data_date BETWEEN DATE_SUB(CURDATE(), INTERVAL
|
||||
data_date BETWEEN
|
||||
<choose>
|
||||
<when test="type == 'day'">0 DAY</when>
|
||||
<when test="type == 'week'">7 DAY</when>
|
||||
<when test="type == 'month'">1 MONTH</when>
|
||||
<when test="type == 'year'">1 YEAR</when>
|
||||
<otherwise>0 DAY</otherwise>
|
||||
<when test="type == 'day'">TRUNC(SYSDATE)</when>
|
||||
<when test="type == 'week'">TRUNC(SYSDATE) - 7</when>
|
||||
<when test="type == 'month'">ADD_MONTHS(TRUNC(SYSDATE), -1)</when>
|
||||
<when test="type == 'year'">ADD_MONTHS(TRUNC(SYSDATE), -12)</when>
|
||||
<otherwise>TRUNC(SYSDATE)</otherwise>
|
||||
</choose>
|
||||
) AND CURDATE()
|
||||
AND SYSDATE
|
||||
<if test="orgCode != null and orgCode != ''">
|
||||
AND org_code like concat('%',#{orgCode},'%')
|
||||
</if>
|
||||
GROUP BY
|
||||
data_date
|
||||
ORDER BY
|
||||
data_date DESC;
|
||||
data_date DESC
|
||||
</select>
|
||||
<select id="findUserNewDataByUserIds" resultType="com.renkang.watch.entity.WatchStatUserInfoDayHeartRate">
|
||||
SELECT
|
||||
@@ -331,22 +311,21 @@
|
||||
</foreach>
|
||||
GROUP BY user_id ) temp
|
||||
ON wsd.user_id = temp.user_id
|
||||
AND wsd.data_date = temp.latest_date;
|
||||
AND wsd.data_date = temp.latest_date
|
||||
</select>
|
||||
|
||||
<!-- 切记 此代码不能直接平移至四合一项目 ,该sql只适用mysql8.0及以上版本 ,四合一项目开发测试环境的mysql版本过低 , 但不影响正式环境-->
|
||||
<insert id="insertStat">
|
||||
INSERT INTO watch_stat_user_info_day_heart_rate ( id, user_id, max_value, min_value, avg_value, silence_max_value, silence_min_value, silence_avg_value, last_upload_time, new_value, silence_new_value, data_date, org_code ) (
|
||||
INSERT INTO watch_stat_user_info_day_heart_rate ( id, user_id, max_value, min_value, avg_value, silence_max_value, silence_min_value, silence_avg_value, last_upload_time, new_value, silence_new_value, data_date, org_code )
|
||||
SELECT
|
||||
#{id,jdbcType=VARCHAR},
|
||||
bind_user_id,
|
||||
IFNULL( MAX( wd.data_value ), 0 ),
|
||||
IFNULL( MIN( wd.data_value ), 0 ),
|
||||
IFNULL( AVG( wd.data_value ), 0 ),
|
||||
IFNULL( MAX( wd.silence_value ), 0 ),
|
||||
IFNULL( MIN( wd.silence_value ), 0 ),
|
||||
IFNULL( AVG( wd.silence_value ), 0 ),
|
||||
IFNULL(MAX( wd.time_stamp ),NOW()),
|
||||
NVL( MAX( wd.data_value ), 0 ),
|
||||
NVL( MIN( wd.data_value ), 0 ),
|
||||
NVL( AVG( wd.data_value ), 0 ),
|
||||
NVL( MAX( wd.silence_value ), 0 ),
|
||||
NVL( MIN( wd.silence_value ), 0 ),
|
||||
NVL( AVG( wd.silence_value ), 0 ),
|
||||
NVL(MAX( wd.time_stamp ),SYSDATE),
|
||||
MAX( CASE WHEN wd.rn = 1 THEN wd.data_value END ),
|
||||
MAX( CASE WHEN wd.rn = 1 THEN wd.silence_value END ),
|
||||
data_date,
|
||||
@@ -354,10 +333,10 @@
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
*,
|
||||
t.*,
|
||||
ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||
FROM
|
||||
watch_data_heart_rate
|
||||
watch_data_heart_rate t
|
||||
WHERE
|
||||
bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}
|
||||
@@ -365,34 +344,35 @@
|
||||
GROUP BY
|
||||
wd.bind_user_id,
|
||||
wd.data_date
|
||||
);
|
||||
</insert>
|
||||
|
||||
<!-- 切记 此代码不能直接平移至四合一项目 ,该sql只适用mysql8.0及以上版本 ,四合一项目开发测试环境的mysql版本过低 , 但不影响正式环境-->
|
||||
<!-- MySQL 的 UPDATE ... LEFT JOIN ... SET 语法已改写为达梦兼容的 MERGE INTO -->
|
||||
<update id="updateStat">
|
||||
UPDATE watch_stat_user_info_day_heart_rate stat
|
||||
LEFT JOIN (
|
||||
MERGE INTO watch_stat_user_info_day_heart_rate stat
|
||||
USING (
|
||||
SELECT
|
||||
wd.bind_user_id,
|
||||
wd.data_date,
|
||||
IFNULL( MAX( wd.data_value ), 0 ) AS max_value,
|
||||
IFNULL( MIN( wd.data_value ), 0 ) AS min_value,
|
||||
IFNULL( AVG( wd.data_value ), 0 ) AS avg_value,
|
||||
IFNULL( MAX( wd.silence_value ), 0 ) AS silence_max_value,
|
||||
IFNULL( MIN( wd.silence_value ), 0 ) AS silence_min_value,
|
||||
IFNULL( AVG( wd.silence_value ), 0 ) AS silence_avg_value,
|
||||
IFNULL(MAX( wd.time_stamp ),NOW()) AS last_upload_time,
|
||||
NVL( MAX( wd.data_value ), 0 ) AS max_value,
|
||||
NVL( MIN( wd.data_value ), 0 ) AS min_value,
|
||||
NVL( AVG( wd.data_value ), 0 ) AS avg_value,
|
||||
NVL( MAX( wd.silence_value ), 0 ) AS silence_max_value,
|
||||
NVL( MIN( wd.silence_value ), 0 ) AS silence_min_value,
|
||||
NVL( AVG( wd.silence_value ), 0 ) AS silence_avg_value,
|
||||
NVL(MAX( wd.time_stamp ),SYSDATE) AS last_upload_time,
|
||||
MAX( CASE WHEN wd.rn = 1 THEN wd.data_value END ) AS new_value,
|
||||
MAX( CASE WHEN wd.rn = 1 THEN wd.silence_value END ) AS silence_new_value
|
||||
FROM
|
||||
( SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn FROM watch_data_heart_rate where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE} ) wd
|
||||
( SELECT t.*, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||
FROM watch_data_heart_rate t
|
||||
WHERE bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
AND data_date = #{dataDate,jdbcType=DATE} ) wd
|
||||
GROUP BY
|
||||
wd.bind_user_id,
|
||||
wd.data_date
|
||||
) DATA ON stat.user_id = DATA.bind_user_id
|
||||
AND stat.data_date = DATA.data_date
|
||||
SET stat.max_value = DATA.max_value,
|
||||
) DATA ON (stat.user_id = DATA.bind_user_id AND stat.data_date = DATA.data_date)
|
||||
WHEN MATCHED THEN UPDATE SET
|
||||
stat.max_value = DATA.max_value,
|
||||
stat.min_value = DATA.min_value,
|
||||
stat.avg_value = DATA.avg_value,
|
||||
stat.silence_max_value = DATA.silence_max_value,
|
||||
@@ -402,7 +382,5 @@
|
||||
stat.new_value = DATA.new_value,
|
||||
stat.silence_new_value = COALESCE ( NULLIF( DATA.silence_new_value, 0 ), stat.silence_new_value ),
|
||||
stat.org_code = #{orgCode,jdbcType=VARCHAR}
|
||||
where stat.user_id = #{userId,jdbcType=VARCHAR}
|
||||
and stat.data_date = #{dataDate,jdbcType=DATE};
|
||||
</update>
|
||||
</mapper>
|
||||
+40
-47
@@ -6,15 +6,15 @@
|
||||
SELECT
|
||||
id as id ,
|
||||
user_id as userId,
|
||||
step_value as `stepValue`,
|
||||
step_value as "stepValue",
|
||||
distance_value as distanceValue,
|
||||
calorie_value as calorieValue,
|
||||
data_date as dataDate,
|
||||
DATE_FORMAT( data_date, '%m' ) AS dateStr
|
||||
TO_CHAR( data_date, 'MM' ) AS dateStr
|
||||
FROM
|
||||
`watch_stat_user_info_day_sdc`
|
||||
"watch_stat_user_info_day_sdc"
|
||||
WHERE
|
||||
YEAR ( data_date )= #{dateYear}
|
||||
EXTRACT(YEAR FROM data_date) = #{dateYear}
|
||||
and
|
||||
user_id=#{userId}
|
||||
</select>
|
||||
@@ -22,14 +22,14 @@
|
||||
SELECT
|
||||
id as id ,
|
||||
user_id as userId,
|
||||
step_value as `stepValue`,
|
||||
step_value as "stepValue",
|
||||
distance_value as distanceValue,
|
||||
calorie_value as calorieValue,
|
||||
data_date as dataDate
|
||||
FROM
|
||||
`watch_stat_user_info_day_sdc`
|
||||
"watch_stat_user_info_day_sdc"
|
||||
WHERE
|
||||
YEAR ( data_date )= #{req.dateYear}
|
||||
EXTRACT(YEAR FROM data_date) = #{req.dateYear}
|
||||
and
|
||||
user_id=#{req.userId}
|
||||
order by data_date desc
|
||||
@@ -170,26 +170,26 @@
|
||||
(select #{id,jdbcType=VARCHAR},
|
||||
#{userId,jdbcType=VARCHAR},
|
||||
(select max(data_value)
|
||||
from watch_data_steps force index (bind_user_id)
|
||||
from (select data_value, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id ORDER BY data_date desc) as rn
|
||||
from watch_data_steps
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}
|
||||
group by data_date
|
||||
order by data_date desc
|
||||
limit 1) as step_value,
|
||||
and data_date = #{dataDate,jdbcType=DATE})
|
||||
where rn = 1) as step_value,
|
||||
(select max(data_value)
|
||||
from watch_data_distance force index (bind_user_id)
|
||||
from (select data_value, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id ORDER BY data_date desc) as rn
|
||||
from watch_data_distance
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}
|
||||
group by data_date
|
||||
order by data_date desc
|
||||
limit 1) as distance_value,
|
||||
and data_date = #{dataDate,jdbcType=DATE})
|
||||
where rn = 1) as distance_value,
|
||||
(select max(data_value)
|
||||
from watch_data_calorie force index (bind_user_id)
|
||||
from (select data_value, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id ORDER BY data_date desc) as rn
|
||||
from watch_data_calorie
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}
|
||||
group by data_date
|
||||
order by data_date desc
|
||||
limit 1) as calorie_value,
|
||||
and data_date = #{dataDate,jdbcType=DATE})
|
||||
where rn = 1) as calorie_value,
|
||||
#{lastUploadTime,jdbcType=TIMESTAMP},
|
||||
#{dataDate,jdbcType=DATE},
|
||||
#{orgCode,jdbcType=VARCHAR}
|
||||
@@ -198,34 +198,27 @@
|
||||
|
||||
<update id="updateStat">
|
||||
update watch_stat_user_info_day_sdc stat
|
||||
left join (select #{userId,jdbcType=VARCHAR} as bind_user_id,
|
||||
(select max(data_value)
|
||||
from watch_data_steps force index (bind_user_id)
|
||||
set stat.step_value = (select max(data_value)
|
||||
from (select data_value, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id ORDER BY data_date desc) as rn
|
||||
from watch_data_steps
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}
|
||||
group by data_date
|
||||
order by data_date desc
|
||||
limit 1) as step_value,
|
||||
(select max(data_value)
|
||||
from watch_data_distance force index (bind_user_id)
|
||||
and data_date = #{dataDate,jdbcType=DATE})
|
||||
where rn = 1),
|
||||
stat.distance_value = (select max(data_value)
|
||||
from (select data_value, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id ORDER BY data_date desc) as rn
|
||||
from watch_data_distance
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}
|
||||
group by data_date
|
||||
order by data_date desc
|
||||
limit 1) as distance_value,
|
||||
(select max(data_value)
|
||||
from watch_data_calorie force index (bind_user_id)
|
||||
and data_date = #{dataDate,jdbcType=DATE})
|
||||
where rn = 1),
|
||||
stat.calorie_value = (select max(data_value)
|
||||
from (select data_value, data_date,
|
||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id ORDER BY data_date desc) as rn
|
||||
from watch_data_calorie
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}
|
||||
group by data_date
|
||||
order by data_date desc
|
||||
limit 1) as calorie_value,
|
||||
#{lastUploadTime,jdbcType=TIMESTAMP} as last_upload_time,
|
||||
#{dataDate,jdbcType=DATE} as data_date
|
||||
from dual) data on stat.user_id = data.bind_user_id
|
||||
set stat.step_value = data.step_value,
|
||||
stat.distance_value = data.distance_value,
|
||||
stat.calorie_value = data.calorie_value,
|
||||
and data_date = #{dataDate,jdbcType=DATE})
|
||||
where rn = 1),
|
||||
stat.last_upload_time = #{lastUploadTime,jdbcType=TIMESTAMP},
|
||||
stat.org_code = #{orgCode,jdbcType=VARCHAR}
|
||||
where stat.user_id = #{userId,jdbcType=VARCHAR}
|
||||
|
||||
+4
-4
@@ -6,7 +6,7 @@
|
||||
SELECT
|
||||
id as id ,
|
||||
user_id as userId,
|
||||
sleep_avg as `sleepAvg`,
|
||||
sleep_avg as "sleepAvg",
|
||||
long_duration_avg as longDurationAvg,
|
||||
short_duration_avg as shortDurationAvg,
|
||||
long_duration_max as longDurationMax,
|
||||
@@ -16,11 +16,11 @@
|
||||
deep_sleep_times as deepSleepTimes,
|
||||
light_sleep_times as lightSleepTimes,
|
||||
data_date as dataDate,
|
||||
DATE_FORMAT( data_date, '%m' ) AS dateStr
|
||||
TO_CHAR( data_date, 'MM' ) AS dateStr
|
||||
FROM
|
||||
`watch_stat_user_info_day_sleep`
|
||||
"watch_stat_user_info_day_sleep"
|
||||
WHERE
|
||||
YEAR ( data_date )= #{dateYear}
|
||||
EXTRACT(YEAR FROM data_date) = #{dateYear}
|
||||
and
|
||||
user_id=#{userId}
|
||||
</select>
|
||||
|
||||
+37
-29
@@ -6,15 +6,15 @@
|
||||
SELECT
|
||||
id as id ,
|
||||
user_id as userId,
|
||||
max_value as `maxValue`,
|
||||
max_value as "maxValue",
|
||||
min_value as minValue,
|
||||
avg_value as avgValue,
|
||||
data_date as dataDate,
|
||||
DATE_FORMAT( data_date, '%m' ) AS dateStr
|
||||
TO_CHAR( data_date, 'MM' ) AS dateStr
|
||||
FROM
|
||||
`watch_stat_user_info_day_spo2`
|
||||
"watch_stat_user_info_day_spo2"
|
||||
WHERE
|
||||
YEAR ( data_date )= #{dateYear}
|
||||
EXTRACT(YEAR FROM data_date) = #{dateYear}
|
||||
and
|
||||
user_id=#{userId}
|
||||
|
||||
@@ -42,10 +42,10 @@
|
||||
new_value, data_date, org_code)
|
||||
(SELECT #{id,jdbcType=VARCHAR},
|
||||
bind_user_id,
|
||||
IFNULL(MAX(wd.data_value), 0),
|
||||
IFNULL(MIN(wd.data_value), 0),
|
||||
IFNULL(AVG(wd.data_value), 0),
|
||||
IFNULL(MAX(wd.time_stamp), 0),
|
||||
NVL(MAX(wd.data_value), 0),
|
||||
NVL(MIN(wd.data_value), 0),
|
||||
NVL(AVG(wd.data_value), 0),
|
||||
NVL(MAX(wd.time_stamp), TO_TIMESTAMP('1970-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS')),
|
||||
MAX(CASE WHEN wd.rn = 1 THEN wd.data_value END),
|
||||
data_date,
|
||||
#{orgCode,jdbcType=VARCHAR}
|
||||
@@ -60,28 +60,36 @@
|
||||
<!-- 切记 此代码不能直接平移至四合一项目 ,该 sql 只适用 mysql8.0 及以上版本 ,四合一项目开发测试环境的 mysql 版本过低 , 但不影响正式环境-->
|
||||
<update id="updateStat">
|
||||
UPDATE watch_stat_user_info_day_spo2 stat
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
wd.bind_user_id,
|
||||
wd.data_date,
|
||||
IFNULL( MAX( wd.data_value ), 0 ) AS max_value,
|
||||
IFNULL( MIN( wd.data_value ), 0 ) AS min_value,
|
||||
IFNULL( AVG( wd.data_value ), 0 ) AS avg_value,
|
||||
IFNULL( MAX( wd.time_stamp ), 0 ) AS last_upload_time,
|
||||
MAX( CASE WHEN wd.rn = 1 THEN wd.data_value END ) AS new_value
|
||||
FROM
|
||||
( SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn FROM watch_data_spo2 where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
SET stat.max_value = (SELECT NVL(MAX(wd.data_value), 0) AS max_value
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||
FROM watch_data_spo2
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY
|
||||
wd.bind_user_id,
|
||||
wd.data_date
|
||||
) DATA ON stat.user_id = DATA.bind_user_id
|
||||
AND stat.data_date = DATA.data_date
|
||||
SET stat.max_value = DATA.max_value,
|
||||
stat.min_value = DATA.min_value,
|
||||
stat.avg_value = DATA.avg_value,
|
||||
stat.last_upload_time = DATA.last_upload_time,
|
||||
stat.new_value = DATA.new_value,
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.min_value = (SELECT NVL(MIN(wd.data_value), 0) AS min_value
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||
FROM watch_data_spo2
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.avg_value = (SELECT NVL(AVG(wd.data_value), 0) AS avg_value
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||
FROM watch_data_spo2
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.last_upload_time = (SELECT NVL(MAX(wd.time_stamp), TO_TIMESTAMP('1970-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS'))
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||
FROM watch_data_spo2
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.new_value = (SELECT MAX(CASE WHEN wd.rn = 1 THEN wd.data_value END)
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||
FROM watch_data_spo2
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.org_code = #{orgCode,jdbcType=VARCHAR}
|
||||
where stat.user_id = #{userId,jdbcType=VARCHAR}
|
||||
and stat.data_date = #{dataDate,jdbcType=DATE};
|
||||
|
||||
+36
-29
@@ -6,15 +6,15 @@
|
||||
SELECT
|
||||
id as id ,
|
||||
user_id as userId,
|
||||
max_value as `maxValue`,
|
||||
max_value as "maxValue",
|
||||
min_value as minValue,
|
||||
avg_value as avgValue,
|
||||
data_date as dataDate,
|
||||
DATE_FORMAT( data_date, '%m' ) AS dateStr
|
||||
TO_CHAR( data_date, 'MM' ) AS dateStr
|
||||
FROM
|
||||
`watch_stat_user_info_day_stress`
|
||||
"watch_stat_user_info_day_stress"
|
||||
WHERE
|
||||
YEAR ( data_date )= #{dateYear}
|
||||
EXTRACT(YEAR FROM data_date) = #{dateYear}
|
||||
and
|
||||
user_id=#{userId}
|
||||
</select>
|
||||
@@ -26,11 +26,11 @@
|
||||
SELECT
|
||||
#{id,jdbcType=VARCHAR},
|
||||
bind_user_id,
|
||||
IFNULL( MAX( wd.data_value ), 0 ),
|
||||
IFNULL( MIN( wd.data_value ), 0 ),
|
||||
IFNULL( AVG( wd.data_value ), 0 ),
|
||||
NVL(MAX(wd.data_value), 0),
|
||||
NVL(MIN(wd.data_value), 0),
|
||||
NVL(AVG(wd.data_value), 0),
|
||||
data_date,
|
||||
IFNULL(MAX( wd.end_time_stamp ),NOW()),
|
||||
NVL(MAX(wd.end_time_stamp), SYSDATE),
|
||||
MAX(CASE WHEN wd.rn = 1 THEN wd.data_value END),
|
||||
#{orgCode,jdbcType=VARCHAR}
|
||||
FROM
|
||||
@@ -46,29 +46,36 @@
|
||||
<!-- 切记 此代码不能直接平移至四合一项目 ,该 sql 只适用 mysql8.0 及以上版本 ,四合一项目开发测试环境的 mysql 版本过低 , 但不影响正式环境-->
|
||||
<update id="updateStat">
|
||||
UPDATE watch_stat_user_info_day_stress stat
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
wd.bind_user_id,
|
||||
wd.data_date,
|
||||
IFNULL( MAX( wd.data_value ), 0 ) AS max_value,
|
||||
IFNULL( MIN( wd.data_value ), 0 ) AS min_value,
|
||||
IFNULL( AVG( wd.data_value ), 0 ) AS avg_value,
|
||||
IFNULL(MAX( wd.end_time_stamp ),NOW()) AS last_upload_time,
|
||||
MAX( CASE WHEN wd.rn = 1 THEN wd.data_value END ) AS new_value
|
||||
FROM
|
||||
( SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY end_time_stamp DESC ) AS rn FROM watch_data_stress
|
||||
SET stat.max_value = (SELECT NVL(MAX(wd.data_value), 0)
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY end_time_stamp DESC ) AS rn
|
||||
FROM watch_data_stress
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY
|
||||
wd.bind_user_id,
|
||||
wd.data_date
|
||||
) DATA ON stat.user_id = DATA.bind_user_id
|
||||
AND stat.data_date = DATA.data_date
|
||||
SET stat.max_value = DATA.max_value,
|
||||
stat.min_value = DATA.min_value,
|
||||
stat.avg_value = DATA.avg_value,
|
||||
stat.last_upload_time = DATA.last_upload_time,
|
||||
stat.new_value = DATA.new_value,
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.min_value = (SELECT NVL(MIN(wd.data_value), 0)
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY end_time_stamp DESC ) AS rn
|
||||
FROM watch_data_stress
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.avg_value = (SELECT NVL(AVG(wd.data_value), 0)
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY end_time_stamp DESC ) AS rn
|
||||
FROM watch_data_stress
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.last_upload_time = (SELECT NVL(MAX(wd.end_time_stamp), SYSDATE)
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY end_time_stamp DESC ) AS rn
|
||||
FROM watch_data_stress
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.new_value = (SELECT MAX(CASE WHEN wd.rn = 1 THEN wd.data_value END)
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY end_time_stamp DESC ) AS rn
|
||||
FROM watch_data_stress
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.org_code = #{orgCode,jdbcType=VARCHAR}
|
||||
where stat.user_id = #{userId,jdbcType=VARCHAR}
|
||||
and stat.data_date = #{dataDate,jdbcType=DATE};
|
||||
|
||||
+64
-44
@@ -7,16 +7,16 @@
|
||||
SELECT
|
||||
id as id ,
|
||||
user_id as userId,
|
||||
max_value as `maxValueB`,
|
||||
max_value as maxValueB,
|
||||
min_value as minValueB,
|
||||
avg_value as avgValueB,
|
||||
skin_max_value as skinMaxValueB,
|
||||
skin_min_value as skinMinValueB,
|
||||
skin_avg_value as skinAvgValueB,
|
||||
data_date as dataDate,
|
||||
DATE_FORMAT( data_date, '%m' ) AS dateStr
|
||||
TO_CHAR( data_date, 'MM' ) AS dateStr
|
||||
FROM
|
||||
`watch_stat_user_info_day_temp`
|
||||
watch_stat_user_info_day_temp
|
||||
WHERE
|
||||
YEAR ( data_date )= #{dateYear}
|
||||
and
|
||||
@@ -36,18 +36,17 @@
|
||||
|
||||
<!-- 切记 此代码不能直接平移至四合一项目 ,该 sql 只适用 mysql8.0 及以上版本 ,四合一项目开发测试环境的 mysql 版本过低 , 但不影响正式环境-->
|
||||
<insert id="insertStat">
|
||||
insert into watch_stat_user_info_day_temp(id, user_id, max_value, min_value, avg_value, skin_max_value,
|
||||
skin_min_value, skin_avg_value, last_upload_time, new_value,
|
||||
skin_new_value, data_date, org_code)
|
||||
insert into watch_stat_user_info_day_temp(id, user_id, max_value, min_value, avg_value, skin_max_value, skin_min_value,
|
||||
skin_avg_value, last_upload_time, new_value, skin_new_value, data_date, org_code)
|
||||
(SELECT #{id,jdbcType=VARCHAR},
|
||||
bind_user_id,
|
||||
IFNULL(MAX(wd.data_value), 0),
|
||||
IFNULL(MIN(wd.data_value), 0),
|
||||
IFNULL(AVG(wd.data_value), 0),
|
||||
IFNULL(MAX(wd.skin_tempera), 0),
|
||||
IFNULL(MIN(wd.skin_tempera), 0),
|
||||
IFNULL(AVG(wd.skin_tempera), 0),
|
||||
IFNULL(MAX(wd.time_stamp), NOW()),
|
||||
NVL(MAX(wd.data_value), 0),
|
||||
NVL(MIN(wd.data_value), 0),
|
||||
NVL(AVG(wd.data_value), 0),
|
||||
NVL(MAX(wd.skin_tempera), 0),
|
||||
NVL(MIN(wd.skin_tempera), 0),
|
||||
NVL(AVG(wd.skin_tempera), 0),
|
||||
NVL(MAX(wd.time_stamp), SYSDATE),
|
||||
MAX(CASE WHEN wd.rn = 1 THEN wd.data_value END),
|
||||
MAX(CASE WHEN wd.rn = 1 THEN wd.skin_tempera END),
|
||||
data_date,
|
||||
@@ -63,39 +62,60 @@
|
||||
<!-- 切记 此代码不能直接平移至四合一项目 ,该 sql 只适用 mysql8.0 及以上版本 ,四合一项目开发测试环境的 mysql 版本过低 , 但不影响正式环境-->
|
||||
<update id="updateStat">
|
||||
UPDATE watch_stat_user_info_day_temp stat
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
wd.bind_user_id,
|
||||
wd.data_date,
|
||||
IFNULL( MAX( wd.data_value ), 0 ) AS max_value,
|
||||
IFNULL( MIN( wd.data_value ), 0 ) AS min_value,
|
||||
IFNULL( AVG( wd.data_value ), 0 ) AS avg_value,
|
||||
IFNULL( MAX( wd.skin_tempera ), 0 ) AS skin_max_value,
|
||||
IFNULL( MIN( wd.skin_tempera ), 0 ) AS skin_min_value,
|
||||
IFNULL( AVG( wd.skin_tempera ), 0 ) AS skin_avg_value,
|
||||
IFNULL(
|
||||
MAX( wd.time_stamp ),
|
||||
NOW()) AS last_upload_time,
|
||||
MAX( CASE WHEN wd.rn = 1 THEN wd.data_value END ) AS new_value,
|
||||
MAX( CASE WHEN wd.rn = 1 THEN wd.skin_tempera END ) AS skin_new_value
|
||||
FROM
|
||||
( SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn FROM watch_data_temperature
|
||||
SET stat.max_value = (SELECT NVL(MAX(wd.data_value), 0)
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||
FROM watch_data_temperature
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY
|
||||
wd.bind_user_id,
|
||||
wd.data_date
|
||||
) DATA ON stat.user_id = DATA.bind_user_id
|
||||
AND stat.data_date = DATA.data_date
|
||||
SET stat.max_value = DATA.max_value,
|
||||
stat.min_value = DATA.min_value,
|
||||
stat.avg_value = DATA.avg_value,
|
||||
stat.skin_max_value = DATA.skin_max_value,
|
||||
stat.skin_min_value = DATA.skin_min_value,
|
||||
stat.skin_avg_value = DATA.skin_avg_value,
|
||||
stat.last_upload_time = DATA.last_upload_time,
|
||||
stat.new_value = DATA.new_value,
|
||||
stat.skin_new_value = COALESCE ( NULLIF( DATA.skin_new_value, 0 ), stat.skin_new_value ),
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.min_value = (SELECT NVL(MIN(wd.data_value), 0)
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||
FROM watch_data_temperature
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.avg_value = (SELECT NVL(AVG(wd.data_value), 0)
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||
FROM watch_data_temperature
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.skin_max_value = (SELECT NVL(MAX(wd.skin_tempera), 0)
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||
FROM watch_data_temperature
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.skin_min_value = (SELECT NVL(MIN(wd.skin_tempera), 0)
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||
FROM watch_data_temperature
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.skin_avg_value = (SELECT NVL(AVG(wd.skin_tempera), 0)
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||
FROM watch_data_temperature
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.last_upload_time = (SELECT NVL(MAX(wd.time_stamp), SYSDATE)
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||
FROM watch_data_temperature
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.new_value = (SELECT MAX(CASE WHEN wd.rn = 1 THEN wd.data_value END)
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||
FROM watch_data_temperature
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.skin_new_value = (SELECT NVL(MAX(CASE WHEN wd.rn = 1 THEN wd.skin_tempera END), stat.skin_new_value)
|
||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||
FROM watch_data_temperature
|
||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||
GROUP BY wd.bind_user_id, wd.data_date),
|
||||
stat.org_code = #{orgCode,jdbcType=VARCHAR}
|
||||
where stat.user_id = #{userId,jdbcType=VARCHAR}
|
||||
and stat.data_date = #{dataDate,jdbcType=DATE};
|
||||
|
||||
+4
-4
@@ -79,24 +79,24 @@
|
||||
|
||||
<select id="distanceMap" resultType="java.util.Map">
|
||||
select data_value dateValue,
|
||||
DATE_FORMAT(sdc_date, '%Y-%m-%d') sdcDate
|
||||
TO_CHAR(sdc_date, 'YYYY-MM-DD') sdcDate
|
||||
from watch_data_distance
|
||||
WHERE sdc_date BETWEEN #{date1} AND #{date2}
|
||||
</select>
|
||||
<select id="heartRateMap" resultType="java.util.Map">
|
||||
select data_value dateValue
|
||||
from watch_data_heart_rate
|
||||
WHERE DATE_FORMAT(data_date, '%Y-%m-%d') = #{queryDateStr}
|
||||
WHERE TO_CHAR(data_date, 'YYYY-MM-DD') = #{queryDateStr}
|
||||
</select>
|
||||
<select id="spo2Map" resultType="java.util.Map">
|
||||
select data_value dateValue
|
||||
from watch_data_spo2
|
||||
WHERE DATE_FORMAT(data_date, '%Y-%m-%d') = #{queryDateStr}
|
||||
WHERE TO_CHAR(data_date, 'YYYY-MM-DD') = #{queryDateStr}
|
||||
</select>
|
||||
<select id="stressMap" resultType="java.util.Map">
|
||||
select data_value dateValue
|
||||
from watch_data_stress
|
||||
WHERE DATE_FORMAT(data_date, '%Y-%m-%d') = #{queryDateStr}
|
||||
WHERE TO_CHAR(data_date, 'YYYY-MM-DD') = #{queryDateStr}
|
||||
</select>
|
||||
<select id="getUserDataByWeekly" resultType="java.util.Map">
|
||||
SELECT 'heart_rate' AS metric, AVG(avg_value) AS value
|
||||
|
||||
+6
-3
@@ -158,7 +158,7 @@ public class WatchBindHisServiceImpl extends ServiceImpl<WatchBindHisMapper, Wat
|
||||
.le(WatchBindHis::getBindDate, bindDate)
|
||||
.isNull(WatchBindHis::getBindEndDate)
|
||||
.orderByDesc(WatchBindHis::getBindDate)
|
||||
.last("LIMIT 1"));
|
||||
.last("FETCH FIRST 1 ROWS ONLY"));
|
||||
if (watchBindHis != null) {
|
||||
return watchBindHis.getBindUserId();
|
||||
}
|
||||
@@ -167,8 +167,11 @@ public class WatchBindHisServiceImpl extends ServiceImpl<WatchBindHisMapper, Wat
|
||||
|
||||
@Override
|
||||
public String getWatchNo(String bindUserId, Date bindDate) {
|
||||
WatchBindHis watchBindHis = getOne(new LambdaQueryWrapper<WatchBindHis>().eq(WatchBindHis::getBindUserId, bindUserId)
|
||||
.eq(WatchBindHis::getBindDate, bindDate).orderByDesc(WatchBindHis::getBindDate).last("LIMIT 1"));
|
||||
WatchBindHis watchBindHis = getOne(new LambdaQueryWrapper<WatchBindHis>()
|
||||
.eq(WatchBindHis::getBindUserId, bindUserId)
|
||||
.eq(WatchBindHis::getBindDate, bindDate)
|
||||
.orderByDesc(WatchBindHis::getBindDate)
|
||||
.last("FETCH FIRST 1 ROWS ONLY"));
|
||||
if (watchBindHis != null) {
|
||||
return watchBindHis.getWatchNo();
|
||||
}
|
||||
|
||||
+1
-1
@@ -812,7 +812,7 @@ public class WatchDeviceServiceImpl extends ServiceImpl<WatchDeviceMapper, Watch
|
||||
binHisQueryWrapper.isNull(WatchBindHis::getBindEndDate);
|
||||
binHisQueryWrapper.eq(WatchBindHis::getWatchNo, watchDevice.getWatchNo());
|
||||
binHisQueryWrapper.orderByDesc(WatchBindHis::getCreateDate);
|
||||
binHisQueryWrapper.last("limit 1");
|
||||
binHisQueryWrapper.last("FETCH FIRST 1 ROWS ONLY");
|
||||
WatchBindHis watchBindHis = watchBindHisService.getOne(binHisQueryWrapper);
|
||||
if (watchBindHis == null) {
|
||||
return false;
|
||||
|
||||
+3
-1
@@ -224,7 +224,9 @@ public class WatchMqttNoticeServiceImpl extends ServiceImpl<WatchMqttNoticeMappe
|
||||
|
||||
private String getUserWatchNo(String userId) {
|
||||
LambdaQueryWrapper<WatchBindHis> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(WatchBindHis::getBindUserId, userId).orderByDesc(WatchBindHis::getBindDate).last(" limit 1");
|
||||
queryWrapper.eq(WatchBindHis::getBindUserId, userId)
|
||||
.orderByDesc(WatchBindHis::getBindDate)
|
||||
.last("FETCH FIRST 1 ROWS ONLY");
|
||||
WatchBindHis watchBindHis = watchBindHisMapper.selectOne(queryWrapper);
|
||||
if (watchBindHis != null) {
|
||||
return watchBindHis.getWatchNo();
|
||||
|
||||
+23
-15
@@ -586,7 +586,7 @@ public class WatchServiceImpl implements IWatchService {
|
||||
wrapper.selectAs(WatchStatUserInfoDaySleep::getDataDate,WatchH5IndexItemNewVo::getDataDate);
|
||||
wrapper.eq(WatchStatUserInfoDaySleep::getUserId, userId);
|
||||
wrapper.orderByDesc(WatchStatUserInfoDaySleep::getDataDate);
|
||||
wrapper.last("limit 1");
|
||||
wrapper.last("FETCH FIRST 1 ROWS ONLY");
|
||||
return daySleepMapper.selectJoinOne(WatchH5IndexItemNewVo.class,wrapper);
|
||||
}
|
||||
|
||||
@@ -597,7 +597,7 @@ public class WatchServiceImpl implements IWatchService {
|
||||
wrapper.selectAs(WatchStatUserInfoDaySdc::getDataDate,WatchH5IndexItemNewVo::getDataDate);
|
||||
wrapper.eq(WatchStatUserInfoDaySdc::getUserId, userId);
|
||||
wrapper.orderByDesc(WatchStatUserInfoDaySdc::getDataDate);
|
||||
wrapper.last("limit 1");
|
||||
wrapper.last("FETCH FIRST 1 ROWS ONLY");
|
||||
return statSdcMapper.selectJoinOne(WatchH5IndexItemNewVo.class,wrapper);
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ public class WatchServiceImpl implements IWatchService {
|
||||
wrapper.selectAs(WatchStatUserInfoDayHeartRate::getDataDate,WatchH5IndexItemNewVo::getDataDate);
|
||||
wrapper.eq(WatchStatUserInfoDayHeartRate::getUserId, userId);
|
||||
wrapper.orderByDesc(WatchStatUserInfoDayHeartRate::getDataDate);
|
||||
wrapper.last("limit 1");
|
||||
wrapper.last("FETCH FIRST 1 ROWS ONLY");
|
||||
return dayHeartRateMapper.selectJoinOne(WatchH5IndexItemNewVo.class,wrapper);
|
||||
}
|
||||
|
||||
@@ -625,7 +625,7 @@ public class WatchServiceImpl implements IWatchService {
|
||||
wrapper.selectAs(WatchStatUserInfoDaySpo2::getDataDate,WatchH5IndexItemNewVo::getDataDate);
|
||||
wrapper.eq(WatchStatUserInfoDaySpo2::getUserId, userId);
|
||||
wrapper.orderByDesc(WatchStatUserInfoDaySpo2::getDataDate);
|
||||
wrapper.last("limit 1");
|
||||
wrapper.last("FETCH FIRST 1 ROWS ONLY");
|
||||
return daySpo2Mapper.selectJoinOne(WatchH5IndexItemNewVo.class,wrapper);
|
||||
}
|
||||
|
||||
@@ -639,7 +639,7 @@ public class WatchServiceImpl implements IWatchService {
|
||||
wrapper.selectAs(WatchStatUserInfoDayStress::getDataDate,WatchH5IndexItemNewVo::getDataDate);
|
||||
wrapper.eq(WatchStatUserInfoDayStress::getUserId, userId);
|
||||
wrapper.orderByDesc(WatchStatUserInfoDayStress::getDataDate);
|
||||
wrapper.last("limit 1");
|
||||
wrapper.last("FETCH FIRST 1 ROWS ONLY");
|
||||
return dayStressMapper.selectJoinOne(WatchH5IndexItemNewVo.class,wrapper);
|
||||
}
|
||||
|
||||
@@ -653,7 +653,7 @@ public class WatchServiceImpl implements IWatchService {
|
||||
wrapper.selectAs(WatchStatUserInfoDayTemp::getDataDate,WatchH5IndexItemNewVo::getDataDate);
|
||||
wrapper.eq(WatchStatUserInfoDayTemp::getUserId, userId);
|
||||
wrapper.orderByDesc(WatchStatUserInfoDayTemp::getDataDate);
|
||||
wrapper.last("limit 1");
|
||||
wrapper.last("FETCH FIRST 1 ROWS ONLY");
|
||||
return dayTempMapper.selectJoinOne(WatchH5IndexItemNewVo.class,wrapper);
|
||||
}
|
||||
|
||||
@@ -662,7 +662,7 @@ public class WatchServiceImpl implements IWatchService {
|
||||
LambdaQueryWrapper<WatchBindHis> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(WatchBindHis::getBindUserId, userId);
|
||||
wrapper.orderByDesc(WatchBindHis::getBindDate);
|
||||
wrapper.last("limit 1");
|
||||
wrapper.last("FETCH FIRST 1 ROWS ONLY");
|
||||
return bindHisMapper.selectOne(wrapper);
|
||||
}
|
||||
|
||||
@@ -903,8 +903,10 @@ public class WatchServiceImpl implements IWatchService {
|
||||
WatchH5WorkoutDayVo watchH5WorkoutDayVo = new WatchH5WorkoutDayVo();
|
||||
|
||||
WatchBindHis watchBindHis = bindHisMapper.selectOne(new LambdaQueryWrapper<WatchBindHis>()
|
||||
.eq(WatchBindHis::getBindUserId, userId).le(WatchBindHis::getBindDate, queryDate)
|
||||
.orderByDesc(WatchBindHis::getBindDate).last("limit 1"));
|
||||
.eq(WatchBindHis::getBindUserId, userId)
|
||||
.le(WatchBindHis::getBindDate, queryDate)
|
||||
.orderByDesc(WatchBindHis::getBindDate)
|
||||
.last("FETCH FIRST 1 ROWS ONLY"));
|
||||
|
||||
String watchNo = null;
|
||||
if (watchBindHis != null) {
|
||||
@@ -1021,8 +1023,10 @@ public class WatchServiceImpl implements IWatchService {
|
||||
}
|
||||
WatchH5StepsDayVo watchH5StepsDayVo = this.getStepsData(userId, queryDate);
|
||||
WatchBindHis watchBindHis = bindHisMapper.selectOne(new LambdaQueryWrapper<WatchBindHis>()
|
||||
.eq(WatchBindHis::getBindUserId, userId).le(WatchBindHis::getBindDate, queryDate)
|
||||
.orderByDesc(WatchBindHis::getBindDate).last("limit 1"));
|
||||
.eq(WatchBindHis::getBindUserId, userId)
|
||||
.le(WatchBindHis::getBindDate, queryDate)
|
||||
.orderByDesc(WatchBindHis::getBindDate)
|
||||
.last("FETCH FIRST 1 ROWS ONLY"));
|
||||
String watchNo = null;
|
||||
if (watchBindHis != null) {
|
||||
watchNo = watchBindHis.getWatchNo();
|
||||
@@ -1082,8 +1086,10 @@ public class WatchServiceImpl implements IWatchService {
|
||||
|
||||
public WatchH5WorkoutResultVO getWorkoutWeekDayList(String userId, Date queryDate) {
|
||||
WatchBindHis watchBindHis = bindHisMapper.selectOne(new LambdaQueryWrapper<WatchBindHis>()
|
||||
.eq(WatchBindHis::getBindUserId, userId).le(WatchBindHis::getBindDate, queryDate)
|
||||
.orderByDesc(WatchBindHis::getBindDate).last("limit 1"));
|
||||
.eq(WatchBindHis::getBindUserId, userId)
|
||||
.le(WatchBindHis::getBindDate, queryDate)
|
||||
.orderByDesc(WatchBindHis::getBindDate)
|
||||
.last("FETCH FIRST 1 ROWS ONLY"));
|
||||
String watchNo = null;
|
||||
if (watchBindHis != null) {
|
||||
watchNo = watchBindHis.getWatchNo();
|
||||
@@ -1103,8 +1109,10 @@ public class WatchServiceImpl implements IWatchService {
|
||||
@Override
|
||||
public WatchH5StepsResultVO getStepsWeekDayList(String userId, Date queryDate) {
|
||||
WatchBindHis watchBindHis = bindHisMapper.selectOne(new LambdaQueryWrapper<WatchBindHis>()
|
||||
.eq(WatchBindHis::getBindUserId, userId).le(WatchBindHis::getBindDate, queryDate)
|
||||
.orderByDesc(WatchBindHis::getBindDate).last("limit 1"));
|
||||
.eq(WatchBindHis::getBindUserId, userId)
|
||||
.le(WatchBindHis::getBindDate, queryDate)
|
||||
.orderByDesc(WatchBindHis::getBindDate)
|
||||
.last("FETCH FIRST 1 ROWS ONLY"));
|
||||
String watchNo = null;
|
||||
if (watchBindHis != null) {
|
||||
watchNo = watchBindHis.getWatchNo();
|
||||
|
||||
+6
-2
@@ -23,7 +23,9 @@ public class WatchSynMaxIdServiceImpl extends ServiceImpl<WatchSynMaxIdMapper, W
|
||||
@Override
|
||||
public String getMaxId(String wdType) {
|
||||
WatchSynMaxId watchSynMaxId = getOne(new QueryWrapper<WatchSynMaxId>()
|
||||
.eq("wd_type", wdType).last("limit 1"));
|
||||
.eq("wd_type", wdType)
|
||||
.orderByDesc("max_id")
|
||||
.last("FETCH FIRST 1 ROWS ONLY"));
|
||||
if (watchSynMaxId != null) {
|
||||
return watchSynMaxId.getMaxId() == null ? "0" : watchSynMaxId.getMaxId();
|
||||
}
|
||||
@@ -34,7 +36,9 @@ public class WatchSynMaxIdServiceImpl extends ServiceImpl<WatchSynMaxIdMapper, W
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void setMaxId(String wdType, String maxId) {
|
||||
WatchSynMaxId watchSynMaxId = getOne(new QueryWrapper<WatchSynMaxId>()
|
||||
.eq("wd_type", wdType).last("limit 1"));
|
||||
.eq("wd_type", wdType)
|
||||
.orderByDesc("max_id")
|
||||
.last("FETCH FIRST 1 ROWS ONLY"));
|
||||
if (watchSynMaxId != null) {
|
||||
if (StrUtil.isNotEmpty(maxId)) {
|
||||
watchSynMaxId.setMaxId(maxId);
|
||||
|
||||
+2
-1
@@ -2,11 +2,12 @@ package com.renkang;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
||||
@EnableAsync
|
||||
@SpringBootApplication(scanBasePackages = {"com.renkang", "org.jeecg"})
|
||||
@SpringBootApplication(scanBasePackages = {"com.renkang", "org.jeecg"},exclude = QuartzAutoConfiguration.class)
|
||||
@EnableFeignClients(basePackages = {"com.renkang", "org.jeecg"})
|
||||
public class HealthWatchCloudApplication {
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
PROFILE_NAME=dev
|
||||
SERVER_PORT=7098
|
||||
NACOS_SERVER_ADDR=localhost:8848
|
||||
NACOS_USERNAME=nacos
|
||||
NACOS_PASSWORD=nacos
|
||||
NACOS_NAMESPACE=f3f65fb2-303b-4bf7-bccb-4755886503c1
|
||||
NACOS_SERVER_ADDR=192.168.1.80:8848
|
||||
NACOS_USERNAME=xjuser
|
||||
NACOS_PASSWORD=Aa135790!123
|
||||
NACOS_NAMESPACE=xjxc-space-common
|
||||
NACOS_NAMESPACE_DISCOVERY=xjxc-space-common
|
||||
NACOS_GROUP=dev
|
||||
FILE_SERVER_URL=http://fileserver.yg.dt.io
|
||||
@@ -21,7 +21,7 @@ spring:
|
||||
password: ${spring.cloud.nacos.password}
|
||||
discovery:
|
||||
enabled: true
|
||||
namespace: ${NACOS_NAMESPACE:}
|
||||
namespace: ${NACOS_NAMESPACE_DISCOVERY:}
|
||||
group: ${NACOS_GROUP:DEFAULT_GROUP}
|
||||
server-addr: ${spring.cloud.nacos.server-addr}
|
||||
username: ${spring.cloud.nacos.username}
|
||||
|
||||
@@ -140,10 +140,11 @@
|
||||
</dependency>
|
||||
|
||||
<!-- 数据库驱动 -->
|
||||
<!--mysql-->
|
||||
<!-- 达梦数据库-->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
<groupId>com.dameng</groupId>
|
||||
<artifactId>DmJdbcDriver8</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<!-- sqlserver-->
|
||||
<dependency>
|
||||
|
||||
@@ -367,28 +367,28 @@ public interface CommonConstant {
|
||||
Integer USER_IDENTITY_2 = 2;
|
||||
|
||||
/**
|
||||
* sys_user 表 username 唯一键索引
|
||||
* QH_SYS_USER 表 username 唯一键索引
|
||||
*/
|
||||
String SQL_INDEX_UNIQ_SYS_USER_USERNAME = "uniq_sys_user_username";
|
||||
/**
|
||||
* sys_user 表 work_no 唯一键索引
|
||||
* QH_SYS_USER 表 work_no 唯一键索引
|
||||
*/
|
||||
String SQL_INDEX_UNIQ_SYS_USER_WORK_NO = "uniq_sys_user_work_no";
|
||||
/**
|
||||
* sys_user 表 phone 唯一键索引
|
||||
* QH_SYS_USER 表 phone 唯一键索引
|
||||
*/
|
||||
String SQL_INDEX_UNIQ_SYS_USER_PHONE = "uniq_sys_user_phone";
|
||||
/**
|
||||
* 达梦数据库升提示。违反表[SYS_USER]唯一性约束
|
||||
* 达梦数据库升提示。违反表[QH_SYS_USER]唯一性约束
|
||||
*/
|
||||
String SQL_INDEX_UNIQ_SYS_USER = "唯一性约束";
|
||||
|
||||
/**
|
||||
* sys_user 表 email 唯一键索引
|
||||
* QH_SYS_USER 表 email 唯一键索引
|
||||
*/
|
||||
String SQL_INDEX_UNIQ_SYS_USER_EMAIL = "uniq_sys_user_email";
|
||||
/**
|
||||
* sys_quartz_job 表 job_class_name 唯一键索引
|
||||
* QH_SYS_QUARTZ_JOB 表 job_class_name 唯一键索引
|
||||
*/
|
||||
String SQL_INDEX_UNIQ_JOB_CLASS_NAME = "uniq_job_class_name";
|
||||
/**
|
||||
@@ -396,15 +396,15 @@ public interface CommonConstant {
|
||||
*/
|
||||
String SQL_INDEX_UNIQ_CODE = "uniq_code";
|
||||
/**
|
||||
* sys_role 表 code 唯一键索引
|
||||
* QH_SYS_ROLE 表 code 唯一键索引
|
||||
*/
|
||||
String SQL_INDEX_UNIQ_SYS_ROLE_CODE = "uniq_sys_role_role_code";
|
||||
/**
|
||||
* sys_depart 表 code 唯一键索引
|
||||
* QH_SYS_DEPART 表 code 唯一键索引
|
||||
*/
|
||||
String SQL_INDEX_UNIQ_DEPART_ORG_CODE = "uniq_depart_org_code";
|
||||
/**
|
||||
* sys_category 表 code 唯一键索引
|
||||
* QH_SYS_CATEGORY 表 code 唯一键索引
|
||||
*/
|
||||
String SQL_INDEX_UNIQ_CATEGORY_CODE = "idx_sc_code";
|
||||
/**
|
||||
|
||||
+2
-2
@@ -9,8 +9,8 @@ package org.jeecg.common.constant;
|
||||
public class DynamicTableConstant {
|
||||
/**
|
||||
* 角色首页配置表
|
||||
* vue2表名: sys_role_index
|
||||
* vue2表名: QH_SYS_ROLE_INDEX
|
||||
* vue3表名: sys_role_index_vue3
|
||||
*/
|
||||
public static final String SYS_ROLE_INDEX = "sys_role_index";
|
||||
public static final String QH_SYS_ROLE_INDEX = "QH_SYS_ROLE_INDEX";
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.math.BigDecimal;
|
||||
* @date 2023/12/4 11:01
|
||||
*/
|
||||
@Data
|
||||
@TableName("sys_depart")
|
||||
@TableName("QH_SYS_DEPART_GPS")
|
||||
public class SysDepartGps implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.Date;
|
||||
* @date 2023-04-19 15:26
|
||||
*/
|
||||
@Data
|
||||
@Schema(title = "sys_user对象", description = "sys_user")
|
||||
@Schema(title = "sys_user对象", description = "QH_SYS_USER")
|
||||
public class SysUserModel {
|
||||
/**
|
||||
* id
|
||||
|
||||
@@ -307,7 +307,10 @@ public class CommonUtils {
|
||||
String sqlserver = "SQL SERVER";
|
||||
if (dbType.indexOf(DataBaseConstant.DB_TYPE_MYSQL) >= 0) {
|
||||
DB_TYPE = DataBaseConstant.DB_TYPE_MYSQL;
|
||||
} else if (dbType.indexOf(DataBaseConstant.DB_TYPE_ORACLE) >= 0 || dbType.indexOf(DataBaseConstant.DB_TYPE_DM) >= 0) {
|
||||
} else if (dbType.indexOf(DataBaseConstant.DB_TYPE_DM) >= 0) {
|
||||
// 达梦数据库:getDatabaseProductName() 返回 "DM DBMS",需在 ORACLE 之前判断
|
||||
DB_TYPE = DataBaseConstant.DB_TYPE_DM;
|
||||
} else if (dbType.indexOf(DataBaseConstant.DB_TYPE_ORACLE) >= 0) {
|
||||
DB_TYPE = DataBaseConstant.DB_TYPE_ORACLE;
|
||||
} else if (dbType.indexOf(DataBaseConstant.DB_TYPE_SQLSERVER) >= 0 || dbType.indexOf(sqlserver) >= 0) {
|
||||
DB_TYPE = DataBaseConstant.DB_TYPE_SQLSERVER;
|
||||
|
||||
@@ -90,6 +90,9 @@ public class DbTypeUtils {
|
||||
return DataBaseConstant.DB_TYPE_DB2;
|
||||
} else if (DbType.HSQL.equals(dbType)) {
|
||||
return DataBaseConstant.DB_TYPE_HSQL;
|
||||
} else if (DbType.DM.equals(dbType)) {
|
||||
// 达梦数据库单独返回 DM 类型,避免被归入 Oracle 分支
|
||||
return DataBaseConstant.DB_TYPE_DM;
|
||||
} else if (dbTypeIsOracle(dbType)) {
|
||||
return DataBaseConstant.DB_TYPE_ORACLE;
|
||||
} else if (dbTypeIsSqlServer(dbType)) {
|
||||
|
||||
+3
-3
@@ -17,13 +17,13 @@ public abstract class AbstractQueryBlackListHandler {
|
||||
* key-表名
|
||||
* value-字段名,多个逗号隔开
|
||||
* 两种配置方式-- 全部配置成小写
|
||||
* ruleMap.put("sys_user", "*")sys_user所有的字段不支持查询
|
||||
* ruleMap.put("sys_user", "username,password")sys_user中的username和password不支持查询
|
||||
* ruleMap.put("QH_SYS_USER", "*")sys_user所有的字段不支持查询
|
||||
* ruleMap.put("QH_SYS_USER", "username,password")sys_user中的username和password不支持查询
|
||||
*/
|
||||
public static Map<String, String> ruleMap = new HashMap<>();
|
||||
|
||||
static {
|
||||
ruleMap.put("sys_user", "password,salt");
|
||||
ruleMap.put("QH_SYS_USER", "password,salt");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user