fix(emergency,watch): 更新数据库表名前缀为标准化命名
更新health-emergency和health-watch模块中的所有实体类和XML映射文件以及mapper文件注解sql, 将数据库表名从原有命名格式统一更改为带项目前缀的标准化格式, 如QH_EME开头用于应急健康模块,QH_WAT开头用于健康监测模块
This commit is contained in:
+1
-1
@@ -17,7 +17,7 @@ import java.io.Serializable;
|
|||||||
* @date 2023-06-06 17:29:38
|
* @date 2023-06-06 17:29:38
|
||||||
*/
|
*/
|
||||||
@Setter
|
@Setter
|
||||||
@TableName("QH_SYS_NOTIF_SMS_PHONE")
|
@TableName("QH_EME_NOTIF_SMS_PHONE")
|
||||||
@Data
|
@Data
|
||||||
public class SysNotifySmsPhone implements Serializable {
|
public class SysNotifySmsPhone implements Serializable {
|
||||||
/**
|
/**
|
||||||
|
|||||||
+6
-6
@@ -31,8 +31,8 @@
|
|||||||
aem.latitude AS latitude
|
aem.latitude AS latitude
|
||||||
|
|
||||||
FROM
|
FROM
|
||||||
aed_equipment_maintain aem1
|
QH_EME_AED_EQUIP_MAINTAIN aem1
|
||||||
INNER JOIN aed_equipment_manger aem ON aem.id = aem1.equipment_id AND aem.del_flag =0
|
INNER JOIN QH_EME_AED_EQUIP_MANGER aem ON aem.id = aem1.equipment_id AND aem.del_flag =0
|
||||||
<where>
|
<where>
|
||||||
and aem1.del_flag=0
|
and aem1.del_flag=0
|
||||||
<if test="name !=null and name !=''">
|
<if test="name !=null and name !=''">
|
||||||
@@ -70,8 +70,8 @@
|
|||||||
aem1.maintain_unit AS maintainUnit,
|
aem1.maintain_unit AS maintainUnit,
|
||||||
aem.longitude AS longitude,
|
aem.longitude AS longitude,
|
||||||
aem.latitude AS latitude
|
aem.latitude AS latitude
|
||||||
from aed_equipment_maintain aem1
|
from QH_EME_AED_EQUIP_MAINTAIN aem1
|
||||||
LEFT join aed_equipment_manger aem on aem.id = aem1.equipment_id and aem.del_flag = 0
|
LEFT join QH_EME_AED_EQUIP_MANGER aem on aem.id = aem1.equipment_id and aem.del_flag = 0
|
||||||
where aem1.id = #{id}
|
where aem1.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -89,8 +89,8 @@
|
|||||||
t2.manage_user_name,
|
t2.manage_user_name,
|
||||||
t2.manage_user_mobile
|
t2.manage_user_mobile
|
||||||
FROM
|
FROM
|
||||||
"aed_equipment_maintain" t1
|
"QH_EME_AED_EQUIP_MAINTAIN" t1
|
||||||
LEFT JOIN aed_equipment_manger t2 ON t1.equipment_id = t2.id
|
LEFT JOIN QH_EME_AED_EQUIP_MANGER t2 ON t1.equipment_id = t2.id
|
||||||
<where>
|
<where>
|
||||||
<if test="name !=null and name !=''">
|
<if test="name !=null and name !=''">
|
||||||
and t2.name like concat('%',#{name},'%')
|
and t2.name like concat('%',#{name},'%')
|
||||||
|
|||||||
+3
-3
@@ -39,7 +39,7 @@
|
|||||||
camera_num as cameraNum,
|
camera_num as cameraNum,
|
||||||
camera_code as cameraCode
|
camera_code as cameraCode
|
||||||
from
|
from
|
||||||
aed_equipment_manger
|
QH_EME_AED_EQUIP_MANGER
|
||||||
<where>
|
<where>
|
||||||
del_flag=0
|
del_flag=0
|
||||||
<if test="name !=null and name !=''">
|
<if test="name !=null and name !=''">
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
camera_num as cameraNum,
|
camera_num as cameraNum,
|
||||||
camera_code as cameraCode
|
camera_code as cameraCode
|
||||||
from
|
from
|
||||||
aed_equipment_manger
|
QH_EME_AED_EQUIP_MANGER
|
||||||
<where>
|
<where>
|
||||||
del_flag=0
|
del_flag=0
|
||||||
and publish_flag=1
|
and publish_flag=1
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="getLocation" resultType="com.renkang.emergency.aed.entity.AedLocationEquipment" parameterType="java.util.List">
|
<select id="getLocation" resultType="com.renkang.emergency.aed.entity.AedLocationEquipment" parameterType="java.util.List">
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM aed_location_equipment
|
FROM QH_EME_AED_LOC_EQUIP
|
||||||
WHERE equipment_id IN
|
WHERE equipment_id IN
|
||||||
<foreach collection="idList" item="id" open="(" separator="," close=")">
|
<foreach collection="idList" item="id" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
|
|||||||
+4
-4
@@ -28,8 +28,8 @@
|
|||||||
aer.site_profile AS siteProfile,
|
aer.site_profile AS siteProfile,
|
||||||
aer.effect AS effect
|
aer.effect AS effect
|
||||||
FROM
|
FROM
|
||||||
aed_equipment_train aer
|
QH_EME_AED_EQUIP_TRAIN aer
|
||||||
LEFT JOIN aed_equipment_manger aem ON aem.id = aer.equipment_id and aem.del_flag=0
|
LEFT JOIN QH_EME_AED_EQUIP_MANGER aem ON aem.id = aer.equipment_id and aem.del_flag=0
|
||||||
<where>
|
<where>
|
||||||
and aer.del_flag=0
|
and aer.del_flag=0
|
||||||
and aer.flag=#{flag}
|
and aer.flag=#{flag}
|
||||||
@@ -56,8 +56,8 @@
|
|||||||
t2.install_address,
|
t2.install_address,
|
||||||
t2.status
|
t2.status
|
||||||
FROM
|
FROM
|
||||||
"aed_equipment_train" t1
|
"QH_EME_AED_EQUIP_TRAIN" t1
|
||||||
LEFT JOIN aed_equipment_manger t2 ON t1.equipment_id = t2.id
|
LEFT JOIN QH_EME_AED_EQUIP_MANGER t2 ON t1.equipment_id = t2.id
|
||||||
<where>
|
<where>
|
||||||
and t1.flag = #{trainType}
|
and t1.flag = #{trainType}
|
||||||
<if test="name !=null and name !=''">
|
<if test="name !=null and name !=''">
|
||||||
|
|||||||
+2
-2
@@ -26,8 +26,8 @@
|
|||||||
aur.fail_rate as failRate,
|
aur.fail_rate as failRate,
|
||||||
aur.use_result as useResult
|
aur.use_result as useResult
|
||||||
from
|
from
|
||||||
aed_use_record aur
|
QH_EME_AED_USE_RECORD aur
|
||||||
left join aed_equipment_manger aem on aem.id = aur.equipment_id
|
left join QH_EME_AED_EQUIP_MANGER aem on aem.id = aur.equipment_id
|
||||||
<where>
|
<where>
|
||||||
and aur.del_flag=0
|
and aur.del_flag=0
|
||||||
<if test="name !=null and name !=''">
|
<if test="name !=null and name !=''">
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@TableName("archives_body_type")
|
@TableName("QH_WAT_ARCHIVES_BODY_TYPE")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "archives_body_type对象", description = "archives_body_type")
|
@Schema(title = "archives_body_type对象", description = "archives_body_type")
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ import java.util.Date;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("dept_statistic_data")
|
@TableName("QH_WAT_DEPT_STAT_DATA")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "dept_statistic_data对象", description = "dept_statistic_data")
|
@Schema(title = "dept_statistic_data对象", description = "dept_statistic_data")
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("user_record_sports_day")
|
@TableName("QH_WAT_USER_REC_SPORT_DAY")
|
||||||
@Schema(title = "用户自主记录运动数据日汇总表", description = "用户自主记录运动数据日汇总表")
|
@Schema(title = "用户自主记录运动数据日汇总表", description = "用户自主记录运动数据日汇总表")
|
||||||
public class UserRecordSportsDay implements Serializable {
|
public class UserRecordSportsDay implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ import java.util.Date;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("user_record_sports_info")
|
@TableName("QH_WAT_USER_REC_SPORT_INF")
|
||||||
@Schema(title = "用户自主记录运动数据明细表", description = "用户自主记录运动数据明细表")
|
@Schema(title = "用户自主记录运动数据明细表", description = "用户自主记录运动数据明细表")
|
||||||
public class UserRecordSportsInfo implements Serializable {
|
public class UserRecordSportsInfo implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ import java.util.Date;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("user_we_chat_sports_day")
|
@TableName("QH_WAT_USER_WECHAT_SPO_DAY")
|
||||||
@Builder
|
@Builder
|
||||||
@Schema(title = "用户微信步数日汇总表", description = "用户微信步数日汇总表")
|
@Schema(title = "用户微信步数日汇总表", description = "用户微信步数日汇总表")
|
||||||
public class UserWeChatSportsDay implements Serializable {
|
public class UserWeChatSportsDay implements Serializable {
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ import java.util.List;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_bind_his")
|
@TableName("QH_WAT_BIND_HIS")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_bind_his对象", description = "watch_bind_his")
|
@Schema(title = "watch_bind_his对象", description = "watch_bind_his")
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import java.util.List;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_data")
|
@TableName("QH_WAT_DATA")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_data对象", description = "watch_data")
|
@Schema(title = "watch_data对象", description = "watch_data")
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_data_calorie")
|
@TableName("QH_WAT_DATA_CALORIE")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_data_calorie对象", description = "watch_data_calorie")
|
@Schema(title = "watch_data_calorie对象", description = "watch_data_calorie")
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_data_distance")
|
@TableName("QH_WAT_DATA_DISTANCE")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_data_distance对象", description = "watch_data_distance")
|
@Schema(title = "watch_data_distance对象", description = "watch_data_distance")
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ import java.util.Date;
|
|||||||
@Builder
|
@Builder
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@TableName(value = "watch_data_ecg")
|
@TableName(value = "QH_WAT_DATA_ECG")
|
||||||
public class WatchDataEcg implements Serializable {
|
public class WatchDataEcg implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
@TableId(value = "id", type = IdType.ASSIGN_ID)
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_data_exercise")
|
@TableName("QH_WAT_DATA_EXERCISE")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_data_exercise对象", description = "watch_data_exercise")
|
@Schema(title = "watch_data_exercise对象", description = "watch_data_exercise")
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_data_gps")
|
@TableName("QH_WAT_DATA_GPS")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_data_gps对象", description = "watch_data_gps")
|
@Schema(title = "watch_data_gps对象", description = "watch_data_gps")
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_data_heart_rate")
|
@TableName("QH_WAT_DATA_HEART_RATE")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_data_heart_rate对象", description = "watch_data_heart_rate")
|
@Schema(title = "watch_data_heart_rate对象", description = "watch_data_heart_rate")
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_data_sleep")
|
@TableName("QH_WAT_DATA_SLEEP")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_data_sleep对象", description = "watch_data_sleep")
|
@Schema(title = "watch_data_sleep对象", description = "watch_data_sleep")
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ import java.util.List;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_data_sleep_new")
|
@TableName("QH_WAT_DATA_SLEEP_NEW")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_data_sleep_new对象", description = "watch_data_sleep_new")
|
@Schema(title = "watch_data_sleep_new对象", description = "watch_data_sleep_new")
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_data_sleep_new_day")
|
@TableName("QH_WAT_DATA_SLEEP_NEW_DAY")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_data_sleep_new_day对象", description = "watch_data_sleep_new_day")
|
@Schema(title = "watch_data_sleep_new_day对象", description = "watch_data_sleep_new_day")
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_data_sleep_new_err")
|
@TableName("QH_WAT_DATA_SLEEP_NEW_ERR")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_data_sleep_new_err对象", description = "watch_data_sleep_new_err")
|
@Schema(title = "watch_data_sleep_new_err对象", description = "watch_data_sleep_new_err")
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_data_sleep_new_minute")
|
@TableName("QH_WAT_DATA_SLEEP_NEW_MIN")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_data_sleep_new_minute对象", description = "watch_data_sleep_new_minute")
|
@Schema(title = "watch_data_sleep_new_minute对象", description = "watch_data_sleep_new_minute")
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_data_spo2")
|
@TableName("QH_WAT_DATA_SPO2")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_data_spo2对象", description = "watch_data_spo2")
|
@Schema(title = "watch_data_spo2对象", description = "watch_data_spo2")
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_data_steps")
|
@TableName("QH_WAT_DATA_STEPS")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_data_steps对象", description = "watch_data_steps")
|
@Schema(title = "watch_data_steps对象", description = "watch_data_steps")
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ import java.util.Date;
|
|||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@TableName(value = "watch_data_steps_hf")
|
@TableName(value = "QH_WAT_DATA_STEPS_HF")
|
||||||
public class WatchDataStepsHf implements Serializable {
|
public class WatchDataStepsHf implements Serializable {
|
||||||
public static final String COL_ID = "id";
|
public static final String COL_ID = "id";
|
||||||
public static final String COL_WATCH_NO = "watch_no";
|
public static final String COL_WATCH_NO = "watch_no";
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_data_stress")
|
@TableName("QH_WAT_DATA_STRESS")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_data_stress对象", description = "watch_data_stress")
|
@Schema(title = "watch_data_stress对象", description = "watch_data_stress")
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_data_temperature")
|
@TableName("QH_WAT_DATA_TEMP")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_data_temperature对象", description = "watch_data_temperature")
|
@Schema(title = "watch_data_temperature对象", description = "watch_data_temperature")
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_data_workout")
|
@TableName("QH_WAT_DATA_WORKOUT")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_data_workout对象", description = "watch_data_workout")
|
@Schema(title = "watch_data_workout对象", description = "watch_data_workout")
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_data_workout_trace")
|
@TableName("QH_WAT_DATA_WORKOUT_TRACE")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_data_workout_trace对象", description = "watch_data_workout_trace")
|
@Schema(title = "watch_data_workout_trace对象", description = "watch_data_workout_trace")
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@ import java.util.Date;
|
|||||||
@Builder
|
@Builder
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@TableName(value = "watch_depart_report")
|
@TableName(value = "QH_WAT_DEPART_REPORT")
|
||||||
public class WatchDepartReport implements Serializable {
|
public class WatchDepartReport implements Serializable {
|
||||||
public static final int GEN_FLAG_NONE = 0;
|
public static final int GEN_FLAG_NONE = 0;
|
||||||
public static final int GEN_FLAG_QUEUE = 1;
|
public static final int GEN_FLAG_QUEUE = 1;
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ import java.util.Date;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_device")
|
@TableName("QH_WAT_DEVICE")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_device对象", description = "watch_device")
|
@Schema(title = "watch_device对象", description = "watch_device")
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ import java.io.Serializable;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_device")
|
@TableName("QH_WAT_DEVICE")
|
||||||
public class WatchDeviceDO implements Serializable {
|
public class WatchDeviceDO implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_device_switch")
|
@TableName("QH_WAT_DEVICE_SWITCH")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_device_switch对象", description = "watch_device_switch")
|
@Schema(title = "watch_device_switch对象", description = "watch_device_switch")
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import java.util.List;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_key_user")
|
@TableName("QH_WAT_KEY_USER")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_key_user对象", description = "watch_key_user")
|
@Schema(title = "watch_key_user对象", description = "watch_key_user")
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ import java.util.List;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_monitor_data")
|
@TableName("QH_WAT_MONITOR_DATA")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_monitor_data对象", description = "watch_monitor_data")
|
@Schema(title = "watch_monitor_data对象", description = "watch_monitor_data")
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_monitor_mobile")
|
@TableName("QH_WAT_MONITOR_MOBILE")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_monitor_mobile对象", description = "watch_monitor_mobile")
|
@Schema(title = "watch_monitor_mobile对象", description = "watch_monitor_mobile")
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_mqtt_notice")
|
@TableName("QH_WAT_MQTT_NOTICE")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_mqtt_notice对象", description = "watch_mqtt_notice")
|
@Schema(title = "watch_mqtt_notice对象", description = "watch_mqtt_notice")
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ import java.util.Date;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_stat_user_info_day_heart_rate")
|
@TableName("QH_WAT_STA_US_DAY_HEA_RAT")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_stat_user_info_day_heart_rate对象", description = "watch_stat_user_info_day_heart_rate")
|
@Schema(title = "watch_stat_user_info_day_heart_rate对象", description = "watch_stat_user_info_day_heart_rate")
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ import java.util.Date;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_stat_user_info_day_sdc")
|
@TableName("QH_WAT_STAT_USER_DAY_SDC")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_stat_user_info_day_sdc对象", description = "watch_stat_user_info_day_sdc")
|
@Schema(title = "watch_stat_user_info_day_sdc对象", description = "watch_stat_user_info_day_sdc")
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ import java.util.Date;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_stat_user_info_day_sleep")
|
@TableName("QH_WAT_STAT_USER_DAY_SLE")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_stat_user_info_day_sleep对象", description = "watch_stat_user_info_day_sleep")
|
@Schema(title = "watch_stat_user_info_day_sleep对象", description = "watch_stat_user_info_day_sleep")
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ import java.util.Date;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_stat_user_info_day_spo2")
|
@TableName("QH_WAT_STAT_USER_DAY_SPO2")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_stat_user_info_day_spo2对象", description = "watch_stat_user_info_day_spo2")
|
@Schema(title = "watch_stat_user_info_day_spo2对象", description = "watch_stat_user_info_day_spo2")
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ import java.util.Date;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_stat_user_info_day_stress")
|
@TableName("QH_WAT_STAT_USER_DAY_STRE")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_stat_user_info_day_stress对象", description = "watch_stat_user_info_day_stress")
|
@Schema(title = "watch_stat_user_info_day_stress对象", description = "watch_stat_user_info_day_stress")
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ import java.util.Date;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_stat_user_info_day_temp")
|
@TableName("QH_WAT_STAT_USER_DAY_TEMP")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_stat_user_info_day_temp对象", description = "watch_stat_user_info_day_temp")
|
@Schema(title = "watch_stat_user_info_day_temp对象", description = "watch_stat_user_info_day_temp")
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@ import java.util.Date;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_stat_user_info_day_workout")
|
@TableName("QH_WAT_STAT_USER_DAY_WORK")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_stat_user_info_day_workout对象", description = "watch_stat_user_info_day_workout")
|
@Schema(title = "watch_stat_user_info_day_workout对象", description = "watch_stat_user_info_day_workout")
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import java.io.Serializable;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_syn_max_id")
|
@TableName("QH_WAT_SYN_MAX_ID")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_syn_max_id对象", description = "watch_syn_max_id")
|
@Schema(title = "watch_syn_max_id对象", description = "watch_syn_max_id")
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ import java.util.List;
|
|||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName("watch_user_data")
|
@TableName("QH_WAT_USER_DATA")
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Schema(title = "watch_user_data对象", description = "watch_user_data")
|
@Schema(title = "watch_user_data对象", description = "watch_user_data")
|
||||||
|
|||||||
+2
-3
@@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Param;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: dept_statistic_data
|
* @Description: QH_WAT_DEPT_STAT_DATA
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-11-09
|
* @Date: 2023-11-09
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
@@ -19,8 +19,7 @@ public interface DeptStatisticDataMapper extends BaseMapper<DeptStatisticData> {
|
|||||||
/**
|
/**
|
||||||
* 心率上传次数
|
* 心率上传次数
|
||||||
* @param orgCode
|
* @param orgCode
|
||||||
* @param startTime
|
* @param dataDate
|
||||||
* @param endTime
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Long getHeartRateUploadTimes(@Param("orgCode") String orgCode, @Param("dataDate") Date dataDate);
|
Long getHeartRateUploadTimes(@Param("orgCode") String orgCode, @Param("dataDate") Date dataDate);
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_bind_his
|
* @Description: QH_WAT_BIND_HIS
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-08-08
|
* @Date: 2023-08-08
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import com.renkang.watch.entity.WatchDataCalorie;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_data_calorie
|
* @Description: QH_WAT_DATA_CALORIE
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-08-08
|
* @Date: 2023-08-08
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import com.renkang.watch.entity.WatchDataDistance;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_data_distance
|
* @Description: QH_WAT_DATA_DISTANCE
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-08-08
|
* @Date: 2023-08-08
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import com.renkang.watch.entity.WatchDataExercise;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_data_exercise
|
* @Description: QH_WAT_DATA_EXERCISE
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-08-08
|
* @Date: 2023-08-08
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import com.renkang.watch.entity.WatchDataGps;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_data_gps
|
* @Description: QH_WAT_DATA_GPS
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-08-08
|
* @Date: 2023-08-08
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+1
-1
@@ -32,6 +32,6 @@ public interface WatchDataHeartRateMapper extends MPJBaseMapper<WatchDataHeartRa
|
|||||||
* @param bindUserId
|
* @param bindUserId
|
||||||
* @return
|
* @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 QH_WAT_DATA_HEART_RATE WHERE bind_user_id = #{bindUserId} AND data_date = (SELECT MAX(data_date) FROM QH_WAT_DATA_HEART_RATE WHERE bind_user_id = #{bindUserId})")
|
||||||
List<WatchDataHeartRate> latestDataTempByUserId(@Param("bindUserId") String bindUserId);
|
List<WatchDataHeartRate> latestDataTempByUserId(@Param("bindUserId") String bindUserId);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import com.renkang.watch.entity.WatchDataSleep;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_data_sleep
|
* @Description: QH_WAT_DATA_SLEEP
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-08-08
|
* @Date: 2023-08-08
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+2
-2
@@ -14,7 +14,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_data_spo2
|
* @Description: QH_WAT_DATA_SPO2
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-08-08
|
* @Date: 2023-08-08
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
@@ -33,7 +33,7 @@ public interface WatchDataSpo2Mapper extends MPJBaseMapper<WatchDataSpo2> {
|
|||||||
* @param bindUserId
|
* @param bindUserId
|
||||||
* @return
|
* @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 QH_WAT_DATA_SPO2 WHERE bind_user_id = #{bindUserId} AND data_date = (SELECT MAX(data_date) FROM QH_WAT_DATA_SPO2 WHERE bind_user_id = #{bindUserId})")
|
||||||
List<WatchDataSpo2> latestDataTempByUserId(@Param("bindUserId") String bindUserId);
|
List<WatchDataSpo2> latestDataTempByUserId(@Param("bindUserId") String bindUserId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import com.renkang.watch.entity.WatchDataSteps;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_data_steps
|
* @Description: QH_WAT_DATA_STEPS
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-08-08
|
* @Date: 2023-08-08
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+2
-2
@@ -21,7 +21,7 @@ public interface WatchDataStressMapper extends MPJBaseMapper<WatchDataStress> {
|
|||||||
|
|
||||||
IPage<WatchDataStress> selectStressByYear(IPage<WatchDataStress> page, StatisticsReq req);
|
IPage<WatchDataStress> selectStressByYear(IPage<WatchDataStress> page, StatisticsReq req);
|
||||||
|
|
||||||
@Select("SELECT * FROM (SELECT * FROM watch_data_stress WHERE bind_user_id = #{bindUserId} ORDER BY start_time_stamp DESC) WHERE ROWNUM = 1")
|
@Select("SELECT * FROM (SELECT * FROM QH_WAT_DATA_STRESS WHERE bind_user_id = #{bindUserId} ORDER BY start_time_stamp DESC) WHERE ROWNUM = 1")
|
||||||
WatchDataStress selectWatchDataStressByUserId(@Param("bindUserId") String bindUserId);
|
WatchDataStress selectWatchDataStressByUserId(@Param("bindUserId") String bindUserId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -29,7 +29,7 @@ public interface WatchDataStressMapper extends MPJBaseMapper<WatchDataStress> {
|
|||||||
* @param bindUserId
|
* @param bindUserId
|
||||||
* @return
|
* @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 QH_WAT_DATA_STRESS WHERE bind_user_id = #{bindUserId} AND data_date = (SELECT MAX(data_date) FROM QH_WAT_DATA_STRESS WHERE bind_user_id = #{bindUserId})")
|
||||||
List<WatchDataStress> latestDataTempByUserId(@Param("bindUserId") String 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);
|
IPage<WatchDataTemperature> selectTempByYear(@Param("page") IPage<WatchDataTemperature> page, @Param("req") StatisticsReq req);
|
||||||
|
|
||||||
@Select("SELECT * FROM watch_data_temperature WHERE bind_user_id = #{bindUserId} AND data_date = #{dateTime} ORDER BY time_stamp")
|
@Select("SELECT * FROM QH_WAT_DATA_TEMP WHERE bind_user_id = #{bindUserId} AND data_date = #{dateTime} ORDER BY time_stamp")
|
||||||
List<WatchDataTemperature> selectTempByUserId(@Param("bindUserId") String bindUserId,@Param("dateTime") Date dateTime);
|
List<WatchDataTemperature> selectTempByUserId(@Param("bindUserId") String bindUserId,@Param("dateTime") Date dateTime);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -31,6 +31,6 @@ public interface WatchDataTemperatureMapper extends MPJBaseMapper<WatchDataTempe
|
|||||||
* @param bindUserId
|
* @param bindUserId
|
||||||
* @return
|
* @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 QH_WAT_DATA_TEMP WHERE bind_user_id = #{bindUserId} AND data_date = (SELECT MAX(data_date) FROM QH_WAT_DATA_TEMP WHERE bind_user_id = #{bindUserId})")
|
||||||
List<WatchDataTemperature> latestDataTempByUserId(@Param("bindUserId") String bindUserId);
|
List<WatchDataTemperature> latestDataTempByUserId(@Param("bindUserId") String bindUserId);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_data_workout
|
* @Description: QH_WAT_DATA_WORKOUT
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-08-08
|
* @Date: 2023-08-08
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import com.renkang.watch.entity.WatchDataWorkoutTrace;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_data_workout_trace
|
* @Description: QH_WAT_DATA_WORKOUT_TRACE
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-08-08
|
* @Date: 2023-08-08
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+2
-2
@@ -22,7 +22,7 @@ import java.util.Map;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_device
|
* @Description: QH_WAT_DEVICE
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-08-08
|
* @Date: 2023-08-08
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
@@ -66,7 +66,7 @@ public interface WatchDeviceMapper extends MPJBaseMapper<WatchDevice> {
|
|||||||
|
|
||||||
List<String> selectDeviceUserId(@Param("deptId") String deptId);
|
List<String> selectDeviceUserId(@Param("deptId") String deptId);
|
||||||
|
|
||||||
@Select(value = "SELECT SUBSTR(org_code, 1, 6) as orgCode, COUNT(1) as medicalCount FROM watch_device GROUP BY SUBSTR(org_code, 1, 6)")
|
@Select(value = "SELECT SUBSTR(org_code, 1, 6) as orgCode, COUNT(1) as medicalCount FROM QH_WAT_DEVICE GROUP BY SUBSTR(org_code, 1, 6)")
|
||||||
List<JSONObject> getWatchSum();
|
List<JSONObject> getWatchSum();
|
||||||
|
|
||||||
List<WearCount> selectWearCount(@Param("orgCodeList") List<String> orgCodeList);
|
List<WearCount> selectWearCount(@Param("orgCodeList") List<String> orgCodeList);
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import com.renkang.watch.entity.WatchDeviceSwitch;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_device_switch
|
* @Description: QH_WAT_DEVICE_SWITCH
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-08-08
|
* @Date: 2023-08-08
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import com.renkang.watch.entity.WatchKeyUser;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_device
|
* @Description: QH_WAT_DEVICE
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-08-08
|
* @Date: 2023-08-08
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+18
-18
@@ -16,10 +16,10 @@ import java.util.Map;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface WatchMapper {
|
public interface WatchMapper {
|
||||||
|
|
||||||
@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)")
|
@Select("SELECT TRUNC(SYSDATE - CAST(bind_date AS DATE)) AS days FROM (SELECT bind_date FROM QH_WAT_BIND_HIS WHERE bind_user_id = #{id} ORDER BY bind_date DESC FETCH FIRST 1 ROWS ONLY)")
|
||||||
Integer getUseDays(@Param("id") String id);
|
Integer getUseDays(@Param("id") String id);
|
||||||
|
|
||||||
@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")
|
@Select("SELECT LENGTH(nm.status) minutes, TO_CHAR(n.data_date,'YYYY-MM-DD') dataDate FROM QH_WAT_DATA_SLEEP_NEW_MIN nm LEFT JOIN QH_WAT_DATA_SLEEP_NEW n ON nm.sleep_id = n.id WHERE n.id = (SELECT id FROM QH_WAT_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);
|
WatchDataDTO getDataSleep(@Param("id") String id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,44 +27,44 @@ public interface WatchMapper {
|
|||||||
* @param id 用户 ID
|
* @param id 用户 ID
|
||||||
* @return
|
* @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 FETCH FIRST 1 ROWS ONLY")
|
@Select("SELECT long_duration_total minutes, data_date dataDate FROM QH_WAT_STAT_USER_DAY_SLE 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);
|
WatchDataDTO getDataSleepNew(@Param("id") String 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})")
|
@Select("SELECT AVG(ROUND((CAST(d.wake_up_time AS DATE) - CAST(d.fall_asleep_time AS DATE)) * 24 * 60)) AS aveMinute FROM QH_WAT_DATA_SLEEP_NEW_DAY d LEFT JOIN QH_WAT_DATA_SLEEP_NEW n ON d.sleep_id = n.id WHERE n.id IN (SELECT id FROM QH_WAT_DATA_SLEEP_NEW WHERE bind_user_id = #{id})")
|
||||||
Double getAverageSleep(@Param("id") String id);
|
Double getAverageSleep(@Param("id") String id);
|
||||||
|
|
||||||
@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")
|
@Select("SELECT MAX(data_value) dataValue, data_date dataDate FROM QH_WAT_DATA_STEPS WHERE bind_user_id = #{id} ORDER BY data_date DESC FETCH FIRST 1 ROWS ONLY")
|
||||||
WatchDataDTO getDataSteps(@Param("id") String id);
|
WatchDataDTO getDataSteps(@Param("id") String id);
|
||||||
|
|
||||||
@Select("SELECT SUM(data_value) FROM watch_data_distance WHERE bind_user_id = #{id}")
|
@Select("SELECT SUM(data_value) FROM QH_WAT_DATA_DISTANCE WHERE bind_user_id = #{id}")
|
||||||
Integer getDataDistance(@Param("id") String id);
|
Integer getDataDistance(@Param("id") String id);
|
||||||
|
|
||||||
@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")
|
@Select("SELECT CAST(data_value AS INTEGER) dataValue, data_date dataDate FROM QH_WAT_DATA_HEART_RATE WHERE bind_user_id = #{id} ORDER BY time_stamp DESC FETCH FIRST 1 ROWS ONLY")
|
||||||
WatchDataDTO getHeartRate(@Param("id") String id);
|
WatchDataDTO getHeartRate(@Param("id") String id);
|
||||||
|
|
||||||
@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")
|
@Select("SELECT CAST(data_value AS INTEGER) dataValue, data_date dataDate FROM QH_WAT_DATA_SPO2 WHERE bind_user_id = #{id} ORDER BY time_stamp DESC FETCH FIRST 1 ROWS ONLY")
|
||||||
WatchDataDTO getDataSpo2(@Param("id") String id);
|
WatchDataDTO getDataSpo2(@Param("id") String id);
|
||||||
|
|
||||||
@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")
|
@Select("SELECT CAST(data_value AS INTEGER) dataValue, data_date dataDate FROM QH_WAT_DATA_STRESS WHERE bind_user_id = #{id} ORDER BY end_time_stamp DESC FETCH FIRST 1 ROWS ONLY")
|
||||||
WatchDataDTO getStress(@Param("id") String id);
|
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 FETCH FIRST 1 ROWS ONLY")
|
@Select("SELECT data_value dataValue, data_date dataDate FROM QH_WAT_DATA_TEMP WHERE bind_user_id = #{id} ORDER BY time_stamp DESC FETCH FIRST 1 ROWS ONLY")
|
||||||
WatchDataDTO getTemp(@Param("id") String id);
|
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})")
|
@Select("SELECT * FROM QH_WAT_DATA_SLEEP_NEW_MIN WHERE sleep_id IN (SELECT id FROM QH_WAT_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);
|
List<WatchDataSleepNewMinute> getNewMinuteList(@Param("id") String id, @Param("date") Date date);
|
||||||
|
|
||||||
@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'")
|
@Select("SELECT DISTINCT data_date dateDate FROM QH_WAT_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<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);
|
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 QH_WAT_DATA_TEMP where bind_user_id = #{id} and data_date = #{date}")
|
||||||
Map<String, Object> getMapValue(@Param("id") String id, @Param("date") 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);
|
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 QH_WAT_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> getMapRate(@Param("id") String id, @Param("date") Date date);
|
||||||
|
|
||||||
Map<String, Object> getMapRateValue(@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);
|
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 QH_WAT_DATA_STRESS where bind_user_id = #{id} and data_date = #{date}")
|
||||||
Map<String, Object> getMapStress(@Param("id") String id, @Param("date") 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);
|
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 QH_WAT_DATA_SPO2 where bind_user_id = #{id} and data_date = #{date}")
|
||||||
Map<String, Object> getMapSpo2(@Param("id") String id, @Param("date") 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 FETCH FIRST 1 ROWS ONLY")
|
@Select("SELECT data_value lastValue FROM QH_WAT_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);
|
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);
|
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);
|
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 FETCH FIRST 1 ROWS ONLY")
|
@Select("SELECT watch_no FROM QH_WAT_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);
|
String getWatchNo(@Param("id") String id, @Param("date") String date);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -16,7 +16,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_monitor_data
|
* @Description: QH_WAT_MONITOR_DATA
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-08-08
|
* @Date: 2023-08-08
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
@@ -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);
|
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 EXTRACT(YEAR FROM warn_time) = #{year} AND event_type = 'fall_down'")
|
@Select("SELECT COUNT(1) FROM QH_WAT_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);
|
int selectUserFallNum(String userId,String year);
|
||||||
|
|
||||||
List<WatchMonitorData> selectParams(@Param("req") AloneReq req);
|
List<WatchMonitorData> selectParams(@Param("req") AloneReq req);
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import com.renkang.watch.entity.WatchMonitorMobile;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_monitor_mobile
|
* @Description: QH_WAT_MONITOR_MOBILE
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-08-08
|
* @Date: 2023-08-08
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import com.renkang.watch.entity.WatchMqttNotice;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_mqtt_notice
|
* @Description: QH_WAT_MQTT_NOTICE
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-08-08
|
* @Date: 2023-08-08
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_stat_user_info_day_heart_rate
|
* @Description: QH_WAT_STA_US_DAY_HEA_RAT
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-11-06
|
* @Date: 2023-11-06
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_stat_user_info_day_sdc
|
* @Description: QH_WAT_STAT_USER_DAY_SDC
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-11-06
|
* @Date: 2023-11-06
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_stat_user_info_day_sleep
|
* @Description: QH_WAT_STAT_USER_DAY_SLE
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-11-06
|
* @Date: 2023-11-06
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_stat_user_info_day_spo2
|
* @Description: QH_WAT_STAT_USER_DAY_SPO2
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-11-06
|
* @Date: 2023-11-06
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+2
-2
@@ -11,7 +11,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_stat_user_info_day_stress
|
* @Description: QH_WAT_STAT_USER_DAY_STRE
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-11-06
|
* @Date: 2023-11-06
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
@@ -28,7 +28,7 @@ public interface WatchStatUserInfoDayStressMapper extends MPJBaseMapper<WatchSta
|
|||||||
List<WatchDataStressRes> selectStressByYear(@Param("dateYear") Date dateYear, @Param("userId")String userId);
|
List<WatchDataStressRes> selectStressByYear(@Param("dateYear") Date dateYear, @Param("userId")String userId);
|
||||||
|
|
||||||
|
|
||||||
@Select("SELECT * FROM watch_stat_user_info_day_stress WHERE user_id = #{userId} AND data_date = #{dataDate} AND ROWNUM = 1")
|
@Select("SELECT * FROM QH_WAT_STAT_USER_DAY_STRE WHERE user_id = #{userId} AND data_date = #{dataDate} AND ROWNUM = 1")
|
||||||
WatchDataStressRes selectStressByUserIdAndDate(@Param("dateTime") Date dateTime, @Param("userId")String userId);
|
WatchDataStressRes selectStressByUserIdAndDate(@Param("dateTime") Date dateTime, @Param("userId")String userId);
|
||||||
|
|
||||||
void insertStat(WatchStatUserInfoDayStress watchStatUserInfoDayStress);
|
void insertStat(WatchStatUserInfoDayStress watchStatUserInfoDayStress);
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_stat_user_info_day_temp
|
* @Description: QH_WAT_STAT_USER_DAY_TEMP
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-11-06
|
* @Date: 2023-11-06
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import com.renkang.watch.entity.WatchStatUserInfoDayWorkout;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_stat_user_info_day_workout
|
* @Description: QH_WAT_STAT_USER_DAY_WORK
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-11-06
|
* @Date: 2023-11-06
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import com.renkang.watch.entity.WatchSynMaxId;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_syn_max_id
|
* @Description: QH_WAT_SYN_MAX_ID
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-08-08
|
* @Date: 2023-08-08
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
|
|||||||
+2
-2
@@ -11,7 +11,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: watch_user_data
|
* @Description: QH_WAT_USER_DATA
|
||||||
* @Author: jeecg-boot
|
* @Author: jeecg-boot
|
||||||
* @Date: 2023-08-08
|
* @Date: 2023-08-08
|
||||||
* @Version: V1.0
|
* @Version: V1.0
|
||||||
@@ -64,6 +64,6 @@ public interface WatchUserDataMapper extends BaseMapper<WatchUserData> {
|
|||||||
* @param watchNo
|
* @param watchNo
|
||||||
* @return
|
* @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 QH_WAT_USER_DATA where bind_user_id = #{userId} and watch_no = #{watchNo}")
|
||||||
Date lastDataDate(@Param("userId") String userId,@Param("watchNo") String watchNo);
|
Date lastDataDate(@Param("userId") String userId,@Param("watchNo") String watchNo);
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-8
@@ -9,7 +9,7 @@ import com.renkang.watch.bean.request.DepartStatsFilter;
|
|||||||
public class WatchStatisticsProvider {
|
public class WatchStatisticsProvider {
|
||||||
|
|
||||||
public String deviceNumsSql(DepartStatsFilter filter) {
|
public String deviceNumsSql(DepartStatsFilter filter) {
|
||||||
StringBuilder sb = new StringBuilder("select org_code, count(DISTINCT watch_no) as device_count from watch_device where 1=1 ");
|
StringBuilder sb = new StringBuilder("select org_code, count(DISTINCT watch_no) as device_count from QH_WAT_DEVICE where 1=1 ");
|
||||||
if (StrUtil.isNotBlank(filter.getOrgCode())) {
|
if (StrUtil.isNotBlank(filter.getOrgCode())) {
|
||||||
sb.append("and org_code = #{orgCode} ");
|
sb.append("and org_code = #{orgCode} ");
|
||||||
}
|
}
|
||||||
@@ -27,9 +27,9 @@ public class WatchStatisticsProvider {
|
|||||||
StringBuilder sb = new StringBuilder("select ");
|
StringBuilder sb = new StringBuilder("select ");
|
||||||
sb.append(orgCodeStr)
|
sb.append(orgCodeStr)
|
||||||
.append(" as org_code, count(distinct wd.watch_no) as bind_count, count(distinct wud.watch_no) as wear_count ")
|
.append(" as org_code, count(distinct wd.watch_no) as bind_count, count(distinct wud.watch_no) as wear_count ")
|
||||||
.append("from watch_device wd ")
|
.append("from QH_WAT_DEVICE wd ")
|
||||||
.append("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 ")
|
.append("left join QH_WAT_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 ")
|
||||||
.append("left join watch_user_data wud on wud.watch_no = wd.watch_no and wd.bind_user_id = wud.bind_user_id and wud.data_date between #{start} and #{end} ")
|
.append("left join QH_WAT_USER_DATA wud on wud.watch_no = wd.watch_no and wd.bind_user_id = wud.bind_user_id and wud.data_date between #{start} and #{end} ")
|
||||||
.append("where wd.bind_user_id is not null and wd.bind_user_id <> '' ");
|
.append("where wd.bind_user_id is not null and wd.bind_user_id <> '' ");
|
||||||
if (StrUtil.isNotEmpty(filter.getOrgCodeLeaf())) {
|
if (StrUtil.isNotEmpty(filter.getOrgCodeLeaf())) {
|
||||||
sb.append("and wbh.org_code like CONCAT(#{orgCodeLeaf},'%')");
|
sb.append("and wbh.org_code like CONCAT(#{orgCodeLeaf},'%')");
|
||||||
@@ -50,7 +50,7 @@ public class WatchStatisticsProvider {
|
|||||||
StringBuilder sb = new StringBuilder("select ");
|
StringBuilder sb = new StringBuilder("select ");
|
||||||
sb.append(orgCodeStr)
|
sb.append(orgCodeStr)
|
||||||
.append(" as org_code, event_type, count(distinct bind_user_id) as warning_count ")
|
.append(" as org_code, event_type, count(distinct bind_user_id) as warning_count ")
|
||||||
.append("from watch_monitor_data ")
|
.append("from QH_WAT_MONITOR_DATA ")
|
||||||
.append("where warn_time between TRUNC(#{start}) and TRUNC(#{end}) + 1 - 1/86400 ")
|
.append("where warn_time between TRUNC(#{start}) and TRUNC(#{end}) + 1 - 1/86400 ")
|
||||||
.append("and event_type in ('heart_rate','spo2','stress','temperature_anomalies') ");
|
.append("and event_type in ('heart_rate','spo2','stress','temperature_anomalies') ");
|
||||||
if (StrUtil.isNotEmpty(filter.getOrgCodeLeaf())) {
|
if (StrUtil.isNotEmpty(filter.getOrgCodeLeaf())) {
|
||||||
@@ -70,10 +70,10 @@ public class WatchStatisticsProvider {
|
|||||||
" wd.watch_no," +
|
" wd.watch_no," +
|
||||||
" max(wd.org_code) as watch_org_code," +
|
" max(wd.org_code) as watch_org_code," +
|
||||||
" LISTAGG(wud.data_date, ',') WITHIN GROUP (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" +
|
" FROM QH_WAT_DEVICE wd" +
|
||||||
" LEFT JOIN watch_bind_his wbh" +
|
" LEFT JOIN QH_WAT_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" +
|
" ON wd.watch_no = wbh.watch_no AND wd.bind_user_id = wbh.bind_user_id AND wbh.bind_end_date IS NULL" +
|
||||||
" LEFT JOIN watch_user_data wud ON wud.watch_no = wd.watch_no" +
|
" LEFT JOIN QH_WAT_USER_DATA wud ON wud.watch_no = wd.watch_no" +
|
||||||
" AND wd.bind_user_id = wud.bind_user_id AND wud.data_date between #{filter.start} and #{filter.end}" +
|
" AND wd.bind_user_id = wud.bind_user_id AND wud.data_date between #{filter.start} and #{filter.end}" +
|
||||||
" WHERE wd.bind_user_id IS NOT NULL AND wd.bind_user_id <> ''" +
|
" WHERE wd.bind_user_id IS NOT NULL AND wd.bind_user_id <> ''" +
|
||||||
" AND wbh.org_code like CONCAT(#{filter.orgCode},'%')" +
|
" AND wbh.org_code like CONCAT(#{filter.orgCode},'%')" +
|
||||||
|
|||||||
+8
-8
@@ -15,7 +15,7 @@
|
|||||||
type AS type,
|
type AS type,
|
||||||
last_update_time AS createDate
|
last_update_time AS createDate
|
||||||
FROM
|
FROM
|
||||||
watch_data
|
QH_WAT_DATA
|
||||||
WHERE
|
WHERE
|
||||||
userid = #{userId}
|
userid = #{userId}
|
||||||
AND type = 1
|
AND type = 1
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
type AS type,
|
type AS type,
|
||||||
create_date AS createDate
|
create_date AS createDate
|
||||||
FROM
|
FROM
|
||||||
archives_body_type
|
QH_WAT_ARCHIVES_BODY_TYPE
|
||||||
WHERE
|
WHERE
|
||||||
user_id = #{userId}
|
user_id = #{userId}
|
||||||
AND type = 1
|
AND type = 1
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
type AS type,
|
type AS type,
|
||||||
last_update_time AS createDate
|
last_update_time AS createDate
|
||||||
FROM
|
FROM
|
||||||
watch_data
|
QH_WAT_DATA
|
||||||
WHERE
|
WHERE
|
||||||
userid = #{userId}
|
userid = #{userId}
|
||||||
AND type = 5 UNION ALL
|
AND type = 5 UNION ALL
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
type AS type,
|
type AS type,
|
||||||
create_date AS createDate
|
create_date AS createDate
|
||||||
FROM
|
FROM
|
||||||
archives_body_type
|
QH_WAT_ARCHIVES_BODY_TYPE
|
||||||
WHERE
|
WHERE
|
||||||
user_id = #{userId}
|
user_id = #{userId}
|
||||||
AND type = 5
|
AND type = 5
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
type AS type,
|
type AS type,
|
||||||
last_update_time AS createDate
|
last_update_time AS createDate
|
||||||
FROM
|
FROM
|
||||||
watch_data
|
QH_WAT_DATA
|
||||||
WHERE
|
WHERE
|
||||||
userid = #{dto.userId}
|
userid = #{dto.userId}
|
||||||
AND type = 1
|
AND type = 1
|
||||||
@@ -94,7 +94,7 @@
|
|||||||
type AS type,
|
type AS type,
|
||||||
create_date AS createDate
|
create_date AS createDate
|
||||||
FROM
|
FROM
|
||||||
archives_body_type
|
QH_WAT_ARCHIVES_BODY_TYPE
|
||||||
WHERE
|
WHERE
|
||||||
user_id = #{dto.userId}
|
user_id = #{dto.userId}
|
||||||
AND type = 1
|
AND type = 1
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
type AS type,
|
type AS type,
|
||||||
last_update_time AS createDate
|
last_update_time AS createDate
|
||||||
FROM
|
FROM
|
||||||
watch_data
|
QH_WAT_DATA
|
||||||
WHERE
|
WHERE
|
||||||
userid = #{dto.userId}
|
userid = #{dto.userId}
|
||||||
AND type = 5
|
AND type = 5
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
type AS type,
|
type AS type,
|
||||||
create_date AS createDate
|
create_date AS createDate
|
||||||
FROM
|
FROM
|
||||||
archives_body_type
|
QH_WAT_ARCHIVES_BODY_TYPE
|
||||||
WHERE
|
WHERE
|
||||||
user_id = #{dto.userId}
|
user_id = #{dto.userId}
|
||||||
AND type = 5
|
AND type = 5
|
||||||
|
|||||||
+10
-10
@@ -8,7 +8,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
COUNT(DISTINCT user_id) c
|
COUNT(DISTINCT user_id) c
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_heart_rate
|
QH_WAT_STA_US_DAY_HEA_RAT
|
||||||
<where>
|
<where>
|
||||||
org_code like concat(#{orgCode},'%')
|
org_code like concat(#{orgCode},'%')
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
COUNT(DISTINCT user_id) c
|
COUNT(DISTINCT user_id) c
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_spo2
|
QH_WAT_STAT_USER_DAY_SPO2
|
||||||
<where>
|
<where>
|
||||||
org_code like concat(#{orgCode}, '%')
|
org_code like concat(#{orgCode}, '%')
|
||||||
and data_date =#{dataDate}
|
and data_date =#{dataDate}
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
COUNT(DISTINCT user_id) c
|
COUNT(DISTINCT user_id) c
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_stress
|
QH_WAT_STAT_USER_DAY_STRE
|
||||||
<where>
|
<where>
|
||||||
org_code like concat(#{orgCode}, '%')
|
org_code like concat(#{orgCode}, '%')
|
||||||
and data_date =#{dataDate}
|
and data_date =#{dataDate}
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
COUNT(DISTINCT user_id) c
|
COUNT(DISTINCT user_id) c
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_temp
|
QH_WAT_STAT_USER_DAY_TEMP
|
||||||
<where>
|
<where>
|
||||||
org_code like concat(#{orgCode}, '%')
|
org_code like concat(#{orgCode}, '%')
|
||||||
and data_date =#{dataDate}
|
and data_date =#{dataDate}
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
COUNT(DISTINCT user_id) c
|
COUNT(DISTINCT user_id) c
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_sleep
|
QH_WAT_STAT_USER_DAY_SLE
|
||||||
<where>
|
<where>
|
||||||
org_code like concat(#{orgCode}, '%')
|
org_code like concat(#{orgCode}, '%')
|
||||||
and data_date =#{dataDate}
|
and data_date =#{dataDate}
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
COUNT(DISTINCT user_id) c
|
COUNT(DISTINCT user_id) c
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_workout
|
QH_WAT_STAT_USER_DAY_WORK
|
||||||
<where>
|
<where>
|
||||||
org_code like concat(#{orgCode}, '%')
|
org_code like concat(#{orgCode}, '%')
|
||||||
and data_date =#{dataDate}
|
and data_date =#{dataDate}
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
COUNT(DISTINCT user_id) c
|
COUNT(DISTINCT user_id) c
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_sdc
|
QH_WAT_STAT_USER_DAY_SDC
|
||||||
<where>
|
<where>
|
||||||
org_code like concat(#{orgCode},'%')
|
org_code like concat(#{orgCode},'%')
|
||||||
and data_date =#{dataDate}
|
and data_date =#{dataDate}
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<select id="selectExistByOrgCodeOrLeaf" resultType="String">
|
<select id="selectExistByOrgCodeOrLeaf" resultType="String">
|
||||||
select id from dept_statistic_data where
|
select id from QH_WAT_DEPT_STAT_DATA where
|
||||||
data_date = #{dataDate}
|
data_date = #{dataDate}
|
||||||
AND org_code = #{orgCode}
|
AND org_code = #{orgCode}
|
||||||
AND org_code_leaf = #{orgCodeLeaf}
|
AND org_code_leaf = #{orgCodeLeaf}
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
SUM(seven_day_num) AS sevenDayNum,
|
SUM(seven_day_num) AS sevenDayNum,
|
||||||
SUM(thirty_day_num) AS thirtyDayNum
|
SUM(thirty_day_num) AS thirtyDayNum
|
||||||
FROM
|
FROM
|
||||||
dept_statistic_data
|
QH_WAT_DEPT_STAT_DATA
|
||||||
WHERE
|
WHERE
|
||||||
1=1
|
1=1
|
||||||
<if test="null != orgCode and '' != orgCode and orgCode != 'A01'.toString() ">
|
<if test="null != orgCode and '' != orgCode and orgCode != 'A01'.toString() ">
|
||||||
@@ -119,6 +119,6 @@
|
|||||||
<if test="null != orgCodeLeaf and '' != orgCodeLeaf and orgCodeLeaf != 'A01'.toString()">
|
<if test="null != orgCodeLeaf and '' != orgCodeLeaf and orgCodeLeaf != 'A01'.toString()">
|
||||||
AND org_code_leaf = #{orgCodeLeaf}
|
AND org_code_leaf = #{orgCodeLeaf}
|
||||||
</if>
|
</if>
|
||||||
AND data_date = (SELECT MAX(data_date) FROM dept_statistic_data)
|
AND data_date = (SELECT MAX(data_date) FROM QH_WAT_DEPT_STAT_DATA)
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
+38
-38
@@ -12,8 +12,8 @@
|
|||||||
wbh.dept_id as old_dept_id,
|
wbh.dept_id as old_dept_id,
|
||||||
wd.dept_id
|
wd.dept_id
|
||||||
FROM
|
FROM
|
||||||
watch_bind_his wbh
|
QH_WAT_BIND_HIS wbh
|
||||||
LEFT JOIN watch_device wd ON wbh.watch_no = wd.watch_no
|
LEFT JOIN QH_WAT_DEVICE wd ON wbh.watch_no = wd.watch_no
|
||||||
</sql>
|
</sql>
|
||||||
<select id="queryPageList" resultType="com.renkang.watch.vo.WatchBindHisVo" parameterType="com.renkang.watch.dto.WatchBindHisDTO">
|
<select id="queryPageList" resultType="com.renkang.watch.vo.WatchBindHisVo" parameterType="com.renkang.watch.dto.WatchBindHisDTO">
|
||||||
<include refid="selectWatchBindHisVo"></include>
|
<include refid="selectWatchBindHisVo"></include>
|
||||||
@@ -56,8 +56,8 @@
|
|||||||
SELECT
|
SELECT
|
||||||
t1.*
|
t1.*
|
||||||
FROM
|
FROM
|
||||||
watch_bind_his t1
|
QH_WAT_BIND_HIS t1
|
||||||
JOIN ( SELECT bind_user_id, MAX( id ) AS maxId FROM watch_bind_his GROUP BY bind_user_id ) b2 ON t1.bind_user_id = b2.bind_user_id
|
JOIN ( SELECT bind_user_id, MAX( id ) AS maxId FROM QH_WAT_BIND_HIS GROUP BY bind_user_id ) b2 ON t1.bind_user_id = b2.bind_user_id
|
||||||
AND t1.id = b2.maxId
|
AND t1.id = b2.maxId
|
||||||
<where>
|
<where>
|
||||||
<if test="watchNo != null and watchNo != ''">
|
<if test="watchNo != null and watchNo != ''">
|
||||||
@@ -83,12 +83,12 @@
|
|||||||
<select id="selectDeptIdWatchBindHis" resultType="String">
|
<select id="selectDeptIdWatchBindHis" resultType="String">
|
||||||
select
|
select
|
||||||
DISTINCT dept_id
|
DISTINCT dept_id
|
||||||
from watch_bind_his where bind_end_date is null
|
from QH_WAT_BIND_HIS where bind_end_date is null
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 逻辑更新,暂时二级部门-->
|
<!-- 逻辑更新,暂时二级部门-->
|
||||||
<select id="getWatchBindHis" resultType="com.renkang.watch.entity.WatchBindHis">
|
<select id="getWatchBindHis" resultType="com.renkang.watch.entity.WatchBindHis">
|
||||||
SELECT ( LEFT ( org_code, 9 ) ) as orgCode FROM watch_bind_his
|
SELECT ( LEFT ( org_code, 9 ) ) as orgCode FROM QH_WAT_BIND_HIS
|
||||||
<where>
|
<where>
|
||||||
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
||||||
<if test="orgCode != null and orgCode != ''">
|
<if test="orgCode != null and orgCode != ''">
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
watch_bind_his
|
QH_WAT_BIND_HIS
|
||||||
WHERE
|
WHERE
|
||||||
<foreach collection="orgCodeList" item="orgCode" open="(" close=")" separator=" OR ">
|
<foreach collection="orgCodeList" item="orgCode" open="(" close=")" separator=" OR ">
|
||||||
<if test="orgCode != null and orgCode != ''">
|
<if test="orgCode != null and orgCode != ''">
|
||||||
@@ -118,7 +118,7 @@
|
|||||||
and bind_date <= #{end}
|
and bind_date <= #{end}
|
||||||
</select>
|
</select>
|
||||||
<select id="getDataList" resultType="com.renkang.watch.entity.WatchBindHis">
|
<select id="getDataList" resultType="com.renkang.watch.entity.WatchBindHis">
|
||||||
SELECT ( LEFT ( org_code, 9 ) ) as orgCode FROM watch_bind_his
|
SELECT ( LEFT ( org_code, 9 ) ) as orgCode FROM QH_WAT_BIND_HIS
|
||||||
<where>
|
<where>
|
||||||
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
||||||
<if test="orgCode != null and orgCode != ''">
|
<if test="orgCode != null and orgCode != ''">
|
||||||
@@ -132,7 +132,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<update id="updateWatchDepart">
|
<update id="updateWatchDepart">
|
||||||
update watch_bind_his set
|
update QH_WAT_BIND_HIS set
|
||||||
dept_id = #{deptId},
|
dept_id = #{deptId},
|
||||||
org_code = #{orgCode}
|
org_code = #{orgCode}
|
||||||
where bind_user_id = #{bindUserId}
|
where bind_user_id = #{bindUserId}
|
||||||
@@ -140,7 +140,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<select id="selectDepartWatchDeviceUserNum" resultType="String">
|
<select id="selectDepartWatchDeviceUserNum" resultType="String">
|
||||||
select count(1) from watch_bind_his where bind_end_date is null and bind_user_id is not null and bind_user_id != ''
|
select count(1) from QH_WAT_BIND_HIS where bind_end_date is null and bind_user_id is not null and bind_user_id != ''
|
||||||
AND org_code like concat(#{orgCode},'_%')
|
AND org_code like concat(#{orgCode},'_%')
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -148,14 +148,14 @@
|
|||||||
select
|
select
|
||||||
bind_user_id as "bindUserId",
|
bind_user_id as "bindUserId",
|
||||||
LEFT(org_code,9) as "orgCode"
|
LEFT(org_code,9) as "orgCode"
|
||||||
from watch_bind_his
|
from QH_WAT_BIND_HIS
|
||||||
where bind_end_date is null
|
where bind_end_date is null
|
||||||
</select>
|
</select>
|
||||||
<select id="getWornDays" resultType="com.renkang.watch.entity.WatchBindHis">
|
<select id="getWornDays" resultType="com.renkang.watch.entity.WatchBindHis">
|
||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
watch_bind_his
|
QH_WAT_BIND_HIS
|
||||||
WHERE
|
WHERE
|
||||||
bind_user_id = #{userId}
|
bind_user_id = #{userId}
|
||||||
AND
|
AND
|
||||||
@@ -175,7 +175,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
watch_bind_his
|
QH_WAT_BIND_HIS
|
||||||
WHERE
|
WHERE
|
||||||
<foreach collection="orgCodeList" item="orgCode" open="(" close=")" separator=" OR ">
|
<foreach collection="orgCodeList" item="orgCode" open="(" close=")" separator=" OR ">
|
||||||
<if test="orgCode != null and orgCode != ''">
|
<if test="orgCode != null and orgCode != ''">
|
||||||
@@ -190,7 +190,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
DISTINCT (bind_user_id) as bindUserId
|
DISTINCT (bind_user_id) as bindUserId
|
||||||
FROM
|
FROM
|
||||||
watch_bind_his
|
QH_WAT_BIND_HIS
|
||||||
<where>
|
<where>
|
||||||
org_code LIKE concat(#{orgCode}, '%')
|
org_code LIKE concat(#{orgCode}, '%')
|
||||||
AND
|
AND
|
||||||
@@ -212,7 +212,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
DISTINCT (bind_user_id) as bindUserId
|
DISTINCT (bind_user_id) as bindUserId
|
||||||
FROM
|
FROM
|
||||||
watch_bind_his
|
QH_WAT_BIND_HIS
|
||||||
WHERE
|
WHERE
|
||||||
org_code LIKE concat(#{orgCode},'%')
|
org_code LIKE concat(#{orgCode},'%')
|
||||||
and
|
and
|
||||||
@@ -231,7 +231,7 @@
|
|||||||
<select id="getWatchBindHis1" resultType="com.renkang.watch.entity.WatchBindHis">
|
<select id="getWatchBindHis1" resultType="com.renkang.watch.entity.WatchBindHis">
|
||||||
|
|
||||||
|
|
||||||
SELECT ( LEFT ( org_code, 6 ) ) as orgCode FROM watch_bind_his
|
SELECT ( LEFT ( org_code, 6 ) ) as orgCode FROM QH_WAT_BIND_HIS
|
||||||
<where>
|
<where>
|
||||||
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
||||||
<if test="orgCode != null and orgCode != ''">
|
<if test="orgCode != null and orgCode != ''">
|
||||||
@@ -243,7 +243,7 @@
|
|||||||
( LEFT ( org_code, 6 ) )
|
( LEFT ( org_code, 6 ) )
|
||||||
UNION
|
UNION
|
||||||
|
|
||||||
SELECT ( LEFT ( org_code, 9 ) ) as orgCode FROM watch_bind_his
|
SELECT ( LEFT ( org_code, 9 ) ) as orgCode FROM QH_WAT_BIND_HIS
|
||||||
<where>
|
<where>
|
||||||
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
||||||
<if test="orgCode != null and orgCode != ''">
|
<if test="orgCode != null and orgCode != ''">
|
||||||
@@ -255,7 +255,7 @@
|
|||||||
( LEFT ( org_code, 9 ) )
|
( LEFT ( org_code, 9 ) )
|
||||||
</select>
|
</select>
|
||||||
<select id="getDataList1" resultType="com.renkang.watch.entity.WatchBindHis">
|
<select id="getDataList1" resultType="com.renkang.watch.entity.WatchBindHis">
|
||||||
SELECT ( LEFT ( org_code, 6 ) ) as orgCode FROM watch_bind_his
|
SELECT ( LEFT ( org_code, 6 ) ) as orgCode FROM QH_WAT_BIND_HIS
|
||||||
<where>
|
<where>
|
||||||
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
||||||
<if test="orgCode != null and orgCode != ''">
|
<if test="orgCode != null and orgCode != ''">
|
||||||
@@ -267,7 +267,7 @@
|
|||||||
( LEFT ( org_code, 6 ) )
|
( LEFT ( org_code, 6 ) )
|
||||||
UNION
|
UNION
|
||||||
|
|
||||||
SELECT ( LEFT ( org_code, 9 ) ) as orgCode FROM watch_bind_his
|
SELECT ( LEFT ( org_code, 9 ) ) as orgCode FROM QH_WAT_BIND_HIS
|
||||||
<where>
|
<where>
|
||||||
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
||||||
<if test="orgCode != null and orgCode != ''">
|
<if test="orgCode != null and orgCode != ''">
|
||||||
@@ -282,7 +282,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
watch_bind_his
|
QH_WAT_BIND_HIS
|
||||||
WHERE
|
WHERE
|
||||||
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
||||||
<if test="orgCode != null and orgCode != ''">
|
<if test="orgCode != null and orgCode != ''">
|
||||||
@@ -314,7 +314,7 @@
|
|||||||
dept_id as "deptId",
|
dept_id as "deptId",
|
||||||
org_code as "orgCode"
|
org_code as "orgCode"
|
||||||
FROM
|
FROM
|
||||||
watch_bind_his
|
QH_WAT_BIND_HIS
|
||||||
<where>
|
<where>
|
||||||
and bind_end_date is null
|
and bind_end_date is null
|
||||||
<if test="user.watchNo != null and user.watchNo != ''">
|
<if test="user.watchNo != null and user.watchNo != ''">
|
||||||
@@ -342,7 +342,7 @@
|
|||||||
<select id="getWatchBindHisNew" resultType="com.renkang.watch.entity.WatchBindHis">
|
<select id="getWatchBindHisNew" resultType="com.renkang.watch.entity.WatchBindHis">
|
||||||
select
|
select
|
||||||
org_code AS "orgCode"
|
org_code AS "orgCode"
|
||||||
from watch_device
|
from QH_WAT_DEVICE
|
||||||
where 1 = 1
|
where 1 = 1
|
||||||
and DATE (create_date) <![CDATA[ <= ]]> #{endDate}
|
and DATE (create_date) <![CDATA[ <= ]]> #{endDate}
|
||||||
<if test="orgCodes != null and orgCodes.size() > 0">
|
<if test="orgCodes != null and orgCodes.size() > 0">
|
||||||
@@ -360,7 +360,7 @@
|
|||||||
<select id="getWatchBindHisNewHaveOrgCodeOrOrgCodeLeaf" resultType="com.renkang.watch.entity.WatchBindHis">
|
<select id="getWatchBindHisNewHaveOrgCodeOrOrgCodeLeaf" resultType="com.renkang.watch.entity.WatchBindHis">
|
||||||
select
|
select
|
||||||
org_code AS "orgCode"
|
org_code AS "orgCode"
|
||||||
from watch_device
|
from QH_WAT_DEVICE
|
||||||
where 1 = 1
|
where 1 = 1
|
||||||
and DATE (create_date) <![CDATA[ <= ]]> #{endDate}
|
and DATE (create_date) <![CDATA[ <= ]]> #{endDate}
|
||||||
<if test="orgCodes != null and orgCodes.size() > 0">
|
<if test="orgCodes != null and orgCodes.size() > 0">
|
||||||
@@ -384,7 +384,7 @@
|
|||||||
org_code,
|
org_code,
|
||||||
@row_number:=IF(@watch_no = watch_no, @row_number + 1, 1) AS rn,
|
@row_number:=IF(@watch_no = watch_no, @row_number + 1, 1) AS rn,
|
||||||
@watch_no:=watch_no AS dummy
|
@watch_no:=watch_no AS dummy
|
||||||
FROM watch_bind_his,
|
FROM QH_WAT_BIND_HIS,
|
||||||
(SELECT @row_number:=0, @watch_no:='') AS t
|
(SELECT @row_number:=0, @watch_no:='') AS t
|
||||||
WHERE (bind_end_date IS NULL OR bind_end_date <= #{endDate})
|
WHERE (bind_end_date IS NULL OR bind_end_date <= #{endDate})
|
||||||
<if test="orgCodes != null and orgCodes.size() > 0">
|
<if test="orgCodes != null and orgCodes.size() > 0">
|
||||||
@@ -410,8 +410,8 @@
|
|||||||
SELECT
|
SELECT
|
||||||
a.*
|
a.*
|
||||||
FROM
|
FROM
|
||||||
watch_bind_his a
|
QH_WAT_BIND_HIS a
|
||||||
left join watch_device b on a.watch_no = b.watch_no
|
left join QH_WAT_DEVICE b on a.watch_no = b.watch_no
|
||||||
WHERE (LEFT(a.org_code, 6 )) = b.org_code
|
WHERE (LEFT(a.org_code, 6 )) = b.org_code
|
||||||
<if test="orgCodes != null and orgCodes.size() > 0">
|
<if test="orgCodes != null and orgCodes.size() > 0">
|
||||||
and
|
and
|
||||||
@@ -440,11 +440,11 @@
|
|||||||
SELECT
|
SELECT
|
||||||
wbh.*
|
wbh.*
|
||||||
FROM
|
FROM
|
||||||
watch_bind_his wbh
|
QH_WAT_BIND_HIS wbh
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
watch_device wd ON wbh.watch_no = wd.watch_no AND (LEFT(wbh.org_code, 6 )) = wd.org_code
|
QH_WAT_DEVICE wd ON wbh.watch_no = wd.watch_no AND (LEFT(wbh.org_code, 6 )) = wd.org_code
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
watch_bind_his wbh2 ON wbh.watch_no = wbh2.watch_no AND wbh2.bind_end_date IS NULL
|
QH_WAT_BIND_HIS wbh2 ON wbh.watch_no = wbh2.watch_no AND wbh2.bind_end_date IS NULL
|
||||||
WHERE
|
WHERE
|
||||||
(wbh.bind_date <= #{endTime})
|
(wbh.bind_date <= #{endTime})
|
||||||
AND ((wbh.bind_end_date BETWEEN #{startTime} AND #{endTime}) OR wbh.bind_end_date IS NULL)
|
AND ((wbh.bind_end_date BETWEEN #{startTime} AND #{endTime}) OR wbh.bind_end_date IS NULL)
|
||||||
@@ -467,11 +467,11 @@
|
|||||||
DISTINCT wbh.bind_user_id as bindUserId,
|
DISTINCT wbh.bind_user_id as bindUserId,
|
||||||
wbh.bind_date as "bindDate"
|
wbh.bind_date as "bindDate"
|
||||||
FROM
|
FROM
|
||||||
watch_bind_his wbh
|
QH_WAT_BIND_HIS wbh
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
watch_device wd ON wbh.watch_no = wd.watch_no AND (LEFT(wbh.org_code, 6 )) = wd.org_code
|
QH_WAT_DEVICE wd ON wbh.watch_no = wd.watch_no AND (LEFT(wbh.org_code, 6 )) = wd.org_code
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
watch_bind_his wbh2 ON wbh.watch_no = wbh2.watch_no AND wbh2.bind_end_date IS NULL
|
QH_WAT_BIND_HIS wbh2 ON wbh.watch_no = wbh2.watch_no AND wbh2.bind_end_date IS NULL
|
||||||
WHERE
|
WHERE
|
||||||
(wbh.bind_date <= #{endTime})
|
(wbh.bind_date <= #{endTime})
|
||||||
AND ((wbh.bind_end_date BETWEEN #{startTime} AND #{endTime}) OR wbh.bind_end_date IS NULL)
|
AND ((wbh.bind_end_date BETWEEN #{startTime} AND #{endTime}) OR wbh.bind_end_date IS NULL)
|
||||||
@@ -485,11 +485,11 @@
|
|||||||
DISTINCT wbh.bind_user_id as bindUserId,
|
DISTINCT wbh.bind_user_id as bindUserId,
|
||||||
wbh.bind_date as "bindDate"
|
wbh.bind_date as "bindDate"
|
||||||
FROM
|
FROM
|
||||||
watch_bind_his wbh
|
QH_WAT_BIND_HIS wbh
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
watch_device wd ON wbh.watch_no = wd.watch_no AND (LEFT(wbh.org_code, 6 )) = wd.org_code
|
QH_WAT_DEVICE wd ON wbh.watch_no = wd.watch_no AND (LEFT(wbh.org_code, 6 )) = wd.org_code
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
watch_bind_his wbh2 ON wbh.watch_no = wbh2.watch_no AND wbh2.bind_end_date IS NULL
|
QH_WAT_BIND_HIS wbh2 ON wbh.watch_no = wbh2.watch_no AND wbh2.bind_end_date IS NULL
|
||||||
WHERE
|
WHERE
|
||||||
(wbh.bind_date <= #{endTime})
|
(wbh.bind_date <= #{endTime})
|
||||||
AND ((wbh.bind_end_date BETWEEN #{startTime} AND #{endTime}) OR wbh.bind_end_date IS NULL)
|
AND ((wbh.bind_end_date BETWEEN #{startTime} AND #{endTime}) OR wbh.bind_end_date IS NULL)
|
||||||
@@ -501,11 +501,11 @@
|
|||||||
SELECT
|
SELECT
|
||||||
wbh.bind_user_id
|
wbh.bind_user_id
|
||||||
FROM
|
FROM
|
||||||
watch_bind_his wbh
|
QH_WAT_BIND_HIS wbh
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
watch_device wd ON wbh.watch_no = wd.watch_no
|
QH_WAT_DEVICE wd ON wbh.watch_no = wd.watch_no
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
watch_bind_his wbh2 ON wbh.watch_no = wbh2.watch_no AND wbh2.bind_end_date IS NULL
|
QH_WAT_BIND_HIS wbh2 ON wbh.watch_no = wbh2.watch_no AND wbh2.bind_end_date IS NULL
|
||||||
WHERE
|
WHERE
|
||||||
(wbh.bind_date <= #{endTime})
|
(wbh.bind_date <= #{endTime})
|
||||||
AND ((wbh.bind_end_date BETWEEN #{startTime} AND #{endTime}) OR wbh.bind_end_date IS NULL)
|
AND ((wbh.bind_end_date BETWEEN #{startTime} AND #{endTime}) OR wbh.bind_end_date IS NULL)
|
||||||
|
|||||||
+2
-2
@@ -5,7 +5,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
"watch_data_heart_rate"
|
"QH_WAT_DATA_HEART_RATE"
|
||||||
WHERE
|
WHERE
|
||||||
EXTRACT(YEAR FROM data_date) = #{req.dateYear}
|
EXTRACT(YEAR FROM data_date) = #{req.dateYear}
|
||||||
AND
|
AND
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
<select id="selectHeartRateByUserIdAndMaxIdAndDate" resultType="com.renkang.watch.entity.WatchDataHeartRate">
|
<select id="selectHeartRateByUserIdAndMaxIdAndDate" resultType="com.renkang.watch.entity.WatchDataHeartRate">
|
||||||
select
|
select
|
||||||
*
|
*
|
||||||
from watch_data_heart_rate
|
from QH_WAT_DATA_HEART_RATE
|
||||||
where
|
where
|
||||||
bind_user_id = #{userId}
|
bind_user_id = #{userId}
|
||||||
and DATE(time_stamp) = DATE(#{dataTime})
|
and DATE(time_stamp) = DATE(#{dataTime})
|
||||||
|
|||||||
+59
-59
@@ -7,8 +7,8 @@
|
|||||||
wd.orgcode,
|
wd.orgcode,
|
||||||
wd.watch_no,
|
wd.watch_no,
|
||||||
device.bind_date
|
device.bind_date
|
||||||
FROM watch_data wd
|
FROM QH_WAT_DATA wd
|
||||||
LEFT JOIN watch_device device ON wd.watch_no = device.watch_no
|
LEFT JOIN QH_WAT_DEVICE device ON wd.watch_no = device.watch_no
|
||||||
WHERE wd.id = #{id}
|
WHERE wd.id = #{id}
|
||||||
</select>
|
</select>
|
||||||
<select id="pageCustom" resultType="com.renkang.watch.entity.WatchData">
|
<select id="pageCustom" resultType="com.renkang.watch.entity.WatchData">
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
orgcode,
|
orgcode,
|
||||||
watch_no
|
watch_no
|
||||||
FROM
|
FROM
|
||||||
watch_data
|
QH_WAT_DATA
|
||||||
<where>
|
<where>
|
||||||
<if test="watchData.orgcode !=null and watchData.orgcode !=''">
|
<if test="watchData.orgcode !=null and watchData.orgcode !=''">
|
||||||
AND orgcode LIKE CONCAT( #{watchData.orgcode}, '%')
|
AND orgcode LIKE CONCAT( #{watchData.orgcode}, '%')
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
count( DISTINCT userid )
|
count( DISTINCT userid )
|
||||||
FROM
|
FROM
|
||||||
watch_data
|
QH_WAT_DATA
|
||||||
WHERE
|
WHERE
|
||||||
last_update_time BETWEEN #{startTime}
|
last_update_time BETWEEN #{startTime}
|
||||||
AND #{dataDate}
|
AND #{dataDate}
|
||||||
@@ -63,25 +63,25 @@
|
|||||||
|
|
||||||
from
|
from
|
||||||
<if test="type==1">
|
<if test="type==1">
|
||||||
watch_stat_user_info_day_heart_rate
|
QH_WAT_STA_US_DAY_HEA_RAT
|
||||||
</if>
|
</if>
|
||||||
<if test="type==2">
|
<if test="type==2">
|
||||||
watch_stat_user_info_day_spo2
|
QH_WAT_STAT_USER_DAY_SPO2
|
||||||
</if>
|
</if>
|
||||||
<if test="type==3">
|
<if test="type==3">
|
||||||
watch_stat_user_info_day_stress
|
QH_WAT_STAT_USER_DAY_STRE
|
||||||
</if>
|
</if>
|
||||||
<if test="type==4">
|
<if test="type==4">
|
||||||
watch_stat_user_info_day_sleep
|
QH_WAT_STAT_USER_DAY_SLE
|
||||||
</if>
|
</if>
|
||||||
<if test="type==5">
|
<if test="type==5">
|
||||||
watch_stat_user_info_day_temp
|
QH_WAT_STAT_USER_DAY_TEMP
|
||||||
</if>
|
</if>
|
||||||
<if test="type==6">
|
<if test="type==6">
|
||||||
watch_stat_user_info_day_workout
|
QH_WAT_STAT_USER_DAY_WORK
|
||||||
</if>
|
</if>
|
||||||
<if test="type==7">
|
<if test="type==7">
|
||||||
watch_stat_user_info_day_sdc
|
QH_WAT_STAT_USER_DAY_SDC
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
<select id="selectSevenActiveList" resultType="com.renkang.watch.entity.WatchData">
|
<select id="selectSevenActiveList" resultType="com.renkang.watch.entity.WatchData">
|
||||||
select
|
select
|
||||||
orgcode, NVL(COUNT(DISTINCT userid),0) AS "type"
|
orgcode, NVL(COUNT(DISTINCT userid),0) AS "type"
|
||||||
from watch_data
|
from QH_WAT_DATA
|
||||||
WHERE last_update_time >= SYSDATE - 6
|
WHERE last_update_time >= SYSDATE - 6
|
||||||
GROUP BY orgcode
|
GROUP BY orgcode
|
||||||
</select>
|
</select>
|
||||||
@@ -98,14 +98,14 @@
|
|||||||
<select id="selectThirtyActiveList" resultType="com.renkang.watch.entity.WatchData">
|
<select id="selectThirtyActiveList" resultType="com.renkang.watch.entity.WatchData">
|
||||||
select
|
select
|
||||||
orgcode, NVL(COUNT(DISTINCT userid),0) AS "type"
|
orgcode, NVL(COUNT(DISTINCT userid),0) AS "type"
|
||||||
from watch_data
|
from QH_WAT_DATA
|
||||||
WHERE last_update_time >= SYSDATE - 29
|
WHERE last_update_time >= SYSDATE - 29
|
||||||
GROUP BY orgcode
|
GROUP BY orgcode
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<update id="changeWatchDateOrgCode">
|
<update id="changeWatchDateOrgCode">
|
||||||
update watch_data set
|
update QH_WAT_DATA set
|
||||||
orgcode = #{orgcode}
|
orgcode = #{orgcode}
|
||||||
where userid = #{userid}
|
where userid = #{userid}
|
||||||
</update>
|
</update>
|
||||||
@@ -113,48 +113,48 @@
|
|||||||
|
|
||||||
<select id="selectBindStartTime" resultType="Date">
|
<select id="selectBindStartTime" resultType="Date">
|
||||||
select min(last_update_time)
|
select min(last_update_time)
|
||||||
from watch_data
|
from QH_WAT_DATA
|
||||||
where userid = #{userid}
|
where userid = #{userid}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectBindEndTime" resultType="Date">
|
<select id="selectBindEndTime" resultType="Date">
|
||||||
select max(last_update_time)
|
select max(last_update_time)
|
||||||
from watch_data
|
from QH_WAT_DATA
|
||||||
where userid = #{userid}
|
where userid = #{userid}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectWatchDateSevenHaveData" resultType="String">
|
<select id="selectWatchDateSevenHaveData" resultType="String">
|
||||||
SELECT count(1)
|
SELECT count(1)
|
||||||
FROM watch_data
|
FROM QH_WAT_DATA
|
||||||
WHERE watch_no = #{watchNo}
|
WHERE watch_no = #{watchNo}
|
||||||
AND last_update_time >= SYSDATE - 7
|
AND last_update_time >= SYSDATE - 7
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertHeartRate">
|
<insert id="insertHeartRate">
|
||||||
insert into watch_data(id, userid, username, orgcode, watch_no, type, data_value, last_update_time)
|
insert into QH_WAT_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
|
(select #{id,jdbcType=VARCHAR}, bind_user_id, #{username,jdbcType=VARCHAR}, #{orgcode,jdbcType=VARCHAR}, watch_no, 1, data_value, data_date
|
||||||
from (select bind_user_id, watch_no, data_value, data_date,
|
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
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
||||||
from watch_data_heart_rate
|
from QH_WAT_DATA_HEART_RATE
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR})
|
and watch_no = #{watchNo,jdbcType=VARCHAR})
|
||||||
where rn = 1);
|
where rn = 1);
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateHeartRate">
|
<update id="updateHeartRate">
|
||||||
update watch_data wd
|
update QH_WAT_DATA wd
|
||||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||||
wd.data_value = (select data_value from (
|
wd.data_value = (select data_value from (
|
||||||
select bind_user_id, data_value, data_date,
|
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
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
||||||
from watch_data_heart_rate
|
from QH_WAT_DATA_HEART_RATE
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
) where rn = 1),
|
) where rn = 1),
|
||||||
wd.last_update_time = (select data_date from (
|
wd.last_update_time = (select data_date from (
|
||||||
select bind_user_id, data_date,
|
select bind_user_id, data_date,
|
||||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
||||||
from watch_data_heart_rate
|
from QH_WAT_DATA_HEART_RATE
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
) where rn = 1)
|
) where rn = 1)
|
||||||
@@ -164,30 +164,30 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<insert id="insertSpo2">
|
<insert id="insertSpo2">
|
||||||
insert into watch_data(id, userid, username, orgcode, watch_no, type, data_value, last_update_time)
|
insert into QH_WAT_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
|
(select #{id,jdbcType=VARCHAR}, bind_user_id, #{username,jdbcType=VARCHAR}, #{orgcode,jdbcType=VARCHAR}, watch_no, 2, data_value, data_date
|
||||||
from (select bind_user_id, watch_no, data_value, data_date,
|
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
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
||||||
from watch_data_spo2
|
from QH_WAT_DATA_SPO2
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR})
|
and watch_no = #{watchNo,jdbcType=VARCHAR})
|
||||||
where rn = 1);
|
where rn = 1);
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateSpo2">
|
<update id="updateSpo2">
|
||||||
update watch_data wd
|
update QH_WAT_DATA wd
|
||||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||||
wd.data_value = (select data_value from (
|
wd.data_value = (select data_value from (
|
||||||
select bind_user_id, data_value, data_date,
|
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
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
||||||
from watch_data_spo2
|
from QH_WAT_DATA_SPO2
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
) where rn = 1),
|
) where rn = 1),
|
||||||
wd.last_update_time = (select data_date from (
|
wd.last_update_time = (select data_date from (
|
||||||
select bind_user_id, data_date,
|
select bind_user_id, data_date,
|
||||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
||||||
from watch_data_spo2
|
from QH_WAT_DATA_SPO2
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
) where rn = 1)
|
) where rn = 1)
|
||||||
@@ -197,30 +197,30 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<insert id="insertStress">
|
<insert id="insertStress">
|
||||||
insert into watch_data(id, userid, username, orgcode, watch_no, type, data_value, last_update_time)
|
insert into QH_WAT_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
|
(select #{id,jdbcType=VARCHAR}, bind_user_id, #{username,jdbcType=VARCHAR}, #{orgcode,jdbcType=VARCHAR}, watch_no, 3, data_value, data_date
|
||||||
from (select bind_user_id, watch_no, data_value, data_date,
|
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
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY start_time_stamp desc) as rn
|
||||||
from watch_data_stress
|
from QH_WAT_DATA_STRESS
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR})
|
and watch_no = #{watchNo,jdbcType=VARCHAR})
|
||||||
where rn = 1);
|
where rn = 1);
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateStress">
|
<update id="updateStress">
|
||||||
update watch_data wd
|
update QH_WAT_DATA wd
|
||||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||||
wd.data_value = (select data_value from (
|
wd.data_value = (select data_value from (
|
||||||
select bind_user_id, data_value, data_date,
|
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
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY start_time_stamp desc) as rn
|
||||||
from watch_data_stress
|
from QH_WAT_DATA_STRESS
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
) where rn = 1),
|
) where rn = 1),
|
||||||
wd.last_update_time = (select data_date from (
|
wd.last_update_time = (select data_date from (
|
||||||
select bind_user_id, data_date,
|
select bind_user_id, data_date,
|
||||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY start_time_stamp desc) as rn
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY start_time_stamp desc) as rn
|
||||||
from watch_data_stress
|
from QH_WAT_DATA_STRESS
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
) where rn = 1)
|
) where rn = 1)
|
||||||
@@ -230,12 +230,12 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<insert id="insertSleep">
|
<insert id="insertSleep">
|
||||||
insert into watch_data(id, userid, username, orgcode, watch_no, type, data_value, last_update_time)
|
insert into QH_WAT_DATA (id, userid, username, orgcode, watch_no, type, data_value, last_update_time)
|
||||||
(select #{id,jdbcType=VARCHAR}, bind_user_id,
|
(select #{id,jdbcType=VARCHAR}, bind_user_id,
|
||||||
#{username,jdbcType=VARCHAR}, #{orgcode,jdbcType=VARCHAR}, #{watchNo,jdbcType=VARCHAR}, 4,
|
#{username,jdbcType=VARCHAR}, #{orgcode,jdbcType=VARCHAR}, #{watchNo,jdbcType=VARCHAR}, 4,
|
||||||
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
|
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
|
from QH_WAT_DATA_SLEEP_NEW s
|
||||||
left join watch_data_sleep_new_minute sm on s.id = sm.sleep_id
|
left join QH_WAT_DATA_SLEEP_NEW_MIN sm on s.id = sm.sleep_id
|
||||||
where s.bind_user_id = #{userid,jdbcType=VARCHAR}
|
where s.bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and s.watch_no = #{watchNo,jdbcType=VARCHAR}
|
and s.watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
and s.sleep_flag = '1'
|
and s.sleep_flag = '1'
|
||||||
@@ -245,11 +245,11 @@
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateSleep">
|
<update id="updateSleep">
|
||||||
update watch_data wd
|
update QH_WAT_DATA wd
|
||||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
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)
|
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
|
from QH_WAT_DATA_SLEEP_NEW s
|
||||||
left join watch_data_sleep_new_minute sm on s.id = sm.sleep_id
|
left join QH_WAT_DATA_SLEEP_NEW_MIN sm on s.id = sm.sleep_id
|
||||||
where s.bind_user_id = #{userid,jdbcType=VARCHAR}
|
where s.bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and s.watch_no = #{watchNo,jdbcType=VARCHAR}
|
and s.watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
and s.sleep_flag = '1'
|
and s.sleep_flag = '1'
|
||||||
@@ -258,7 +258,7 @@
|
|||||||
FETCH FIRST 1 ROWS ONLY),
|
FETCH FIRST 1 ROWS ONLY),
|
||||||
wd.last_update_time = (select data_date from (
|
wd.last_update_time = (select data_date from (
|
||||||
select data_date
|
select data_date
|
||||||
from watch_data_sleep_new
|
from QH_WAT_DATA_SLEEP_NEW
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
and sleep_flag = '1'
|
and sleep_flag = '1'
|
||||||
@@ -270,30 +270,30 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<insert id="insertTemperature">
|
<insert id="insertTemperature">
|
||||||
insert into watch_data(id, userid, username, orgcode, watch_no, type, data_value, last_update_time)
|
insert into QH_WAT_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
|
(select #{id,jdbcType=VARCHAR}, bind_user_id, #{username,jdbcType=VARCHAR}, #{orgcode,jdbcType=VARCHAR}, watch_no, 5, data_value, data_date
|
||||||
from (select bind_user_id, watch_no, data_value, data_date,
|
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
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
||||||
from watch_data_temperature
|
from QH_WAT_DATA_TEMP
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR})
|
and watch_no = #{watchNo,jdbcType=VARCHAR})
|
||||||
where rn = 1);
|
where rn = 1);
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateTemperature">
|
<update id="updateTemperature">
|
||||||
update watch_data wd
|
update QH_WAT_DATA wd
|
||||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||||
wd.data_value = (select data_value from (
|
wd.data_value = (select data_value from (
|
||||||
select bind_user_id, data_value, data_date,
|
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
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
||||||
from watch_data_temperature
|
from QH_WAT_DATA_TEMP
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
) where rn = 1),
|
) where rn = 1),
|
||||||
wd.last_update_time = (select data_date from (
|
wd.last_update_time = (select data_date from (
|
||||||
select bind_user_id, data_date,
|
select bind_user_id, data_date,
|
||||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY time_stamp desc) as rn
|
||||||
from watch_data_temperature
|
from QH_WAT_DATA_TEMP
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
) where rn = 1)
|
) where rn = 1)
|
||||||
@@ -303,11 +303,11 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<insert id="insertWorkout">
|
<insert id="insertWorkout">
|
||||||
insert into watch_data(id, userid, username, orgcode, watch_no, type, data_value, last_update_time)
|
insert into QH_WAT_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
|
(select #{id,jdbcType=VARCHAR}, bind_user_id, #{username,jdbcType=VARCHAR}, #{orgcode,jdbcType=VARCHAR}, watch_no, 6, sum(calorie), data_date
|
||||||
from (select bind_user_id, watch_no, sum(calorie) as calorie, data_date,
|
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
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
||||||
from watch_data_workout
|
from QH_WAT_DATA_WORKOUT
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
group by bind_user_id, watch_no, data_date)
|
group by bind_user_id, watch_no, data_date)
|
||||||
@@ -315,12 +315,12 @@
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateWorkout">
|
<update id="updateWorkout">
|
||||||
update watch_data wd
|
update QH_WAT_DATA wd
|
||||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||||
wd.data_value = (select sum(calorie) from (
|
wd.data_value = (select sum(calorie) from (
|
||||||
select bind_user_id, watch_no, sum(calorie) as calorie, data_date,
|
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
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
||||||
from watch_data_workout
|
from QH_WAT_DATA_WORKOUT
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
group by bind_user_id, watch_no, data_date
|
group by bind_user_id, watch_no, data_date
|
||||||
@@ -328,7 +328,7 @@
|
|||||||
wd.last_update_time = (select data_date from (
|
wd.last_update_time = (select data_date from (
|
||||||
select bind_user_id, data_date,
|
select bind_user_id, data_date,
|
||||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
||||||
from watch_data_workout
|
from QH_WAT_DATA_WORKOUT
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
group by bind_user_id, watch_no, data_date
|
group by bind_user_id, watch_no, data_date
|
||||||
@@ -339,11 +339,11 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<insert id="insertDistance">
|
<insert id="insertDistance">
|
||||||
insert into watch_data(id, userid, username, orgcode, watch_no, type, data_value, last_update_time)
|
insert into QH_WAT_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
|
(select #{id,jdbcType=VARCHAR}, bind_user_id, #{username,jdbcType=VARCHAR}, #{orgcode,jdbcType=VARCHAR}, watch_no, 7, max(data_value), data_date
|
||||||
from (select bind_user_id, watch_no, max(data_value) as data_value, data_date,
|
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
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
||||||
from watch_data_distance
|
from QH_WAT_DATA_DISTANCE
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
group by bind_user_id, watch_no, data_date)
|
group by bind_user_id, watch_no, data_date)
|
||||||
@@ -351,12 +351,12 @@
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateDistance">
|
<update id="updateDistance">
|
||||||
update watch_data wd
|
update QH_WAT_DATA wd
|
||||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||||
wd.data_value = (select max(data_value) from (
|
wd.data_value = (select max(data_value) from (
|
||||||
select bind_user_id, watch_no, max(data_value) as data_value, data_date,
|
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
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
||||||
from watch_data_distance
|
from QH_WAT_DATA_DISTANCE
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
group by bind_user_id, watch_no, data_date
|
group by bind_user_id, watch_no, data_date
|
||||||
@@ -364,7 +364,7 @@
|
|||||||
wd.last_update_time = (select data_date from (
|
wd.last_update_time = (select data_date from (
|
||||||
select bind_user_id, data_date,
|
select bind_user_id, data_date,
|
||||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
||||||
from watch_data_distance
|
from QH_WAT_DATA_DISTANCE
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
group by bind_user_id, watch_no, data_date
|
group by bind_user_id, watch_no, data_date
|
||||||
@@ -375,11 +375,11 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<insert id="insertSteps">
|
<insert id="insertSteps">
|
||||||
insert into watch_data(id, userid, username, orgcode, watch_no, type, data_value, last_update_time)
|
insert into QH_WAT_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
|
(select #{id,jdbcType=VARCHAR}, bind_user_id, #{username,jdbcType=VARCHAR}, #{orgcode,jdbcType=VARCHAR}, watch_no, 8, max(data_value), data_date
|
||||||
from (select bind_user_id, watch_no, max(data_value) as data_value, data_date,
|
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
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
||||||
from watch_data_steps
|
from QH_WAT_DATA_STEPS
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
group by bind_user_id, watch_no, data_date)
|
group by bind_user_id, watch_no, data_date)
|
||||||
@@ -387,12 +387,12 @@
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateSteps">
|
<update id="updateSteps">
|
||||||
update watch_data wd
|
update QH_WAT_DATA wd
|
||||||
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
set wd.orgcode = #{orgcode,jdbcType=VARCHAR},
|
||||||
wd.data_value = (select max(data_value) from (
|
wd.data_value = (select max(data_value) from (
|
||||||
select bind_user_id, watch_no, max(data_value) as data_value, data_date,
|
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
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
||||||
from watch_data_steps
|
from QH_WAT_DATA_STEPS
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
group by bind_user_id, watch_no, data_date
|
group by bind_user_id, watch_no, data_date
|
||||||
@@ -400,7 +400,7 @@
|
|||||||
wd.last_update_time = (select data_date from (
|
wd.last_update_time = (select data_date from (
|
||||||
select bind_user_id, data_date,
|
select bind_user_id, data_date,
|
||||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id, watch_no ORDER BY data_date desc) as rn
|
||||||
from watch_data_steps
|
from QH_WAT_DATA_STEPS
|
||||||
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
where bind_user_id = #{userid,jdbcType=VARCHAR}
|
||||||
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
and watch_no = #{watchNo,jdbcType=VARCHAR}
|
||||||
group by bind_user_id, watch_no, data_date
|
group by bind_user_id, watch_no, data_date
|
||||||
|
|||||||
+8
-8
@@ -13,8 +13,8 @@
|
|||||||
wdsnm.end_time as endTime,
|
wdsnm.end_time as endTime,
|
||||||
wdsnm.sleep_type as sleepType
|
wdsnm.sleep_type as sleepType
|
||||||
from
|
from
|
||||||
watch_data_sleep_new wdsn
|
QH_WAT_DATA_SLEEP_NEW wdsn
|
||||||
left join watch_data_sleep_new_minute wdsnm on wdsnm.sleep_id=wdsn.id
|
left join QH_WAT_DATA_SLEEP_NEW_MIN wdsnm on wdsnm.sleep_id=wdsn.id
|
||||||
<where>
|
<where>
|
||||||
wdsn.bind_user_id=#{userId}
|
wdsn.bind_user_id=#{userId}
|
||||||
and
|
and
|
||||||
@@ -36,8 +36,8 @@
|
|||||||
wdsnm.sleep_type as sleepType,
|
wdsnm.sleep_type as sleepType,
|
||||||
EXTRACT(MINUTE FROM (wdsnm.end_time - wdsnm.start_time)) as times
|
EXTRACT(MINUTE FROM (wdsnm.end_time - wdsnm.start_time)) as times
|
||||||
from
|
from
|
||||||
watch_data_sleep_new wdsn
|
QH_WAT_DATA_SLEEP_NEW wdsn
|
||||||
inner join watch_data_sleep_new_minute wdsnm on wdsnm.sleep_id=wdsn.id
|
inner join QH_WAT_DATA_SLEEP_NEW_MIN wdsnm on wdsnm.sleep_id=wdsn.id
|
||||||
<where>
|
<where>
|
||||||
wdsn.bind_user_id=#{req.userId}
|
wdsn.bind_user_id=#{req.userId}
|
||||||
and wdsnm.start_time is not null
|
and wdsnm.start_time is not null
|
||||||
@@ -81,8 +81,8 @@
|
|||||||
wm.status as status,
|
wm.status as status,
|
||||||
wm.sleep_type as sleepType
|
wm.sleep_type as sleepType
|
||||||
FROM
|
FROM
|
||||||
watch_data_sleep_new w
|
QH_WAT_DATA_SLEEP_NEW w
|
||||||
inner JOIN watch_data_sleep_new_minute wm ON wm.sleep_id = w.id
|
inner JOIN QH_WAT_DATA_SLEEP_NEW_MIN wm ON wm.sleep_id = w.id
|
||||||
WHERE
|
WHERE
|
||||||
w.bind_user_id =#{userId}
|
w.bind_user_id =#{userId}
|
||||||
AND w.data_date= #{dateStr}
|
AND w.data_date= #{dateStr}
|
||||||
@@ -100,8 +100,8 @@
|
|||||||
wdsnm.sleep_type as sleepType,
|
wdsnm.sleep_type as sleepType,
|
||||||
TIMESTAMPDIFF(MINUTE,wdsnm.start_time,wdsnm.end_time) as times
|
TIMESTAMPDIFF(MINUTE,wdsnm.start_time,wdsnm.end_time) as times
|
||||||
from
|
from
|
||||||
watch_data_sleep_new wdsn
|
QH_WAT_DATA_SLEEP_NEW wdsn
|
||||||
inner join watch_data_sleep_new_minute wdsnm on wdsnm.sleep_id=wdsn.id
|
inner join QH_WAT_DATA_SLEEP_NEW_MIN wdsnm on wdsnm.sleep_id=wdsn.id
|
||||||
<where>
|
<where>
|
||||||
wdsn.bind_user_id=#{userId}
|
wdsn.bind_user_id=#{userId}
|
||||||
and wdsnm.start_time is not null
|
and wdsnm.start_time is not null
|
||||||
|
|||||||
+2
-2
@@ -5,7 +5,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
"watch_data_spo2"
|
"QH_WAT_DATA_SPO2"
|
||||||
WHERE
|
WHERE
|
||||||
EXTRACT(YEAR FROM data_date) = #{req.dateYear}
|
EXTRACT(YEAR FROM data_date) = #{req.dateYear}
|
||||||
AND
|
AND
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<select id="selectSpo2ByUserIdAndMaxIdAndDate" resultType="com.renkang.watch.entity.WatchDataSpo2">
|
<select id="selectSpo2ByUserIdAndMaxIdAndDate" resultType="com.renkang.watch.entity.WatchDataSpo2">
|
||||||
select
|
select
|
||||||
*
|
*
|
||||||
from watch_data_spo2
|
from QH_WAT_DATA_SPO2
|
||||||
where
|
where
|
||||||
bind_user_id = #{userId}
|
bind_user_id = #{userId}
|
||||||
and DATE(time_stamp) = DATE(#{dataTime})
|
and DATE(time_stamp) = DATE(#{dataTime})
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
"watch_data_stress"
|
"QH_WAT_DATA_STRESS"
|
||||||
WHERE
|
WHERE
|
||||||
EXTRACT(YEAR FROM data_date) = #{req.dateYear}
|
EXTRACT(YEAR FROM data_date) = #{req.dateYear}
|
||||||
AND
|
AND
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
"watch_data_temperature"
|
"QH_WAT_DATA_TEMP"
|
||||||
WHERE
|
WHERE
|
||||||
EXTRACT(YEAR FROM data_date) = #{req.dateYear}
|
EXTRACT(YEAR FROM data_date) = #{req.dateYear}
|
||||||
AND
|
AND
|
||||||
|
|||||||
+11
-11
@@ -24,7 +24,7 @@
|
|||||||
EXTRACT(MINUTE FROM (end_time_stamp - start_time_stamp)) * 60 +
|
EXTRACT(MINUTE FROM (end_time_stamp - start_time_stamp)) * 60 +
|
||||||
EXTRACT(HOUR FROM (end_time_stamp - start_time_stamp)) * 3600, 0)) as "totalTime"
|
EXTRACT(HOUR FROM (end_time_stamp - start_time_stamp)) * 3600, 0)) as "totalTime"
|
||||||
FROM
|
FROM
|
||||||
watch_data_workout
|
QH_WAT_DATA_WORKOUT
|
||||||
WHERE
|
WHERE
|
||||||
INSTR(',' || '1,2,3,109,144,6,7,101,113,145' || ',', ',' || workout_type || ',') > 0
|
INSTR(',' || '1,2,3,109,144,6,7,101,113,145' || ',', ',' || workout_type || ',') > 0
|
||||||
<if test="watchDataWorkout.endTime != null and watchDataWorkout.startTime != null">
|
<if test="watchDataWorkout.endTime != null and watchDataWorkout.startTime != null">
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
END
|
END
|
||||||
) AS sugarCalories
|
) AS sugarCalories
|
||||||
FROM
|
FROM
|
||||||
watch_data_workout
|
QH_WAT_DATA_WORKOUT
|
||||||
WHERE
|
WHERE
|
||||||
FIND_IN_SET(workout_type,'1,2,3,109,144,6,7,101,113,145')
|
FIND_IN_SET(workout_type,'1,2,3,109,144,6,7,101,113,145')
|
||||||
<if test="watchDataWorkout.endTime != null and watchDataWorkout.startTime != null">
|
<if test="watchDataWorkout.endTime != null and watchDataWorkout.startTime != null">
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
EXTRACT(MINUTE FROM (end_time_stamp - start_time_stamp)) * 60 +
|
EXTRACT(MINUTE FROM (end_time_stamp - start_time_stamp)) * 60 +
|
||||||
EXTRACT(HOUR FROM (end_time_stamp - start_time_stamp)) * 3600, 0) as "totalTime"
|
EXTRACT(HOUR FROM (end_time_stamp - start_time_stamp)) * 3600, 0) as "totalTime"
|
||||||
from
|
from
|
||||||
watch_data_workout
|
QH_WAT_DATA_WORKOUT
|
||||||
WHERE
|
WHERE
|
||||||
bind_user_id = #{watchDataWorkout.bindUserId}
|
bind_user_id = #{watchDataWorkout.bindUserId}
|
||||||
and DATE(start_time_stamp) = DATE(#{watchDataWorkout.dataDate})
|
and DATE(start_time_stamp) = DATE(#{watchDataWorkout.dataDate})
|
||||||
@@ -108,7 +108,7 @@
|
|||||||
EXTRACT(MINUTE FROM (end_time_stamp - start_time_stamp)) * 60 +
|
EXTRACT(MINUTE FROM (end_time_stamp - start_time_stamp)) * 60 +
|
||||||
EXTRACT(HOUR FROM (end_time_stamp - start_time_stamp)) * 3600),0) as "totalTime"
|
EXTRACT(HOUR FROM (end_time_stamp - start_time_stamp)) * 3600),0) as "totalTime"
|
||||||
from
|
from
|
||||||
watch_data_workout
|
QH_WAT_DATA_WORKOUT
|
||||||
WHERE
|
WHERE
|
||||||
bind_user_id = #{watchDataWorkout.bindUserId}
|
bind_user_id = #{watchDataWorkout.bindUserId}
|
||||||
and DATE(start_time_stamp) = DATE(#{watchDataWorkout.dataDate})
|
and DATE(start_time_stamp) = DATE(#{watchDataWorkout.dataDate})
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
select
|
select
|
||||||
max(end_time_stamp)
|
max(end_time_stamp)
|
||||||
from
|
from
|
||||||
watch_data_workout
|
QH_WAT_DATA_WORKOUT
|
||||||
WHERE
|
WHERE
|
||||||
bind_user_id = #{bindUserId}
|
bind_user_id = #{bindUserId}
|
||||||
</select>
|
</select>
|
||||||
@@ -130,7 +130,7 @@
|
|||||||
select
|
select
|
||||||
min(start_time_stamp)
|
min(start_time_stamp)
|
||||||
from
|
from
|
||||||
watch_data_workout
|
QH_WAT_DATA_WORKOUT
|
||||||
WHERE
|
WHERE
|
||||||
bind_user_id = #{bindUserId}
|
bind_user_id = #{bindUserId}
|
||||||
</select>
|
</select>
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
) AS sugarCalories,
|
) AS sugarCalories,
|
||||||
SUM(IFNULL(TIMESTAMPDIFF(SECOND, start_time_stamp, end_time_stamp),0)) as "totalTime"
|
SUM(IFNULL(TIMESTAMPDIFF(SECOND, start_time_stamp, end_time_stamp),0)) as "totalTime"
|
||||||
FROM
|
FROM
|
||||||
watch_data_workout
|
QH_WAT_DATA_WORKOUT
|
||||||
WHERE
|
WHERE
|
||||||
FIND_IN_SET(workout_type,'1,2,3,109,144,6,7,101,113,145')
|
FIND_IN_SET(workout_type,'1,2,3,109,144,6,7,101,113,145')
|
||||||
<if test="watchDataWorkout.endTime != null and watchDataWorkout.startTime != null">
|
<if test="watchDataWorkout.endTime != null and watchDataWorkout.startTime != null">
|
||||||
@@ -192,7 +192,7 @@
|
|||||||
AS sugarCalories,
|
AS sugarCalories,
|
||||||
IFNULL(TIMESTAMPDIFF(SECOND, start_time_stamp, end_time_stamp),0) as "totalTime"
|
IFNULL(TIMESTAMPDIFF(SECOND, start_time_stamp, end_time_stamp),0) as "totalTime"
|
||||||
from
|
from
|
||||||
watch_data_workout
|
QH_WAT_DATA_WORKOUT
|
||||||
WHERE
|
WHERE
|
||||||
bind_user_id = #{watchDataWorkout.bindUserId}
|
bind_user_id = #{watchDataWorkout.bindUserId}
|
||||||
and DATE(start_time_stamp) >= DATE(#{watchDataWorkout.startTime})
|
and DATE(start_time_stamp) >= DATE(#{watchDataWorkout.startTime})
|
||||||
@@ -229,7 +229,7 @@
|
|||||||
AS sugarCalories,
|
AS sugarCalories,
|
||||||
IFNULL(TIMESTAMPDIFF(SECOND, start_time_stamp, end_time_stamp),0) as "totalTime"
|
IFNULL(TIMESTAMPDIFF(SECOND, start_time_stamp, end_time_stamp),0) as "totalTime"
|
||||||
FROM
|
FROM
|
||||||
watch_data_workout
|
QH_WAT_DATA_WORKOUT
|
||||||
WHERE
|
WHERE
|
||||||
FIND_IN_SET(workout_type,'1,2,3,109,144,6,7,101,113,145')
|
FIND_IN_SET(workout_type,'1,2,3,109,144,6,7,101,113,145')
|
||||||
and bind_user_id = #{watchDataWorkout.bindUserId}
|
and bind_user_id = #{watchDataWorkout.bindUserId}
|
||||||
@@ -250,10 +250,10 @@
|
|||||||
EXTRACT(HOUR FROM (end_time_stamp - start_time_stamp)) * 3600),0) as "totalTime",
|
EXTRACT(HOUR FROM (end_time_stamp - start_time_stamp)) * 3600),0) as "totalTime",
|
||||||
MIN(start_time_stamp) AS "dataDate"
|
MIN(start_time_stamp) AS "dataDate"
|
||||||
from
|
from
|
||||||
watch_data_workout
|
QH_WAT_DATA_WORKOUT
|
||||||
WHERE
|
WHERE
|
||||||
bind_user_id = #{watchDataWorkout.bindUserId}
|
bind_user_id = #{watchDataWorkout.bindUserId}
|
||||||
and DATE(start_time_stamp) = (SELECT MAX(DATE(start_time_stamp)) FROM watch_data_workout WHERE bind_user_id = #{watchDataWorkout.bindUserId} and FIND_IN_SET(workout_type,'1,2,3,109,144,6,7,101,113,145'))
|
and DATE(start_time_stamp) = (SELECT MAX(DATE(start_time_stamp)) FROM QH_WAT_DATA_WORKOUT WHERE bind_user_id = #{watchDataWorkout.bindUserId} and FIND_IN_SET(workout_type,'1,2,3,109,144,6,7,101,113,145'))
|
||||||
and FIND_IN_SET(workout_type,'1,2,3,109,144,6,7,101,113,145')
|
and FIND_IN_SET(workout_type,'1,2,3,109,144,6,7,101,113,145')
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
<mapper namespace="com.renkang.watch.mapper.WatchDepartReportMapper">
|
<mapper namespace="com.renkang.watch.mapper.WatchDepartReportMapper">
|
||||||
<resultMap id="BaseResultMap" type="com.renkang.watch.entity.WatchDepartReport">
|
<resultMap id="BaseResultMap" type="com.renkang.watch.entity.WatchDepartReport">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
<!--@Table watch_depart_report-->
|
<!--@Table QH_WAT_DEPART_REPORT-->
|
||||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||||
<result column="org_code" jdbcType="VARCHAR" property="orgCode" />
|
<result column="org_code" jdbcType="VARCHAR" property="orgCode" />
|
||||||
<result column="report_year" jdbcType="INTEGER" property="reportYear" />
|
<result column="report_year" jdbcType="INTEGER" property="reportYear" />
|
||||||
|
|||||||
+50
-50
@@ -20,9 +20,9 @@
|
|||||||
LISTAGG(wds.switch_flag, ',') WITHIN GROUP (ORDER BY wds.switch_flag) AS switch_flags,
|
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
|
LISTAGG(NVL(TO_CHAR(wds.update_date, 'YYYY-MM-DD HH24:MI:SS'), '') || ',') WITHIN GROUP (ORDER BY wds.update_date) AS update_dates
|
||||||
FROM
|
FROM
|
||||||
watch_device wd
|
QH_WAT_DEVICE wd
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
watch_device_switch wds ON wd.watch_no = wds.watch_no
|
QH_WAT_DEVICE_SWITCH wds ON wd.watch_no = wds.watch_no
|
||||||
<where>
|
<where>
|
||||||
<if test="null != dto.deptId and '' != dto.deptId">
|
<if test="null != dto.deptId and '' != dto.deptId">
|
||||||
AND wd.dept_id = #{dto.deptId}
|
AND wd.dept_id = #{dto.deptId}
|
||||||
@@ -58,10 +58,10 @@
|
|||||||
|
|
||||||
<select id="selectLatestByType" resultType="com.renkang.watch.entity.WatchData">
|
<select id="selectLatestByType" resultType="com.renkang.watch.entity.WatchData">
|
||||||
SELECT wd.*
|
SELECT wd.*
|
||||||
FROM watch_data wd
|
FROM QH_WAT_DATA wd
|
||||||
INNER JOIN (
|
INNER JOIN (
|
||||||
SELECT userid, type, MAX(last_update_time) AS max_last_update_time
|
SELECT userid, type, MAX(last_update_time) AS max_last_update_time
|
||||||
FROM watch_data
|
FROM QH_WAT_DATA
|
||||||
WHERE userid IN
|
WHERE userid IN
|
||||||
<foreach item="userId" collection="userIds" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIds" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectUnitId" resultType="String">
|
<select id="selectUnitId" resultType="String">
|
||||||
select DISTINCT dept_id from watch_device
|
select DISTINCT dept_id from QH_WAT_DEVICE
|
||||||
<if test="list != null and !list.isEmpty()">
|
<if test="list != null and !list.isEmpty()">
|
||||||
WHERE watch_no NOT IN
|
WHERE watch_no NOT IN
|
||||||
<foreach item="item" collection="list" open="(" separator="," close=")">
|
<foreach item="item" collection="list" open="(" separator="," close=")">
|
||||||
@@ -87,7 +87,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<select id="selectWatchDeviceUserNum" resultType="String">
|
<select id="selectWatchDeviceUserNum" resultType="String">
|
||||||
select count(1) from watch_device where 1=1
|
select count(1) from QH_WAT_DEVICE where 1=1
|
||||||
<if test="null != orgCode and '' != orgCode and orgCode != 'A01'.toString()">
|
<if test="null != orgCode and '' != orgCode and orgCode != 'A01'.toString()">
|
||||||
and org_code = #{orgCode}
|
and org_code = #{orgCode}
|
||||||
</if>
|
</if>
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<update id="changeUserWatchDeviceOrgCode">
|
<update id="changeUserWatchDeviceOrgCode">
|
||||||
update watch_device set
|
update QH_WAT_DEVICE set
|
||||||
org_code = #{orgcode},
|
org_code = #{orgcode},
|
||||||
dept_id = #{deptId}
|
dept_id = #{deptId}
|
||||||
where bind_user_id = #{bindUserId}
|
where bind_user_id = #{bindUserId}
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
a.dept_id as "deptId",
|
a.dept_id as "deptId",
|
||||||
a.org_code as "orgCode"
|
a.org_code as "orgCode"
|
||||||
FROM
|
FROM
|
||||||
watch_device a
|
QH_WAT_DEVICE a
|
||||||
<where>
|
<where>
|
||||||
<if test="null != dto.startTime and null != dto.endTime">
|
<if test="null != dto.startTime and null != dto.endTime">
|
||||||
and a.bind_date >= #{dto.startTime}
|
and a.bind_date >= #{dto.startTime}
|
||||||
@@ -151,7 +151,7 @@
|
|||||||
<select id="selectUnitDeviceInNum" resultType="int">
|
<select id="selectUnitDeviceInNum" resultType="int">
|
||||||
select
|
select
|
||||||
count(1)
|
count(1)
|
||||||
from watch_device
|
from QH_WAT_DEVICE
|
||||||
where org_code = #{orgCode}
|
where org_code = #{orgCode}
|
||||||
and TRUNC(create_date) <![CDATA[ <= ]]> #{endDate}
|
and TRUNC(create_date) <![CDATA[ <= ]]> #{endDate}
|
||||||
</select>
|
</select>
|
||||||
@@ -163,8 +163,8 @@
|
|||||||
<select id="selectUnitDeviceInNumWear" resultType="int">
|
<select id="selectUnitDeviceInNumWear" resultType="int">
|
||||||
select
|
select
|
||||||
count(distinct a.watch_no)
|
count(distinct a.watch_no)
|
||||||
from watch_device a
|
from QH_WAT_DEVICE a
|
||||||
left join watch_bind_his b on a.watch_no = b.watch_no
|
left join QH_WAT_BIND_HIS b on a.watch_no = b.watch_no
|
||||||
where a.org_code = #{orgCode}
|
where a.org_code = #{orgCode}
|
||||||
and a.bind_user_id is not null and a.bind_user_id != ''
|
and a.bind_user_id is not null and a.bind_user_id != ''
|
||||||
and a.org_code = (LEFT(b.org_code,6))
|
and a.org_code = (LEFT(b.org_code,6))
|
||||||
@@ -174,8 +174,8 @@
|
|||||||
<select id="selectDepartmentDeviceInNumWear" resultType="int">
|
<select id="selectDepartmentDeviceInNumWear" resultType="int">
|
||||||
select
|
select
|
||||||
count(distinct a.watch_no)
|
count(distinct a.watch_no)
|
||||||
from watch_device a
|
from QH_WAT_DEVICE a
|
||||||
left join watch_bind_his b on a.watch_no = b.watch_no
|
left join QH_WAT_BIND_HIS b on a.watch_no = b.watch_no
|
||||||
where b.org_code LIKE concat(#{orgCode},'%')
|
where b.org_code LIKE concat(#{orgCode},'%')
|
||||||
and a.org_code = (LEFT(b.org_code,6))
|
and a.org_code = (LEFT(b.org_code,6))
|
||||||
and a.bind_user_id is not null and a.bind_user_id != ''
|
and a.bind_user_id is not null and a.bind_user_id != ''
|
||||||
@@ -183,7 +183,7 @@
|
|||||||
</select>
|
</select>
|
||||||
<select id="selectDeviceUserId" resultType="java.lang.String">
|
<select id="selectDeviceUserId" resultType="java.lang.String">
|
||||||
SELECT DISTINCT bind_user_id
|
SELECT DISTINCT bind_user_id
|
||||||
FROM watch_device
|
FROM QH_WAT_DEVICE
|
||||||
<where>
|
<where>
|
||||||
bind_user_id IS NOT NULL and bind_user_id != ''
|
bind_user_id IS NOT NULL and bind_user_id != ''
|
||||||
<if test="null != deptId and '' != deptId">
|
<if test="null != deptId and '' != deptId">
|
||||||
@@ -192,7 +192,7 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="selectWearCount" resultType="com.renkang.watch.data.model.vo.WearCount">
|
<select id="selectWearCount" resultType="com.renkang.watch.data.model.vo.WearCount">
|
||||||
SELECT org_code as orgCode, count(1) as wearCount FROM watch_device
|
SELECT org_code as orgCode, count(1) as wearCount FROM QH_WAT_DEVICE
|
||||||
WHERE bind_user_id IS NOT NULL and bind_user_id != ''
|
WHERE bind_user_id IS NOT NULL and bind_user_id != ''
|
||||||
<if test="null != orgCodeList">
|
<if test="null != orgCodeList">
|
||||||
AND org_code in
|
AND org_code in
|
||||||
@@ -203,7 +203,7 @@
|
|||||||
GROUP BY org_code
|
GROUP BY org_code
|
||||||
</select>
|
</select>
|
||||||
<select id="selectWearCountByUserIds" resultType="java.lang.String">
|
<select id="selectWearCountByUserIds" resultType="java.lang.String">
|
||||||
select bind_user_id FROM watch_device where
|
select bind_user_id FROM QH_WAT_DEVICE where
|
||||||
<if test="null != userIdList">
|
<if test="null != userIdList">
|
||||||
bind_user_id in
|
bind_user_id in
|
||||||
<foreach collection="userIdList" item="userId" open="(" separator="," close=")">
|
<foreach collection="userIdList" item="userId" open="(" separator="," close=")">
|
||||||
@@ -260,10 +260,10 @@
|
|||||||
<!-- 心率数据 -->
|
<!-- 心率数据 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT h1.*
|
SELECT h1.*
|
||||||
FROM watch_stat_user_info_day_heart_rate h1
|
FROM QH_WAT_STA_US_DAY_HEA_RAT h1
|
||||||
INNER JOIN (
|
INNER JOIN (
|
||||||
SELECT user_id, MAX(last_upload_time) AS max_time
|
SELECT user_id, MAX(last_upload_time) AS max_time
|
||||||
FROM watch_stat_user_info_day_heart_rate
|
FROM QH_WAT_STA_US_DAY_HEA_RAT
|
||||||
WHERE user_id IN
|
WHERE user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -275,10 +275,10 @@
|
|||||||
<!-- 血氧数据 -->
|
<!-- 血氧数据 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT s1.*
|
SELECT s1.*
|
||||||
FROM watch_stat_user_info_day_spo2 s1
|
FROM QH_WAT_STAT_USER_DAY_SPO2 s1
|
||||||
INNER JOIN (
|
INNER JOIN (
|
||||||
SELECT user_id, MAX(last_upload_time) AS max_time
|
SELECT user_id, MAX(last_upload_time) AS max_time
|
||||||
FROM watch_stat_user_info_day_spo2
|
FROM QH_WAT_STAT_USER_DAY_SPO2
|
||||||
WHERE user_id IN
|
WHERE user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -290,10 +290,10 @@
|
|||||||
<!-- 压力数据 -->
|
<!-- 压力数据 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT p1.*
|
SELECT p1.*
|
||||||
FROM watch_stat_user_info_day_stress p1
|
FROM QH_WAT_STAT_USER_DAY_STRE p1
|
||||||
INNER JOIN (
|
INNER JOIN (
|
||||||
SELECT user_id, MAX(last_upload_time) AS max_time
|
SELECT user_id, MAX(last_upload_time) AS max_time
|
||||||
FROM watch_stat_user_info_day_stress
|
FROM QH_WAT_STAT_USER_DAY_STRE
|
||||||
WHERE user_id IN
|
WHERE user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -305,10 +305,10 @@
|
|||||||
<!-- 体温数据 -->
|
<!-- 体温数据 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT t1.*
|
SELECT t1.*
|
||||||
FROM watch_stat_user_info_day_temp t1
|
FROM QH_WAT_STAT_USER_DAY_TEMP t1
|
||||||
INNER JOIN (
|
INNER JOIN (
|
||||||
SELECT user_id, MAX(last_upload_time) AS max_time
|
SELECT user_id, MAX(last_upload_time) AS max_time
|
||||||
FROM watch_stat_user_info_day_temp
|
FROM QH_WAT_STAT_USER_DAY_TEMP
|
||||||
WHERE user_id IN
|
WHERE user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -320,10 +320,10 @@
|
|||||||
<!-- 睡眠数据 -->
|
<!-- 睡眠数据 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT sl1.*
|
SELECT sl1.*
|
||||||
FROM watch_stat_user_info_day_sleep sl1
|
FROM QH_WAT_STAT_USER_DAY_SLE sl1
|
||||||
INNER JOIN (
|
INNER JOIN (
|
||||||
SELECT user_id, MAX(last_upload_time) AS max_time
|
SELECT user_id, MAX(last_upload_time) AS max_time
|
||||||
FROM watch_stat_user_info_day_sleep
|
FROM QH_WAT_STAT_USER_DAY_SLE
|
||||||
WHERE user_id IN
|
WHERE user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -335,7 +335,7 @@
|
|||||||
<!-- 心率异常统计 -->
|
<!-- 心率异常统计 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT bind_user_id, COUNT(*) AS errorNum
|
SELECT bind_user_id, COUNT(*) AS errorNum
|
||||||
FROM watch_monitor_data
|
FROM QH_WAT_MONITOR_DATA
|
||||||
WHERE bind_user_id IN
|
WHERE bind_user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -347,7 +347,7 @@
|
|||||||
<!-- 血氧异常统计 -->
|
<!-- 血氧异常统计 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT bind_user_id, COUNT(*) AS errorNum
|
SELECT bind_user_id, COUNT(*) AS errorNum
|
||||||
FROM watch_monitor_data
|
FROM QH_WAT_MONITOR_DATA
|
||||||
WHERE bind_user_id IN
|
WHERE bind_user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -359,7 +359,7 @@
|
|||||||
<!-- 压力异常统计 -->
|
<!-- 压力异常统计 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT bind_user_id, COUNT(*) AS errorNum
|
SELECT bind_user_id, COUNT(*) AS errorNum
|
||||||
FROM watch_monitor_data
|
FROM QH_WAT_MONITOR_DATA
|
||||||
WHERE bind_user_id IN
|
WHERE bind_user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -371,7 +371,7 @@
|
|||||||
<!-- 体温异常统计 -->
|
<!-- 体温异常统计 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT bind_user_id, COUNT(*) AS errorNum
|
SELECT bind_user_id, COUNT(*) AS errorNum
|
||||||
FROM watch_monitor_data
|
FROM QH_WAT_MONITOR_DATA
|
||||||
WHERE bind_user_id IN
|
WHERE bind_user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -383,7 +383,7 @@
|
|||||||
<!-- 睡眠异常统计 -->
|
<!-- 睡眠异常统计 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT bind_user_id, COUNT(*) AS errorNum
|
SELECT bind_user_id, COUNT(*) AS errorNum
|
||||||
FROM watch_monitor_data
|
FROM QH_WAT_MONITOR_DATA
|
||||||
WHERE bind_user_id IN
|
WHERE bind_user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -449,10 +449,10 @@
|
|||||||
<!-- 心率数据 -->
|
<!-- 心率数据 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT h1.*
|
SELECT h1.*
|
||||||
FROM watch_stat_user_info_day_heart_rate h1
|
FROM QH_WAT_STA_US_DAY_HEA_RAT h1
|
||||||
INNER JOIN (
|
INNER JOIN (
|
||||||
SELECT user_id, MAX(last_upload_time) AS max_time
|
SELECT user_id, MAX(last_upload_time) AS max_time
|
||||||
FROM watch_stat_user_info_day_heart_rate
|
FROM QH_WAT_STA_US_DAY_HEA_RAT
|
||||||
WHERE user_id IN
|
WHERE user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -464,10 +464,10 @@
|
|||||||
<!-- 血氧数据 -->
|
<!-- 血氧数据 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT s1.*
|
SELECT s1.*
|
||||||
FROM watch_stat_user_info_day_spo2 s1
|
FROM QH_WAT_STAT_USER_DAY_SPO2 s1
|
||||||
INNER JOIN (
|
INNER JOIN (
|
||||||
SELECT user_id, MAX(last_upload_time) AS max_time
|
SELECT user_id, MAX(last_upload_time) AS max_time
|
||||||
FROM watch_stat_user_info_day_spo2
|
FROM QH_WAT_STAT_USER_DAY_SPO2
|
||||||
WHERE user_id IN
|
WHERE user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -479,10 +479,10 @@
|
|||||||
<!-- 压力数据 -->
|
<!-- 压力数据 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT p1.*
|
SELECT p1.*
|
||||||
FROM watch_stat_user_info_day_stress p1
|
FROM QH_WAT_STAT_USER_DAY_STRE p1
|
||||||
INNER JOIN (
|
INNER JOIN (
|
||||||
SELECT user_id, MAX(last_upload_time) AS max_time
|
SELECT user_id, MAX(last_upload_time) AS max_time
|
||||||
FROM watch_stat_user_info_day_stress
|
FROM QH_WAT_STAT_USER_DAY_STRE
|
||||||
WHERE user_id IN
|
WHERE user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -494,10 +494,10 @@
|
|||||||
<!-- 体温数据 -->
|
<!-- 体温数据 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT t1.*
|
SELECT t1.*
|
||||||
FROM watch_stat_user_info_day_temp t1
|
FROM QH_WAT_STAT_USER_DAY_TEMP t1
|
||||||
INNER JOIN (
|
INNER JOIN (
|
||||||
SELECT user_id, MAX(last_upload_time) AS max_time
|
SELECT user_id, MAX(last_upload_time) AS max_time
|
||||||
FROM watch_stat_user_info_day_temp
|
FROM QH_WAT_STAT_USER_DAY_TEMP
|
||||||
WHERE user_id IN
|
WHERE user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -509,10 +509,10 @@
|
|||||||
<!-- 睡眠数据 -->
|
<!-- 睡眠数据 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT sl1.*
|
SELECT sl1.*
|
||||||
FROM watch_stat_user_info_day_sleep sl1
|
FROM QH_WAT_STAT_USER_DAY_SLE sl1
|
||||||
INNER JOIN (
|
INNER JOIN (
|
||||||
SELECT user_id, MAX(last_upload_time) AS max_time
|
SELECT user_id, MAX(last_upload_time) AS max_time
|
||||||
FROM watch_stat_user_info_day_sleep
|
FROM QH_WAT_STAT_USER_DAY_SLE
|
||||||
WHERE user_id IN
|
WHERE user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -524,7 +524,7 @@
|
|||||||
<!-- 心率异常统计 -->
|
<!-- 心率异常统计 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT bind_user_id, COUNT(*) AS errorNum
|
SELECT bind_user_id, COUNT(*) AS errorNum
|
||||||
FROM watch_monitor_data
|
FROM QH_WAT_MONITOR_DATA
|
||||||
WHERE bind_user_id IN
|
WHERE bind_user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -536,7 +536,7 @@
|
|||||||
<!-- 血氧异常统计 -->
|
<!-- 血氧异常统计 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT bind_user_id, COUNT(*) AS errorNum
|
SELECT bind_user_id, COUNT(*) AS errorNum
|
||||||
FROM watch_monitor_data
|
FROM QH_WAT_MONITOR_DATA
|
||||||
WHERE bind_user_id IN
|
WHERE bind_user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -548,7 +548,7 @@
|
|||||||
<!-- 压力异常统计 -->
|
<!-- 压力异常统计 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT bind_user_id, COUNT(*) AS errorNum
|
SELECT bind_user_id, COUNT(*) AS errorNum
|
||||||
FROM watch_monitor_data
|
FROM QH_WAT_MONITOR_DATA
|
||||||
WHERE bind_user_id IN
|
WHERE bind_user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -560,7 +560,7 @@
|
|||||||
<!-- 体温异常统计 -->
|
<!-- 体温异常统计 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT bind_user_id, COUNT(*) AS errorNum
|
SELECT bind_user_id, COUNT(*) AS errorNum
|
||||||
FROM watch_monitor_data
|
FROM QH_WAT_MONITOR_DATA
|
||||||
WHERE bind_user_id IN
|
WHERE bind_user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -572,7 +572,7 @@
|
|||||||
<!-- 睡眠异常统计 -->
|
<!-- 睡眠异常统计 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT bind_user_id, COUNT(*) AS errorNum
|
SELECT bind_user_id, COUNT(*) AS errorNum
|
||||||
FROM watch_monitor_data
|
FROM QH_WAT_MONITOR_DATA
|
||||||
WHERE bind_user_id IN
|
WHERE bind_user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -584,10 +584,10 @@
|
|||||||
<!-- 步数数据 -->
|
<!-- 步数数据 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT steps1.*
|
SELECT steps1.*
|
||||||
FROM watch_stat_user_info_day_sdc steps1
|
FROM QH_WAT_STAT_USER_DAY_SDC steps1
|
||||||
INNER JOIN (
|
INNER JOIN (
|
||||||
SELECT user_id, MAX(last_upload_time) AS max_time
|
SELECT user_id, MAX(last_upload_time) AS max_time
|
||||||
FROM watch_stat_user_info_day_sdc
|
FROM QH_WAT_STAT_USER_DAY_SDC
|
||||||
WHERE user_id IN
|
WHERE user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
@@ -599,10 +599,10 @@
|
|||||||
<!-- 运动数据 -->
|
<!-- 运动数据 -->
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT workout1.*
|
SELECT workout1.*
|
||||||
FROM watch_data_workout workout1
|
FROM QH_WAT_DATA_WORKOUT workout1
|
||||||
INNER JOIN (
|
INNER JOIN (
|
||||||
SELECT bind_user_id, MAX(start_time_stamp) AS max_time
|
SELECT bind_user_id, MAX(start_time_stamp) AS max_time
|
||||||
FROM watch_data_workout
|
FROM QH_WAT_DATA_WORKOUT
|
||||||
WHERE bind_user_id IN
|
WHERE bind_user_id IN
|
||||||
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
<foreach item="userId" collection="userIdList" open="(" separator="," close=")">
|
||||||
#{userId}
|
#{userId}
|
||||||
|
|||||||
+13
-13
@@ -8,10 +8,10 @@
|
|||||||
c.data_value calorieValue,
|
c.data_value calorieValue,
|
||||||
TO_CHAR(s.data_date, 'YYYY-MM-DD') dataDate
|
TO_CHAR(s.data_date, 'YYYY-MM-DD') dataDate
|
||||||
FROM
|
FROM
|
||||||
watch_data_steps s
|
QH_WAT_DATA_STEPS s
|
||||||
LEFT JOIN watch_data_distance d ON s.bind_user_id = d.bind_user_id
|
LEFT JOIN QH_WAT_DATA_DISTANCE d ON s.bind_user_id = d.bind_user_id
|
||||||
AND s.data_date = d.data_date
|
AND s.data_date = d.data_date
|
||||||
LEFT JOIN watch_data_calorie c ON s.bind_user_id = c.bind_user_id
|
LEFT JOIN QH_WAT_DATA_CALORIE c ON s.bind_user_id = c.bind_user_id
|
||||||
AND s.data_date = c.data_date
|
AND s.data_date = c.data_date
|
||||||
WHERE
|
WHERE
|
||||||
s.bind_user_id = #{id}
|
s.bind_user_id = #{id}
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
skin_tempera skinTempera,
|
skin_tempera skinTempera,
|
||||||
data_date dataDate
|
data_date dataDate
|
||||||
FROM
|
FROM
|
||||||
watch_data_temperature
|
QH_WAT_DATA_TEMP
|
||||||
WHERE
|
WHERE
|
||||||
bind_user_id = #{id}
|
bind_user_id = #{id}
|
||||||
AND TO_CHAR(data_date, #{format}) = #{date}
|
AND TO_CHAR(data_date, #{format}) = #{date}
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
max( data_value ) maxValue,
|
max( data_value ) maxValue,
|
||||||
min( data_value ) minValue
|
min( data_value ) minValue
|
||||||
FROM
|
FROM
|
||||||
watch_monitor_data
|
QH_WAT_MONITOR_DATA
|
||||||
WHERE
|
WHERE
|
||||||
event_type = 'heart_rate'
|
event_type = 'heart_rate'
|
||||||
AND data_value != NULL
|
AND data_value != NULL
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
max( data_value ) maxValue,
|
max( data_value ) maxValue,
|
||||||
min( data_value ) minValue
|
min( data_value ) minValue
|
||||||
FROM
|
FROM
|
||||||
watch_monitor_data
|
QH_WAT_MONITOR_DATA
|
||||||
WHERE
|
WHERE
|
||||||
event_type = 'heart_rate'
|
event_type = 'heart_rate'
|
||||||
AND data_value != NULL
|
AND data_value != NULL
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
data_value dataValue,
|
data_value dataValue,
|
||||||
data_date dataDate
|
data_date dataDate
|
||||||
FROM
|
FROM
|
||||||
watch_data_heart_rate
|
QH_WAT_DATA_HEART_RATE
|
||||||
WHERE
|
WHERE
|
||||||
bind_user_id = #{id}
|
bind_user_id = #{id}
|
||||||
AND TO_CHAR(data_date, #{format}) = #{date}
|
AND TO_CHAR(data_date, #{format}) = #{date}
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
data_value dataValue,
|
data_value dataValue,
|
||||||
data_date dataDate
|
data_date dataDate
|
||||||
FROM
|
FROM
|
||||||
watch_data_stress
|
QH_WAT_DATA_STRESS
|
||||||
WHERE
|
WHERE
|
||||||
bind_user_id = #{id}
|
bind_user_id = #{id}
|
||||||
AND TO_CHAR(data_date, #{format}) = #{date}
|
AND TO_CHAR(data_date, #{format}) = #{date}
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
data_value dataValue,
|
data_value dataValue,
|
||||||
data_date dataDate
|
data_date dataDate
|
||||||
FROM
|
FROM
|
||||||
watch_data_spo2
|
QH_WAT_DATA_SPO2
|
||||||
WHERE
|
WHERE
|
||||||
bind_user_id = #{id}
|
bind_user_id = #{id}
|
||||||
AND TO_CHAR(data_date, #{format}) = #{date}
|
AND TO_CHAR(data_date, #{format}) = #{date}
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
address_gd addressGd,
|
address_gd addressGd,
|
||||||
gps_error_msg gpsErrorMsg
|
gps_error_msg gpsErrorMsg
|
||||||
FROM
|
FROM
|
||||||
watch_monitor_data
|
QH_WAT_MONITOR_DATA
|
||||||
WHERE
|
WHERE
|
||||||
bind_user_id = #{id}
|
bind_user_id = #{id}
|
||||||
AND event_type = #{type}
|
AND event_type = #{type}
|
||||||
@@ -114,11 +114,11 @@
|
|||||||
<select id="getAverageDay" resultType="java.util.Map">
|
<select id="getAverageDay" resultType="java.util.Map">
|
||||||
SELECT
|
SELECT
|
||||||
ROUND( AVG( total_minutes ) ) 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
|
( SELECT COUNT(*) FROM QH_WAT_DATA_SLEEP_NEW_DAY WHERE sleep_id IN ( SELECT id FROM QH_WAT_DATA_SLEEP_NEW WHERE
|
||||||
bind_user_id = #{id}) ) AS sum
|
bind_user_id = #{id}) ) AS sum
|
||||||
FROM
|
FROM
|
||||||
( SELECT ROUND((CAST(wake_up_time AS DATE) - CAST(fall_asleep_time AS DATE)) * 24 * 60) AS total_minutes
|
( 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
|
FROM QH_WAT_DATA_SLEEP_NEW_DAY
|
||||||
WHERE sleep_id IN ( SELECT id FROM watch_data_sleep_new WHERE bind_user_id = #{id}) ) subquery
|
WHERE sleep_id IN ( SELECT id FROM QH_WAT_DATA_SLEEP_NEW WHERE bind_user_id = #{id}) ) subquery
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
+12
-12
@@ -7,7 +7,7 @@
|
|||||||
bind_user_id,
|
bind_user_id,
|
||||||
count( DISTINCT bind_user_id )
|
count( DISTINCT bind_user_id )
|
||||||
FROM
|
FROM
|
||||||
"watch_monitor_data"
|
"QH_WAT_MONITOR_DATA"
|
||||||
<where>
|
<where>
|
||||||
<if test="startTime!=null">
|
<if test="startTime!=null">
|
||||||
and warn_time >= #{startTime}
|
and warn_time >= #{startTime}
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
count(*)
|
count(*)
|
||||||
FROM
|
FROM
|
||||||
"watch_monitor_data"
|
"QH_WAT_MONITOR_DATA"
|
||||||
<where>
|
<where>
|
||||||
and org_code like concat(#{orgCode},'%')
|
and org_code like concat(#{orgCode},'%')
|
||||||
<if test="type != null">
|
<if test="type != null">
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
watch_monitor_data
|
QH_WAT_MONITOR_DATA
|
||||||
<where>
|
<where>
|
||||||
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
||||||
<if test="orgCode != null and orgCode != ''">
|
<if test="orgCode != null and orgCode != ''">
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
watch_monitor_data
|
QH_WAT_MONITOR_DATA
|
||||||
<where>
|
<where>
|
||||||
<if test="userIds != null and userIds.size() != 0">
|
<if test="userIds != null and userIds.size() != 0">
|
||||||
bind_user_id in
|
bind_user_id in
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
a.*
|
a.*
|
||||||
FROM
|
FROM
|
||||||
watch_monitor_data a left join watch_device b on a.watch_no=b.watch_no and b.org_code = (LEFT(a.org_code, 6 ))
|
QH_WAT_MONITOR_DATA a left join QH_WAT_DEVICE b on a.watch_no=b.watch_no and b.org_code = (LEFT(a.org_code, 6 ))
|
||||||
<where>
|
<where>
|
||||||
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
<foreach collection="orgCodes" item="orgCode" open="(" close=")" separator=" OR ">
|
||||||
<if test="orgCode != null and orgCode != ''">
|
<if test="orgCode != null and orgCode != ''">
|
||||||
@@ -134,13 +134,13 @@
|
|||||||
w.large_screen_flag,
|
w.large_screen_flag,
|
||||||
w.org_code
|
w.org_code
|
||||||
FROM
|
FROM
|
||||||
watch_monitor_data w
|
QH_WAT_MONITOR_DATA w
|
||||||
JOIN (
|
JOIN (
|
||||||
SELECT
|
SELECT
|
||||||
bind_user_id,
|
bind_user_id,
|
||||||
MAX( warn_time ) AS latest_warn_time
|
MAX( warn_time ) AS latest_warn_time
|
||||||
FROM
|
FROM
|
||||||
watch_monitor_data
|
QH_WAT_MONITOR_DATA
|
||||||
WHERE
|
WHERE
|
||||||
event_type = #{req.eventType}
|
event_type = #{req.eventType}
|
||||||
AND warn_time BETWEEN #{req.startTime}
|
AND warn_time BETWEEN #{req.startTime}
|
||||||
@@ -162,7 +162,7 @@
|
|||||||
<select id="monitorTotalStats" resultType="com.renkang.watch.api.bean.response.MonitorTotalStats">
|
<select id="monitorTotalStats" resultType="com.renkang.watch.api.bean.response.MonitorTotalStats">
|
||||||
select
|
select
|
||||||
(select count(0)
|
(select count(0)
|
||||||
from watch_monitor_data
|
from QH_WAT_MONITOR_DATA
|
||||||
where data_date = curdate()
|
where data_date = curdate()
|
||||||
<if test="orgCodes != null and orgCodes.size() > 0">
|
<if test="orgCodes != null and orgCodes.size() > 0">
|
||||||
and
|
and
|
||||||
@@ -172,7 +172,7 @@
|
|||||||
</if>
|
</if>
|
||||||
) as day_count,
|
) as day_count,
|
||||||
(select count(0)
|
(select count(0)
|
||||||
from watch_monitor_data
|
from QH_WAT_MONITOR_DATA
|
||||||
where TO_CHAR(data_date,'IYYY-IW') = TO_CHAR(SYSDATE,'IYYY-IW')
|
where TO_CHAR(data_date,'IYYY-IW') = TO_CHAR(SYSDATE,'IYYY-IW')
|
||||||
<if test="orgCodes != null and orgCodes.size() > 0">
|
<if test="orgCodes != null and orgCodes.size() > 0">
|
||||||
and
|
and
|
||||||
@@ -182,7 +182,7 @@
|
|||||||
</if>
|
</if>
|
||||||
) as week_count,
|
) as week_count,
|
||||||
(select count(0)
|
(select count(0)
|
||||||
from watch_monitor_data
|
from QH_WAT_MONITOR_DATA
|
||||||
where TO_CHAR(data_date, 'YYYY-MM') = TO_CHAR(SYSDATE, 'YYYY-MM')
|
where TO_CHAR(data_date, 'YYYY-MM') = TO_CHAR(SYSDATE, 'YYYY-MM')
|
||||||
<if test="orgCodes != null and orgCodes.size() > 0">
|
<if test="orgCodes != null and orgCodes.size() > 0">
|
||||||
and
|
and
|
||||||
@@ -196,7 +196,7 @@
|
|||||||
|
|
||||||
<select id="monitorDayStats" resultType="com.renkang.watch.api.bean.response.MonitorDayStats">
|
<select id="monitorDayStats" resultType="com.renkang.watch.api.bean.response.MonitorDayStats">
|
||||||
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
|
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
|
from QH_WAT_MONITOR_DATA
|
||||||
where TO_CHAR(data_date, 'YYYY-MM') = TO_CHAR(#{monthDate,jdbcType=DATE}, 'YYYY-MM')
|
where TO_CHAR(data_date, 'YYYY-MM') = TO_CHAR(#{monthDate,jdbcType=DATE}, 'YYYY-MM')
|
||||||
<if test="orgCodes != null and orgCodes.size() > 0">
|
<if test="orgCodes != null and orgCodes.size() > 0">
|
||||||
and
|
and
|
||||||
@@ -210,7 +210,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
watch_monitor_data
|
QH_WAT_MONITOR_DATA
|
||||||
WHERE
|
WHERE
|
||||||
lon_gd IS NOT NULL
|
lon_gd IS NOT NULL
|
||||||
AND lat_gd IS NOT NULL
|
AND lat_gd IS NOT NULL
|
||||||
|
|||||||
+19
-19
@@ -15,7 +15,7 @@
|
|||||||
data_date as dataDate,
|
data_date as dataDate,
|
||||||
TO_CHAR( data_date, 'MM' ) AS dateStr
|
TO_CHAR( data_date, 'MM' ) AS dateStr
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_heart_rate
|
QH_WAT_STA_US_DAY_HEA_RAT
|
||||||
WHERE
|
WHERE
|
||||||
EXTRACT(YEAR FROM data_date) = #{dateYear}
|
EXTRACT(YEAR FROM data_date) = #{dateYear}
|
||||||
and
|
and
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
min(min_value) as heartRateMin,
|
min(min_value) as heartRateMin,
|
||||||
avg(avg_value) as heartRateAvg
|
avg(avg_value) as heartRateAvg
|
||||||
from
|
from
|
||||||
watch_stat_user_info_day_heart_rate
|
QH_WAT_STA_US_DAY_HEA_RAT
|
||||||
<where>
|
<where>
|
||||||
org_code like concat(#{#orgCode}, '%')
|
org_code like concat(#{#orgCode}, '%')
|
||||||
<if test="startTime!=null">
|
<if test="startTime!=null">
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
COUNT(DISTINCT user_id)
|
COUNT(DISTINCT user_id)
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_heart_rate
|
QH_WAT_STA_US_DAY_HEA_RAT
|
||||||
<where>
|
<where>
|
||||||
org_code like concat(#{#orgCode}, '%')
|
org_code like concat(#{#orgCode}, '%')
|
||||||
<if test="startTime!=null">
|
<if test="startTime!=null">
|
||||||
@@ -73,9 +73,9 @@
|
|||||||
ELSE 0
|
ELSE 0
|
||||||
END AS risk_count
|
END AS risk_count
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_heart_rate a
|
QH_WAT_STA_US_DAY_HEA_RAT a
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
(SELECT DISTINCT bind_user_id FROM watch_monitor_data
|
(SELECT DISTINCT bind_user_id FROM QH_WAT_MONITOR_DATA
|
||||||
WHERE warn_time BETWEEN
|
WHERE warn_time BETWEEN
|
||||||
<choose>
|
<choose>
|
||||||
<when test="type == 'day'">TRUNC(SYSDATE)</when>
|
<when test="type == 'day'">TRUNC(SYSDATE)</when>
|
||||||
@@ -121,9 +121,9 @@
|
|||||||
ELSE 0
|
ELSE 0
|
||||||
END AS risk_count
|
END AS risk_count
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_spo2 a
|
QH_WAT_STAT_USER_DAY_SPO2 a
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
(SELECT DISTINCT bind_user_id FROM watch_monitor_data
|
(SELECT DISTINCT bind_user_id FROM QH_WAT_MONITOR_DATA
|
||||||
WHERE warn_time BETWEEN
|
WHERE warn_time BETWEEN
|
||||||
<choose>
|
<choose>
|
||||||
<when test="type == 'day'">TRUNC(SYSDATE)</when>
|
<when test="type == 'day'">TRUNC(SYSDATE)</when>
|
||||||
@@ -168,9 +168,9 @@
|
|||||||
ELSE 0
|
ELSE 0
|
||||||
END AS risk_count
|
END AS risk_count
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_stress a
|
QH_WAT_STAT_USER_DAY_STRE a
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
(SELECT DISTINCT bind_user_id FROM watch_monitor_data
|
(SELECT DISTINCT bind_user_id FROM QH_WAT_MONITOR_DATA
|
||||||
WHERE warn_time BETWEEN
|
WHERE warn_time BETWEEN
|
||||||
<choose>
|
<choose>
|
||||||
<when test="type == 'day'">TRUNC(SYSDATE)</when>
|
<when test="type == 'day'">TRUNC(SYSDATE)</when>
|
||||||
@@ -215,9 +215,9 @@
|
|||||||
ELSE 0
|
ELSE 0
|
||||||
END AS risk_count
|
END AS risk_count
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_temp a
|
QH_WAT_STAT_USER_DAY_TEMP a
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
(SELECT DISTINCT bind_user_id FROM watch_monitor_data
|
(SELECT DISTINCT bind_user_id FROM QH_WAT_MONITOR_DATA
|
||||||
WHERE warn_time BETWEEN
|
WHERE warn_time BETWEEN
|
||||||
<choose>
|
<choose>
|
||||||
<when test="type == 'day'">TRUNC(SYSDATE)</when>
|
<when test="type == 'day'">TRUNC(SYSDATE)</when>
|
||||||
@@ -251,7 +251,7 @@
|
|||||||
a.user_id,
|
a.user_id,
|
||||||
MAX(a.step_value) AS sdc_value
|
MAX(a.step_value) AS sdc_value
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_sdc a
|
QH_WAT_STAT_USER_DAY_SDC a
|
||||||
WHERE
|
WHERE
|
||||||
a.data_date BETWEEN
|
a.data_date BETWEEN
|
||||||
<choose>
|
<choose>
|
||||||
@@ -278,7 +278,7 @@
|
|||||||
AVG(COALESCE(light_sleep_times, 0)) AS avg_long_duration,
|
AVG(COALESCE(light_sleep_times, 0)) AS avg_long_duration,
|
||||||
SUM(COALESCE(light_sleep_times, 0)) + SUM(COALESCE(deep_sleep_times, 0)) AS sleep_duration
|
SUM(COALESCE(light_sleep_times, 0)) + SUM(COALESCE(deep_sleep_times, 0)) AS sleep_duration
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_sleep
|
QH_WAT_STAT_USER_DAY_SLE
|
||||||
WHERE
|
WHERE
|
||||||
data_date BETWEEN
|
data_date BETWEEN
|
||||||
<choose>
|
<choose>
|
||||||
@@ -301,10 +301,10 @@
|
|||||||
SELECT
|
SELECT
|
||||||
wsd.*
|
wsd.*
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_heart_rate wsd
|
QH_WAT_STA_US_DAY_HEA_RAT wsd
|
||||||
JOIN
|
JOIN
|
||||||
( SELECT user_id, MAX( data_date ) AS latest_date
|
( SELECT user_id, MAX( data_date ) AS latest_date
|
||||||
FROM watch_stat_user_info_day_heart_rate
|
FROM QH_WAT_STA_US_DAY_HEA_RAT
|
||||||
WHERE user_id in
|
WHERE user_id in
|
||||||
<foreach collection="userIds" item="id" open="(" separator="," close=")">
|
<foreach collection="userIds" item="id" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
@@ -315,7 +315,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertStat">
|
<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 QH_WAT_STA_US_DAY_HEA_RAT ( 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
|
SELECT
|
||||||
#{id,jdbcType=VARCHAR},
|
#{id,jdbcType=VARCHAR},
|
||||||
bind_user_id,
|
bind_user_id,
|
||||||
@@ -336,7 +336,7 @@
|
|||||||
t.*,
|
t.*,
|
||||||
ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||||
FROM
|
FROM
|
||||||
watch_data_heart_rate t
|
QH_WAT_DATA_HEART_RATE t
|
||||||
WHERE
|
WHERE
|
||||||
bind_user_id = #{userId,jdbcType=VARCHAR}
|
bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}
|
and data_date = #{dataDate,jdbcType=DATE}
|
||||||
@@ -348,7 +348,7 @@
|
|||||||
|
|
||||||
<!-- MySQL 的 UPDATE ... LEFT JOIN ... SET 语法已改写为达梦兼容的 MERGE INTO -->
|
<!-- MySQL 的 UPDATE ... LEFT JOIN ... SET 语法已改写为达梦兼容的 MERGE INTO -->
|
||||||
<update id="updateStat">
|
<update id="updateStat">
|
||||||
MERGE INTO watch_stat_user_info_day_heart_rate stat
|
MERGE INTO QH_WAT_STA_US_DAY_HEA_RAT stat
|
||||||
USING (
|
USING (
|
||||||
SELECT
|
SELECT
|
||||||
wd.bind_user_id,
|
wd.bind_user_id,
|
||||||
@@ -364,7 +364,7 @@
|
|||||||
MAX( CASE WHEN wd.rn = 1 THEN wd.silence_value END ) AS silence_new_value
|
MAX( CASE WHEN wd.rn = 1 THEN wd.silence_value END ) AS silence_new_value
|
||||||
FROM
|
FROM
|
||||||
( SELECT t.*, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
( 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
|
FROM QH_WAT_DATA_HEART_RATE t
|
||||||
WHERE bind_user_id = #{userId,jdbcType=VARCHAR}
|
WHERE bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
AND data_date = #{dataDate,jdbcType=DATE} ) wd
|
AND data_date = #{dataDate,jdbcType=DATE} ) wd
|
||||||
GROUP BY
|
GROUP BY
|
||||||
|
|||||||
+14
-14
@@ -12,7 +12,7 @@
|
|||||||
data_date as dataDate,
|
data_date as dataDate,
|
||||||
TO_CHAR( data_date, 'MM' ) AS dateStr
|
TO_CHAR( data_date, 'MM' ) AS dateStr
|
||||||
FROM
|
FROM
|
||||||
"watch_stat_user_info_day_sdc"
|
"QH_WAT_STAT_USER_DAY_SDC"
|
||||||
WHERE
|
WHERE
|
||||||
EXTRACT(YEAR FROM data_date) = #{dateYear}
|
EXTRACT(YEAR FROM data_date) = #{dateYear}
|
||||||
and
|
and
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
calorie_value as calorieValue,
|
calorie_value as calorieValue,
|
||||||
data_date as dataDate
|
data_date as dataDate
|
||||||
FROM
|
FROM
|
||||||
"watch_stat_user_info_day_sdc"
|
"QH_WAT_STAT_USER_DAY_SDC"
|
||||||
WHERE
|
WHERE
|
||||||
EXTRACT(YEAR FROM data_date) = #{req.dateYear}
|
EXTRACT(YEAR FROM data_date) = #{req.dateYear}
|
||||||
and
|
and
|
||||||
@@ -76,9 +76,9 @@
|
|||||||
s.calorie_value,
|
s.calorie_value,
|
||||||
COALESCE(w.org_code, s.org_code) AS org_code
|
COALESCE(w.org_code, s.org_code) AS org_code
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_workout AS w
|
QH_WAT_STAT_USER_DAY_WORK AS w
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
watch_stat_user_info_day_sdc AS s ON w.user_id = s.user_id AND w.data_date = s.data_date
|
QH_WAT_STAT_USER_DAY_SDC AS s ON w.user_id = s.user_id AND w.data_date = s.data_date
|
||||||
<where>
|
<where>
|
||||||
<if test="dto.userIds != null and dto.userIds.size() > 0">
|
<if test="dto.userIds != null and dto.userIds.size() > 0">
|
||||||
AND (w.user_id IN
|
AND (w.user_id IN
|
||||||
@@ -127,9 +127,9 @@
|
|||||||
s.calorie_value,
|
s.calorie_value,
|
||||||
COALESCE(s.org_code, w.org_code) AS org_code
|
COALESCE(s.org_code, w.org_code) AS org_code
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_sdc AS s
|
QH_WAT_STAT_USER_DAY_SDC AS s
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
watch_stat_user_info_day_workout AS w ON s.user_id = w.user_id AND s.data_date = w.data_date
|
QH_WAT_STAT_USER_DAY_WORK AS w ON s.user_id = w.user_id AND s.data_date = w.data_date
|
||||||
<where>
|
<where>
|
||||||
<if test="dto.userIds != null and dto.userIds.size() > 0">
|
<if test="dto.userIds != null and dto.userIds.size() > 0">
|
||||||
AND (s.user_id IN
|
AND (s.user_id IN
|
||||||
@@ -166,27 +166,27 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertStat">
|
<insert id="insertStat">
|
||||||
insert into watch_stat_user_info_day_sdc(id, user_id, step_value, distance_value, calorie_value, last_upload_time, data_date, org_code)
|
insert into QH_WAT_STAT_USER_DAY_SDC(id, user_id, step_value, distance_value, calorie_value, last_upload_time, data_date, org_code)
|
||||||
(select #{id,jdbcType=VARCHAR},
|
(select #{id,jdbcType=VARCHAR},
|
||||||
#{userId,jdbcType=VARCHAR},
|
#{userId,jdbcType=VARCHAR},
|
||||||
(select max(data_value)
|
(select max(data_value)
|
||||||
from (select data_value, data_date,
|
from (select data_value, data_date,
|
||||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id ORDER BY data_date desc) as rn
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id ORDER BY data_date desc) as rn
|
||||||
from watch_data_steps
|
from QH_WAT_DATA_STEPS
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE})
|
and data_date = #{dataDate,jdbcType=DATE})
|
||||||
where rn = 1) as step_value,
|
where rn = 1) as step_value,
|
||||||
(select max(data_value)
|
(select max(data_value)
|
||||||
from (select data_value, data_date,
|
from (select data_value, data_date,
|
||||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id ORDER BY data_date desc) as rn
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id ORDER BY data_date desc) as rn
|
||||||
from watch_data_distance
|
from QH_WAT_DATA_DISTANCE
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE})
|
and data_date = #{dataDate,jdbcType=DATE})
|
||||||
where rn = 1) as distance_value,
|
where rn = 1) as distance_value,
|
||||||
(select max(data_value)
|
(select max(data_value)
|
||||||
from (select data_value, data_date,
|
from (select data_value, data_date,
|
||||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id ORDER BY data_date desc) as rn
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id ORDER BY data_date desc) as rn
|
||||||
from watch_data_calorie
|
from QH_WAT_DATA_CALORIE
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE})
|
and data_date = #{dataDate,jdbcType=DATE})
|
||||||
where rn = 1) as calorie_value,
|
where rn = 1) as calorie_value,
|
||||||
@@ -197,25 +197,25 @@
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateStat">
|
<update id="updateStat">
|
||||||
update watch_stat_user_info_day_sdc stat
|
update QH_WAT_STAT_USER_DAY_SDC stat
|
||||||
set stat.step_value = (select max(data_value)
|
set stat.step_value = (select max(data_value)
|
||||||
from (select data_value, data_date,
|
from (select data_value, data_date,
|
||||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id ORDER BY data_date desc) as rn
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id ORDER BY data_date desc) as rn
|
||||||
from watch_data_steps
|
from QH_WAT_DATA_STEPS
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE})
|
and data_date = #{dataDate,jdbcType=DATE})
|
||||||
where rn = 1),
|
where rn = 1),
|
||||||
stat.distance_value = (select max(data_value)
|
stat.distance_value = (select max(data_value)
|
||||||
from (select data_value, data_date,
|
from (select data_value, data_date,
|
||||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id ORDER BY data_date desc) as rn
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id ORDER BY data_date desc) as rn
|
||||||
from watch_data_distance
|
from QH_WAT_DATA_DISTANCE
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE})
|
and data_date = #{dataDate,jdbcType=DATE})
|
||||||
where rn = 1),
|
where rn = 1),
|
||||||
stat.calorie_value = (select max(data_value)
|
stat.calorie_value = (select max(data_value)
|
||||||
from (select data_value, data_date,
|
from (select data_value, data_date,
|
||||||
ROW_NUMBER() OVER (PARTITION BY bind_user_id ORDER BY data_date desc) as rn
|
ROW_NUMBER() OVER (PARTITION BY bind_user_id ORDER BY data_date desc) as rn
|
||||||
from watch_data_calorie
|
from QH_WAT_DATA_CALORIE
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE})
|
and data_date = #{dataDate,jdbcType=DATE})
|
||||||
where rn = 1),
|
where rn = 1),
|
||||||
|
|||||||
+10
-10
@@ -18,7 +18,7 @@
|
|||||||
data_date as dataDate,
|
data_date as dataDate,
|
||||||
TO_CHAR( data_date, 'MM' ) AS dateStr
|
TO_CHAR( data_date, 'MM' ) AS dateStr
|
||||||
FROM
|
FROM
|
||||||
"watch_stat_user_info_day_sleep"
|
"QH_WAT_STAT_USER_DAY_SLE"
|
||||||
WHERE
|
WHERE
|
||||||
EXTRACT(YEAR FROM data_date) = #{dateYear}
|
EXTRACT(YEAR FROM data_date) = #{dateYear}
|
||||||
and
|
and
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
<select id="selectDaySleepByUserIdAndDate" resultType="com.renkang.watch.vo.UserData.res.sleep.WatchDataSleepRes">
|
<select id="selectDaySleepByUserIdAndDate" resultType="com.renkang.watch.vo.UserData.res.sleep.WatchDataSleepRes">
|
||||||
select
|
select
|
||||||
*
|
*
|
||||||
from watch_stat_user_info_day_sleep
|
from QH_WAT_STAT_USER_DAY_SLE
|
||||||
where user_id = #{userId}
|
where user_id = #{userId}
|
||||||
and data_date = DATE(#{dataDate})
|
and data_date = DATE(#{dataDate})
|
||||||
</select>
|
</select>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<select id="selectDaySleepByUserIdAndDateList" resultType="com.renkang.watch.vo.UserData.res.sleep.WatchDataSleepRes">
|
<select id="selectDaySleepByUserIdAndDateList" resultType="com.renkang.watch.vo.UserData.res.sleep.WatchDataSleepRes">
|
||||||
select
|
select
|
||||||
*
|
*
|
||||||
from watch_stat_user_info_day_sleep
|
from QH_WAT_STAT_USER_DAY_SLE
|
||||||
where user_id = #{userId}
|
where user_id = #{userId}
|
||||||
and data_date >= DATE(#{startTime})
|
and data_date >= DATE(#{startTime})
|
||||||
and data_date <= DATE(#{endTime})
|
and data_date <= DATE(#{endTime})
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<insert id="insertStat">
|
<insert id="insertStat">
|
||||||
insert into watch_stat_user_info_day_sleep(id, user_id, long_count, long_duration_max, long_duration_min,
|
insert into QH_WAT_STAT_USER_DAY_SLE(id, user_id, long_count, long_duration_max, long_duration_min,
|
||||||
long_duration_total, short_count, short_duration_max, short_duration_min,
|
long_duration_total, short_count, short_duration_max, short_duration_min,
|
||||||
short_duration_total, deep_sleep_times, light_sleep_times, deep_light_times,
|
short_duration_total, deep_sleep_times, light_sleep_times, deep_light_times,
|
||||||
sleep_id, last_upload_time, data_date, org_code)
|
sleep_id, last_upload_time, data_date, org_code)
|
||||||
@@ -72,8 +72,8 @@
|
|||||||
max(sm.end_time) as last_upload_time,
|
max(sm.end_time) as last_upload_time,
|
||||||
data_date,
|
data_date,
|
||||||
#{orgCode,jdbcType=VARCHAR}
|
#{orgCode,jdbcType=VARCHAR}
|
||||||
from watch_data_sleep_new s
|
from QH_WAT_DATA_SLEEP_NEW s
|
||||||
left join watch_data_sleep_new_minute sm on s.id = sm.sleep_id
|
left join QH_WAT_DATA_SLEEP_NEW_MIN sm on s.id = sm.sleep_id
|
||||||
where s.bind_user_id = #{userId,jdbcType=VARCHAR}
|
where s.bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and s.data_date = #{dataDate,jdbcType=DATE}
|
and s.data_date = #{dataDate,jdbcType=DATE}
|
||||||
and s.sleep_flag = '1'
|
and s.sleep_flag = '1'
|
||||||
@@ -82,7 +82,7 @@
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateStat">
|
<update id="updateStat">
|
||||||
update watch_stat_user_info_day_sleep stat
|
update QH_WAT_STAT_USER_DAY_SLE stat
|
||||||
left join (select s.bind_user_id,
|
left join (select s.bind_user_id,
|
||||||
count(case when sm.sleep_type = '1' then 1 end) as long_count,
|
count(case when sm.sleep_type = '1' then 1 end) as long_count,
|
||||||
max(case when sm.sleep_type = '1' then time_to_sec(timediff(sm.end_time, sm.start_time)) end) /
|
max(case when sm.sleep_type = '1' then time_to_sec(timediff(sm.end_time, sm.start_time)) end) /
|
||||||
@@ -104,8 +104,8 @@
|
|||||||
max(s.id) as sleep_id,
|
max(s.id) as sleep_id,
|
||||||
max(sm.end_time) as last_upload_time,
|
max(sm.end_time) as last_upload_time,
|
||||||
data_date
|
data_date
|
||||||
from watch_data_sleep_new s
|
from QH_WAT_DATA_SLEEP_NEW s
|
||||||
left join watch_data_sleep_new_minute sm on s.id = sm.sleep_id
|
left join QH_WAT_DATA_SLEEP_NEW_MIN sm on s.id = sm.sleep_id
|
||||||
where s.bind_user_id = #{userId,jdbcType=VARCHAR}
|
where s.bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and s.data_date = #{dataDate,jdbcType=DATE}
|
and s.data_date = #{dataDate,jdbcType=DATE}
|
||||||
and s.sleep_flag = '1'
|
and s.sleep_flag = '1'
|
||||||
@@ -131,7 +131,7 @@
|
|||||||
|
|
||||||
<select id="countDistinctUser" resultType="java.lang.Integer">
|
<select id="countDistinctUser" resultType="java.lang.Integer">
|
||||||
SELECT COUNT(DISTINCT user_id)
|
SELECT COUNT(DISTINCT user_id)
|
||||||
FROM watch_stat_user_info_day_sleep
|
FROM QH_WAT_STAT_USER_DAY_SLE
|
||||||
WHERE data_date BETWEEN #{startDate} AND #{endDate}
|
WHERE data_date BETWEEN #{startDate} AND #{endDate}
|
||||||
AND user_id IS NOT NULL
|
AND user_id IS NOT NULL
|
||||||
<if test="orgCode != null and orgCode != ''">
|
<if test="orgCode != null and orgCode != ''">
|
||||||
|
|||||||
+10
-10
@@ -12,7 +12,7 @@
|
|||||||
data_date as dataDate,
|
data_date as dataDate,
|
||||||
TO_CHAR( data_date, 'MM' ) AS dateStr
|
TO_CHAR( data_date, 'MM' ) AS dateStr
|
||||||
FROM
|
FROM
|
||||||
"watch_stat_user_info_day_spo2"
|
"QH_WAT_STAT_USER_DAY_SPO2"
|
||||||
WHERE
|
WHERE
|
||||||
EXTRACT(YEAR FROM data_date) = #{dateYear}
|
EXTRACT(YEAR FROM data_date) = #{dateYear}
|
||||||
and
|
and
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
COUNT(DISTINCT user_id)
|
COUNT(DISTINCT user_id)
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_spo2
|
QH_WAT_STAT_USER_DAY_SPO2
|
||||||
<where>
|
<where>
|
||||||
org_code like concat(#{#orgCode}, '%')
|
org_code like concat(#{#orgCode}, '%')
|
||||||
<if test="startTime!=null">
|
<if test="startTime!=null">
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
<!-- 切记 此代码不能直接平移至四合一项目 ,该 sql 只适用 mysql8.0 及以上版本 ,四合一项目开发测试环境的 mysql 版本过低 , 但不影响正式环境-->
|
<!-- 切记 此代码不能直接平移至四合一项目 ,该 sql 只适用 mysql8.0 及以上版本 ,四合一项目开发测试环境的 mysql 版本过低 , 但不影响正式环境-->
|
||||||
<insert id="insertStat">
|
<insert id="insertStat">
|
||||||
insert into watch_stat_user_info_day_spo2(id, user_id, max_value, min_value, avg_value, last_upload_time,
|
insert into QH_WAT_STAT_USER_DAY_SPO2(id, user_id, max_value, min_value, avg_value, last_upload_time,
|
||||||
new_value, data_date, org_code)
|
new_value, data_date, org_code)
|
||||||
(SELECT #{id,jdbcType=VARCHAR},
|
(SELECT #{id,jdbcType=VARCHAR},
|
||||||
bind_user_id,
|
bind_user_id,
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
data_date,
|
data_date,
|
||||||
#{orgCode,jdbcType=VARCHAR}
|
#{orgCode,jdbcType=VARCHAR}
|
||||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||||
FROM watch_data_spo2
|
FROM QH_WAT_DATA_SPO2
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id,
|
GROUP BY wd.bind_user_id,
|
||||||
@@ -59,34 +59,34 @@
|
|||||||
|
|
||||||
<!-- 切记 此代码不能直接平移至四合一项目 ,该 sql 只适用 mysql8.0 及以上版本 ,四合一项目开发测试环境的 mysql 版本过低 , 但不影响正式环境-->
|
<!-- 切记 此代码不能直接平移至四合一项目 ,该 sql 只适用 mysql8.0 及以上版本 ,四合一项目开发测试环境的 mysql 版本过低 , 但不影响正式环境-->
|
||||||
<update id="updateStat">
|
<update id="updateStat">
|
||||||
UPDATE watch_stat_user_info_day_spo2 stat
|
UPDATE QH_WAT_STAT_USER_DAY_SPO2 stat
|
||||||
SET stat.max_value = (SELECT NVL(MAX(wd.data_value), 0) AS max_value
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||||
FROM watch_data_spo2
|
FROM QH_WAT_DATA_SPO2
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
GROUP BY wd.bind_user_id, wd.data_date),
|
||||||
stat.min_value = (SELECT NVL(MIN(wd.data_value), 0) AS min_value
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||||
FROM watch_data_spo2
|
FROM QH_WAT_DATA_SPO2
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
GROUP BY wd.bind_user_id, wd.data_date),
|
||||||
stat.avg_value = (SELECT NVL(AVG(wd.data_value), 0) AS avg_value
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||||
FROM watch_data_spo2
|
FROM QH_WAT_DATA_SPO2
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
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'))
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||||
FROM watch_data_spo2
|
FROM QH_WAT_DATA_SPO2
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
GROUP BY wd.bind_user_id, wd.data_date),
|
||||||
stat.new_value = (SELECT MAX(CASE WHEN wd.rn = 1 THEN wd.data_value END)
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||||
FROM watch_data_spo2
|
FROM QH_WAT_DATA_SPO2
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
GROUP BY wd.bind_user_id, wd.data_date),
|
||||||
|
|||||||
+9
-9
@@ -12,7 +12,7 @@
|
|||||||
data_date as dataDate,
|
data_date as dataDate,
|
||||||
TO_CHAR( data_date, 'MM' ) AS dateStr
|
TO_CHAR( data_date, 'MM' ) AS dateStr
|
||||||
FROM
|
FROM
|
||||||
"watch_stat_user_info_day_stress"
|
"QH_WAT_STAT_USER_DAY_STRE"
|
||||||
WHERE
|
WHERE
|
||||||
EXTRACT(YEAR FROM data_date) = #{dateYear}
|
EXTRACT(YEAR FROM data_date) = #{dateYear}
|
||||||
and
|
and
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
<!-- 切记 此代码不能直接平移至四合一项目 ,该 sql 只适用 mysql8.0 及以上版本 ,四合一项目开发测试环境的 mysql 版本过低 , 但不影响正式环境-->
|
<!-- 切记 此代码不能直接平移至四合一项目 ,该 sql 只适用 mysql8.0 及以上版本 ,四合一项目开发测试环境的 mysql 版本过低 , 但不影响正式环境-->
|
||||||
<insert id="insertStat">
|
<insert id="insertStat">
|
||||||
insert into watch_stat_user_info_day_stress(id, user_id, max_value, min_value, avg_value, data_date, last_upload_time, new_value, org_code)
|
insert into QH_WAT_STAT_USER_DAY_STRE(id, user_id, max_value, min_value, avg_value, data_date, last_upload_time, new_value, org_code)
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
#{id,jdbcType=VARCHAR},
|
#{id,jdbcType=VARCHAR},
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
MAX(CASE WHEN wd.rn = 1 THEN wd.data_value END),
|
MAX(CASE WHEN wd.rn = 1 THEN wd.data_value END),
|
||||||
#{orgCode,jdbcType=VARCHAR}
|
#{orgCode,jdbcType=VARCHAR}
|
||||||
FROM
|
FROM
|
||||||
(SELECT *, ROW_NUMBER() OVER (PARTITION BY bind_user_id, data_date ORDER BY end_time_stamp DESC) AS rn FROM watch_data_stress
|
(SELECT *, ROW_NUMBER() OVER (PARTITION BY bind_user_id, data_date ORDER BY end_time_stamp DESC) AS rn FROM QH_WAT_DATA_STRESS
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY
|
GROUP BY
|
||||||
@@ -45,34 +45,34 @@
|
|||||||
|
|
||||||
<!-- 切记 此代码不能直接平移至四合一项目 ,该 sql 只适用 mysql8.0 及以上版本 ,四合一项目开发测试环境的 mysql 版本过低 , 但不影响正式环境-->
|
<!-- 切记 此代码不能直接平移至四合一项目 ,该 sql 只适用 mysql8.0 及以上版本 ,四合一项目开发测试环境的 mysql 版本过低 , 但不影响正式环境-->
|
||||||
<update id="updateStat">
|
<update id="updateStat">
|
||||||
UPDATE watch_stat_user_info_day_stress stat
|
UPDATE QH_WAT_STAT_USER_DAY_STRE stat
|
||||||
SET stat.max_value = (SELECT NVL(MAX(wd.data_value), 0)
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY end_time_stamp DESC ) AS rn
|
||||||
FROM watch_data_stress
|
FROM QH_WAT_DATA_STRESS
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
GROUP BY wd.bind_user_id, wd.data_date),
|
||||||
stat.min_value = (SELECT NVL(MIN(wd.data_value), 0)
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY end_time_stamp DESC ) AS rn
|
||||||
FROM watch_data_stress
|
FROM QH_WAT_DATA_STRESS
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
GROUP BY wd.bind_user_id, wd.data_date),
|
||||||
stat.avg_value = (SELECT NVL(AVG(wd.data_value), 0)
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY end_time_stamp DESC ) AS rn
|
||||||
FROM watch_data_stress
|
FROM QH_WAT_DATA_STRESS
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
GROUP BY wd.bind_user_id, wd.data_date),
|
||||||
stat.last_upload_time = (SELECT NVL(MAX(wd.end_time_stamp), SYSDATE)
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY end_time_stamp DESC ) AS rn
|
||||||
FROM watch_data_stress
|
FROM QH_WAT_DATA_STRESS
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
GROUP BY wd.bind_user_id, wd.data_date),
|
||||||
stat.new_value = (SELECT MAX(CASE WHEN wd.rn = 1 THEN wd.data_value END)
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY end_time_stamp DESC ) AS rn
|
||||||
FROM watch_data_stress
|
FROM QH_WAT_DATA_STRESS
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
GROUP BY wd.bind_user_id, wd.data_date),
|
||||||
|
|||||||
+14
-14
@@ -16,7 +16,7 @@
|
|||||||
data_date as dataDate,
|
data_date as dataDate,
|
||||||
TO_CHAR( data_date, 'MM' ) AS dateStr
|
TO_CHAR( data_date, 'MM' ) AS dateStr
|
||||||
FROM
|
FROM
|
||||||
watch_stat_user_info_day_temp
|
QH_WAT_STAT_USER_DAY_TEMP
|
||||||
WHERE
|
WHERE
|
||||||
YEAR ( data_date )= #{dateYear}
|
YEAR ( data_date )= #{dateYear}
|
||||||
and
|
and
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
<select id="selectBodyTempThreeDays" resultType="com.renkang.watch.vo.UserData.res.bodyTemperature.BodyTempStatRes">
|
<select id="selectBodyTempThreeDays" resultType="com.renkang.watch.vo.UserData.res.bodyTemperature.BodyTempStatRes">
|
||||||
select
|
select
|
||||||
*
|
*
|
||||||
from watch_stat_user_info_day_temp
|
from QH_WAT_STAT_USER_DAY_TEMP
|
||||||
where data_date >= #{startDate} and data_date <= #{endDate}
|
where data_date >= #{startDate} and data_date <= #{endDate}
|
||||||
and user_id = #{userId}
|
and user_id = #{userId}
|
||||||
order by data_date
|
order by data_date
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
<!-- 切记 此代码不能直接平移至四合一项目 ,该 sql 只适用 mysql8.0 及以上版本 ,四合一项目开发测试环境的 mysql 版本过低 , 但不影响正式环境-->
|
<!-- 切记 此代码不能直接平移至四合一项目 ,该 sql 只适用 mysql8.0 及以上版本 ,四合一项目开发测试环境的 mysql 版本过低 , 但不影响正式环境-->
|
||||||
<insert id="insertStat">
|
<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,
|
insert into QH_WAT_STAT_USER_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)
|
skin_avg_value, last_upload_time, new_value, skin_new_value, data_date, org_code)
|
||||||
(SELECT #{id,jdbcType=VARCHAR},
|
(SELECT #{id,jdbcType=VARCHAR},
|
||||||
bind_user_id,
|
bind_user_id,
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
data_date,
|
data_date,
|
||||||
#{orgCode,jdbcType=VARCHAR}
|
#{orgCode,jdbcType=VARCHAR}
|
||||||
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
FROM (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||||
FROM watch_data_temperature
|
FROM QH_WAT_DATA_TEMP
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id,
|
GROUP BY wd.bind_user_id,
|
||||||
@@ -61,58 +61,58 @@
|
|||||||
|
|
||||||
<!-- 切记 此代码不能直接平移至四合一项目 ,该 sql 只适用 mysql8.0 及以上版本 ,四合一项目开发测试环境的 mysql 版本过低 , 但不影响正式环境-->
|
<!-- 切记 此代码不能直接平移至四合一项目 ,该 sql 只适用 mysql8.0 及以上版本 ,四合一项目开发测试环境的 mysql 版本过低 , 但不影响正式环境-->
|
||||||
<update id="updateStat">
|
<update id="updateStat">
|
||||||
UPDATE watch_stat_user_info_day_temp stat
|
UPDATE QH_WAT_STAT_USER_DAY_TEMP stat
|
||||||
SET stat.max_value = (SELECT NVL(MAX(wd.data_value), 0)
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||||
FROM watch_data_temperature
|
FROM QH_WAT_DATA_TEMP
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
GROUP BY wd.bind_user_id, wd.data_date),
|
||||||
stat.min_value = (SELECT NVL(MIN(wd.data_value), 0)
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||||
FROM watch_data_temperature
|
FROM QH_WAT_DATA_TEMP
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
GROUP BY wd.bind_user_id, wd.data_date),
|
||||||
stat.avg_value = (SELECT NVL(AVG(wd.data_value), 0)
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||||
FROM watch_data_temperature
|
FROM QH_WAT_DATA_TEMP
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
GROUP BY wd.bind_user_id, wd.data_date),
|
||||||
stat.skin_max_value = (SELECT NVL(MAX(wd.skin_tempera), 0)
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||||
FROM watch_data_temperature
|
FROM QH_WAT_DATA_TEMP
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
GROUP BY wd.bind_user_id, wd.data_date),
|
||||||
stat.skin_min_value = (SELECT NVL(MIN(wd.skin_tempera), 0)
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||||
FROM watch_data_temperature
|
FROM QH_WAT_DATA_TEMP
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
GROUP BY wd.bind_user_id, wd.data_date),
|
||||||
stat.skin_avg_value = (SELECT NVL(AVG(wd.skin_tempera), 0)
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||||
FROM watch_data_temperature
|
FROM QH_WAT_DATA_TEMP
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
GROUP BY wd.bind_user_id, wd.data_date),
|
||||||
stat.last_upload_time = (SELECT NVL(MAX(wd.time_stamp), SYSDATE)
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||||
FROM watch_data_temperature
|
FROM QH_WAT_DATA_TEMP
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
GROUP BY wd.bind_user_id, wd.data_date),
|
||||||
stat.new_value = (SELECT MAX(CASE WHEN wd.rn = 1 THEN wd.data_value END)
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||||
FROM watch_data_temperature
|
FROM QH_WAT_DATA_TEMP
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
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)
|
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 (SELECT *, ROW_NUMBER() OVER ( PARTITION BY bind_user_id, data_date ORDER BY time_stamp DESC ) AS rn
|
||||||
FROM watch_data_temperature
|
FROM QH_WAT_DATA_TEMP
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}) wd
|
and data_date = #{dataDate,jdbcType=DATE}) wd
|
||||||
GROUP BY wd.bind_user_id, wd.data_date),
|
GROUP BY wd.bind_user_id, wd.data_date),
|
||||||
|
|||||||
+4
-4
@@ -3,7 +3,7 @@
|
|||||||
<mapper namespace="com.renkang.watch.mapper.WatchStatUserInfoDayWorkoutMapper">
|
<mapper namespace="com.renkang.watch.mapper.WatchStatUserInfoDayWorkoutMapper">
|
||||||
|
|
||||||
<insert id="insertStat">
|
<insert id="insertStat">
|
||||||
insert into watch_stat_user_info_day_workout(id, user_id, distance_max_value, distance_min_value, distance_total_value,
|
insert into QH_WAT_STAT_USER_DAY_WORK(id, user_id, distance_max_value, distance_min_value, distance_total_value,
|
||||||
distance_count, calorie_max_value, calorie_min_value, calorie_total_value,
|
distance_count, calorie_max_value, calorie_min_value, calorie_total_value,
|
||||||
calorie_count, duration_max_value, duration_min_value,
|
calorie_count, duration_max_value, duration_min_value,
|
||||||
duration_total_value, duration_count, last_upload_time, data_date, org_code)
|
duration_total_value, duration_count, last_upload_time, data_date, org_code)
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
max(end_time_stamp) as last_upload_time,
|
max(end_time_stamp) as last_upload_time,
|
||||||
data_date,
|
data_date,
|
||||||
#{orgCode,jdbcType=VARCHAR}
|
#{orgCode,jdbcType=VARCHAR}
|
||||||
from watch_data_workout
|
from QH_WAT_DATA_WORKOUT
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}
|
and data_date = #{dataDate,jdbcType=DATE}
|
||||||
group by bind_user_id, data_date
|
group by bind_user_id, data_date
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateStat">
|
<update id="updateStat">
|
||||||
update watch_stat_user_info_day_workout stat
|
update QH_WAT_STAT_USER_DAY_WORK stat
|
||||||
left join (select bind_user_id,
|
left join (select bind_user_id,
|
||||||
max(distance) as distance_max_value,
|
max(distance) as distance_max_value,
|
||||||
min(distance) as distance_min_value,
|
min(distance) as distance_min_value,
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
count(start_time_stamp) as duration_count,
|
count(start_time_stamp) as duration_count,
|
||||||
max(end_time_stamp) as last_upload_time,
|
max(end_time_stamp) as last_upload_time,
|
||||||
data_date
|
data_date
|
||||||
from watch_data_workout
|
from QH_WAT_DATA_WORKOUT
|
||||||
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
where bind_user_id = #{userId,jdbcType=VARCHAR}
|
||||||
and data_date = #{dataDate,jdbcType=DATE}
|
and data_date = #{dataDate,jdbcType=DATE}
|
||||||
group by bind_user_id, data_date
|
group by bind_user_id, data_date
|
||||||
|
|||||||
+17
-17
@@ -2,14 +2,14 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.renkang.watch.mapper.WatchUserDataMapper">
|
<mapper namespace="com.renkang.watch.mapper.WatchUserDataMapper">
|
||||||
<delete id="deleteByWatchNo">
|
<delete id="deleteByWatchNo">
|
||||||
DELETE FROM watch_user_data WHERE watch_no = #{watchNo} and data_date = #{bindDate}
|
DELETE FROM QH_WAT_USER_DATA WHERE watch_no = #{watchNo} and data_date = #{bindDate}
|
||||||
</delete>
|
</delete>
|
||||||
<select id="getWatchUserData" resultType="com.renkang.watch.entity.WatchUserData">
|
<select id="getWatchUserData" resultType="com.renkang.watch.entity.WatchUserData">
|
||||||
SELECT
|
SELECT
|
||||||
bind_user_id AS bindUserId,
|
bind_user_id AS bindUserId,
|
||||||
watch_no AS watchNo
|
watch_no AS watchNo
|
||||||
FROM
|
FROM
|
||||||
watch_user_data
|
QH_WAT_USER_DATA
|
||||||
where
|
where
|
||||||
data_date >=#{start}
|
data_date >=#{start}
|
||||||
and
|
and
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
bind_user_id AS bindUserId,
|
bind_user_id AS bindUserId,
|
||||||
watch_no AS watchNo
|
watch_no AS watchNo
|
||||||
FROM
|
FROM
|
||||||
watch_user_data
|
QH_WAT_USER_DATA
|
||||||
where
|
where
|
||||||
data_date >=#{start}
|
data_date >=#{start}
|
||||||
and
|
and
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
<select id="selectSevenActiveList" resultType="String">
|
<select id="selectSevenActiveList" resultType="String">
|
||||||
select
|
select
|
||||||
DISTINCT bind_user_id AS "bindUserId"
|
DISTINCT bind_user_id AS "bindUserId"
|
||||||
from watch_user_data
|
from QH_WAT_USER_DATA
|
||||||
WHERE data_date >= CURDATE() - INTERVAL 6 DAY
|
WHERE data_date >= CURDATE() - INTERVAL 6 DAY
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -54,14 +54,14 @@
|
|||||||
<select id="selectThirtyActiveList" resultType="String">
|
<select id="selectThirtyActiveList" resultType="String">
|
||||||
select
|
select
|
||||||
DISTINCT bind_user_id AS "bindUserId"
|
DISTINCT bind_user_id AS "bindUserId"
|
||||||
from watch_user_data
|
from QH_WAT_USER_DATA
|
||||||
WHERE data_date >= CURDATE() - INTERVAL 29 DAY
|
WHERE data_date >= CURDATE() - INTERVAL 29 DAY
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectActiveUserIds" resultType="java.lang.String">
|
<select id="selectActiveUserIds" resultType="java.lang.String">
|
||||||
select
|
select
|
||||||
DISTINCT bind_user_id AS "bindUserId"
|
DISTINCT bind_user_id AS "bindUserId"
|
||||||
from watch_user_data
|
from QH_WAT_USER_DATA
|
||||||
<where>
|
<where>
|
||||||
watch_no in
|
watch_no in
|
||||||
<foreach collection="watchNos" item="watchNo" open="(" close=")" separator=",">
|
<foreach collection="watchNos" item="watchNo" open="(" close=")" separator=",">
|
||||||
@@ -80,51 +80,51 @@
|
|||||||
<select id="distanceMap" resultType="java.util.Map">
|
<select id="distanceMap" resultType="java.util.Map">
|
||||||
select data_value dateValue,
|
select data_value dateValue,
|
||||||
TO_CHAR(sdc_date, 'YYYY-MM-DD') sdcDate
|
TO_CHAR(sdc_date, 'YYYY-MM-DD') sdcDate
|
||||||
from watch_data_distance
|
from QH_WAT_DATA_DISTANCE
|
||||||
WHERE sdc_date BETWEEN #{date1} AND #{date2}
|
WHERE sdc_date BETWEEN #{date1} AND #{date2}
|
||||||
</select>
|
</select>
|
||||||
<select id="heartRateMap" resultType="java.util.Map">
|
<select id="heartRateMap" resultType="java.util.Map">
|
||||||
select data_value dateValue
|
select data_value dateValue
|
||||||
from watch_data_heart_rate
|
from QH_WAT_DATA_HEART_RATE
|
||||||
WHERE TO_CHAR(data_date, 'YYYY-MM-DD') = #{queryDateStr}
|
WHERE TO_CHAR(data_date, 'YYYY-MM-DD') = #{queryDateStr}
|
||||||
</select>
|
</select>
|
||||||
<select id="spo2Map" resultType="java.util.Map">
|
<select id="spo2Map" resultType="java.util.Map">
|
||||||
select data_value dateValue
|
select data_value dateValue
|
||||||
from watch_data_spo2
|
from QH_WAT_DATA_SPO2
|
||||||
WHERE TO_CHAR(data_date, 'YYYY-MM-DD') = #{queryDateStr}
|
WHERE TO_CHAR(data_date, 'YYYY-MM-DD') = #{queryDateStr}
|
||||||
</select>
|
</select>
|
||||||
<select id="stressMap" resultType="java.util.Map">
|
<select id="stressMap" resultType="java.util.Map">
|
||||||
select data_value dateValue
|
select data_value dateValue
|
||||||
from watch_data_stress
|
from QH_WAT_DATA_STRESS
|
||||||
WHERE TO_CHAR(data_date, 'YYYY-MM-DD') = #{queryDateStr}
|
WHERE TO_CHAR(data_date, 'YYYY-MM-DD') = #{queryDateStr}
|
||||||
</select>
|
</select>
|
||||||
<select id="getUserDataByWeekly" resultType="java.util.Map">
|
<select id="getUserDataByWeekly" resultType="java.util.Map">
|
||||||
SELECT 'heart_rate' AS metric, AVG(avg_value) AS value
|
SELECT 'heart_rate' AS metric, AVG(avg_value) AS value
|
||||||
FROM watch_stat_user_info_day_heart_rate
|
FROM QH_WAT_STA_US_DAY_HEA_RAT
|
||||||
WHERE org_code LIKE CONCAT(#{orgCode}, '%') AND data_date BETWEEN #{monday} AND #{sunday}
|
WHERE org_code LIKE CONCAT(#{orgCode}, '%') AND data_date BETWEEN #{monday} AND #{sunday}
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT 'spo2' AS metric, AVG(avg_value) AS value
|
SELECT 'spo2' AS metric, AVG(avg_value) AS value
|
||||||
FROM watch_stat_user_info_day_spo2
|
FROM QH_WAT_STAT_USER_DAY_SPO2
|
||||||
WHERE org_code LIKE CONCAT(#{orgCode}, '%') AND data_date BETWEEN #{monday} AND #{sunday}
|
WHERE org_code LIKE CONCAT(#{orgCode}, '%') AND data_date BETWEEN #{monday} AND #{sunday}
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT 'stress' AS metric, AVG(avg_value) AS value
|
SELECT 'stress' AS metric, AVG(avg_value) AS value
|
||||||
FROM watch_stat_user_info_day_stress
|
FROM QH_WAT_STAT_USER_DAY_STRE
|
||||||
WHERE org_code LIKE CONCAT(#{orgCode}, '%') AND data_date BETWEEN #{monday} AND #{sunday}
|
WHERE org_code LIKE CONCAT(#{orgCode}, '%') AND data_date BETWEEN #{monday} AND #{sunday}
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT 'sdc' AS metric, AVG(step_value) AS value
|
SELECT 'sdc' AS metric, AVG(step_value) AS value
|
||||||
FROM watch_stat_user_info_day_sdc
|
FROM QH_WAT_STAT_USER_DAY_SDC
|
||||||
WHERE org_code LIKE CONCAT(#{orgCode}, '%') AND data_date BETWEEN #{monday} AND #{sunday}
|
WHERE org_code LIKE CONCAT(#{orgCode}, '%') AND data_date BETWEEN #{monday} AND #{sunday}
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT 'temp' AS metric, AVG(avg_value) AS value
|
SELECT 'temp' AS metric, AVG(avg_value) AS value
|
||||||
FROM watch_stat_user_info_day_temp
|
FROM QH_WAT_STAT_USER_DAY_TEMP
|
||||||
WHERE org_code LIKE CONCAT(#{orgCode}, '%') AND data_date BETWEEN #{monday} AND #{sunday};
|
WHERE org_code LIKE CONCAT(#{orgCode}, '%') AND data_date BETWEEN #{monday} AND #{sunday};
|
||||||
</select>
|
</select>
|
||||||
<select id="getDeviceInactive" resultType="java.lang.Long">
|
<select id="getDeviceInactive" resultType="java.lang.Long">
|
||||||
SELECT count(wd.bind_user_id) as total
|
SELECT count(wd.bind_user_id) as total
|
||||||
FROM watch_device wd
|
FROM QH_WAT_DEVICE wd
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT bind_user_id
|
SELECT bind_user_id
|
||||||
FROM watch_user_data
|
FROM QH_WAT_USER_DATA
|
||||||
WHERE data_date BETWEEN #{monday} AND #{sunday}
|
WHERE data_date BETWEEN #{monday} AND #{sunday}
|
||||||
) AS wud ON wd.bind_user_id = wud.bind_user_id
|
) AS wud ON wd.bind_user_id = wud.bind_user_id
|
||||||
WHERE wd.dept_id = #{deptId}
|
WHERE wd.dept_id = #{deptId}
|
||||||
|
|||||||
Reference in New Issue
Block a user