feat(watch): 关爱人员统计新增期初未佩戴人数列
新增关爱人员未佩戴人数(仅计入统计日期起期已绑定的人数)列, 通过 bind_date <= 统计起始日期 条件过滤,仅计入统计起期已绑定但未佩戴的关爱人员。 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+3
@@ -22,4 +22,7 @@ public class DepartDeviceNum {
|
||||
/** 关爱人员未佩戴数 */
|
||||
private Integer careUnwearCount;
|
||||
|
||||
/** 关爱人员期初未佩戴数(仅计入统计日期起期已绑定的人数) */
|
||||
private Integer careUnwearAtStartCount;
|
||||
|
||||
}
|
||||
|
||||
+11
-6
@@ -50,26 +50,31 @@ public class DeptStatData {
|
||||
*/
|
||||
@Excel(name = "关爱人员未佩戴人数", width = 18, orderNum = "9")
|
||||
private Integer careUnwearNums;
|
||||
/**
|
||||
* 关爱人员期初未佩戴数(仅计入统计日期起期已绑定的人数)
|
||||
*/
|
||||
@Excel(name = "关爱人员未佩戴人数(仅计入统计日期起期已绑定的人数)", width = 25, orderNum = "10")
|
||||
private Integer careUnwearAtStartNums;
|
||||
|
||||
@Excel(name = "心率异常人数", width = 15, orderNum = "10")
|
||||
@Excel(name = "心率异常人数", width = 15, orderNum = "11")
|
||||
private Integer heartRateNums;
|
||||
@Excel(name = "血氧异常人数", width = 15, orderNum = "11")
|
||||
@Excel(name = "血氧异常人数", width = 15, orderNum = "12")
|
||||
private Integer spo2Nums;
|
||||
@Excel(name = "压力异常人数", width = 15, orderNum = "12")
|
||||
@Excel(name = "压力异常人数", width = 15, orderNum = "13")
|
||||
private Integer stressNums;
|
||||
@Excel(name = "体温异常人数", width = 15, orderNum = "13")
|
||||
@Excel(name = "体温异常人数", width = 15, orderNum = "14")
|
||||
private Integer tempNums;
|
||||
|
||||
/**
|
||||
* 非关爱人员数量
|
||||
*/
|
||||
@Excel(name = "非关爱人员数量", width = 15, orderNum = "14")
|
||||
@Excel(name = "非关爱人员数量", width = 15, orderNum = "15")
|
||||
private Integer nonCareNums;
|
||||
|
||||
/**
|
||||
* 关爱人员数量(已分配设备数 - 非关爱人员数量)
|
||||
*/
|
||||
@Excel(name = "关爱人员数量", width = 15, orderNum = "15")
|
||||
@Excel(name = "关爱人员数量", width = 15, orderNum = "16")
|
||||
private Integer careNums;
|
||||
|
||||
|
||||
|
||||
+2
-1
@@ -52,7 +52,8 @@ public interface WatchStatisticsMapper {
|
||||
@Results({
|
||||
@Result(column = "org_code", property = "orgCode"),
|
||||
@Result(column = "care_wear_count", property = "careWearCount"),
|
||||
@Result(column = "care_unwear_count", property = "careUnwearCount")
|
||||
@Result(column = "care_unwear_count", property = "careUnwearCount"),
|
||||
@Result(column = "care_unwear_at_start_count", property = "careUnwearAtStartCount")
|
||||
})
|
||||
List<DepartDeviceNum> careWearNums(DepartStatsFilter filter);
|
||||
|
||||
|
||||
+5
-3
@@ -88,8 +88,9 @@ public class WatchStatisticsProvider {
|
||||
* 查询关爱人员(non_care_flag != 1)的佩戴数和未佩戴数。
|
||||
* 以 QH_WAT_DEVICE(已分配设备人员)为基准,与 deviceBindAndWearNumsSql 结构完全一致,
|
||||
* 在其基础上增加关爱标志过滤:
|
||||
* care_wear_count = 关爱人员中,在统计日期范围内有佩戴数据的人数
|
||||
* care_unwear_count = 关爱人员中,在统计日期范围内无佩戴数据的人数
|
||||
* care_wear_count = 关爱人员中,在统计日期范围内有佩戴数据的人数
|
||||
* care_unwear_count = 关爱人员中,在统计日期范围内无佩戴数据的人数
|
||||
* care_unwear_at_start_count = 关爱人员中,统计日期范围内无佩戴数据,且统计起期已绑定的人数
|
||||
*/
|
||||
public String careWearNumsSql(DepartStatsFilter filter) {
|
||||
String orgCodeStr;
|
||||
@@ -101,7 +102,8 @@ public class WatchStatisticsProvider {
|
||||
StringBuilder sb = new StringBuilder("select ");
|
||||
sb.append(orgCodeStr).append(" as org_code, ")
|
||||
.append("count(distinct case when (ex.non_care_flag is null or ex.non_care_flag != 1) and wud.watch_no is not null then wd.watch_no end) as care_wear_count, ")
|
||||
.append("count(distinct case when (ex.non_care_flag is null or ex.non_care_flag != 1) and wud.watch_no is null then wd.watch_no end) as care_unwear_count ")
|
||||
.append("count(distinct case when (ex.non_care_flag is null or ex.non_care_flag != 1) and wud.watch_no is null then wd.watch_no end) as care_unwear_count, ")
|
||||
.append("count(distinct case when (ex.non_care_flag is null or ex.non_care_flag != 1) and wud.watch_no is null and wbh.bind_date <= #{start} then wd.watch_no end) as care_unwear_at_start_count ")
|
||||
.append("from QH_WAT_DEVICE wd ")
|
||||
.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 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} ")
|
||||
|
||||
+3
@@ -761,6 +761,7 @@ public class DeptStatisticDataServiceImpl extends ServiceImpl<DeptStatisticDataM
|
||||
: transfer.careWearNumMap().getOrDefault(orgCode, new DepartDeviceNum());
|
||||
deptStatData.setCareWearNums(Optional.ofNullable(careNum.getCareWearCount()).orElse(0));
|
||||
deptStatData.setCareUnwearNums(Optional.ofNullable(careNum.getCareUnwearCount()).orElse(0));
|
||||
deptStatData.setCareUnwearAtStartNums(Optional.ofNullable(careNum.getCareUnwearAtStartCount()).orElse(0));
|
||||
return deptStatData;
|
||||
}
|
||||
|
||||
@@ -903,9 +904,11 @@ public class DeptStatisticDataServiceImpl extends ServiceImpl<DeptStatisticDataM
|
||||
DepartDeviceNum result = new DepartDeviceNum();
|
||||
result.setCareWearCount(0);
|
||||
result.setCareUnwearCount(0);
|
||||
result.setCareUnwearAtStartCount(0);
|
||||
careWearNumMap.values().forEach(d -> {
|
||||
result.setCareWearCount(result.getCareWearCount() + Optional.ofNullable(d.getCareWearCount()).orElse(0));
|
||||
result.setCareUnwearCount(result.getCareUnwearCount() + Optional.ofNullable(d.getCareUnwearCount()).orElse(0));
|
||||
result.setCareUnwearAtStartCount(result.getCareUnwearAtStartCount() + Optional.ofNullable(d.getCareUnwearAtStartCount()).orElse(0));
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user