Commit c5c48ee1 by 朱淼

工作台

parent 32f0d21b
Showing with 171 additions and 30 deletions
...@@ -4,6 +4,7 @@ import com.makeit.common.response.ApiResponseEntity; ...@@ -4,6 +4,7 @@ import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils; import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.workstation.WorkStationQueryDTO; import com.makeit.dto.platform.workstation.WorkStationQueryDTO;
import com.makeit.service.platform.workstation.WorkStationService; import com.makeit.service.platform.workstation.WorkStationService;
import com.makeit.vo.platform.workstation.WorkStationHomeRoomVO;
import com.makeit.vo.platform.workstation.WorkStationHomeStatisticsVO; import com.makeit.vo.platform.workstation.WorkStationHomeStatisticsVO;
import com.makeit.vo.platform.workstation.WorkStationInstitutionRoomVO; import com.makeit.vo.platform.workstation.WorkStationInstitutionRoomVO;
import com.makeit.vo.platform.workstation.WorkStationInstitutionStatisticsVO; import com.makeit.vo.platform.workstation.WorkStationInstitutionStatisticsVO;
...@@ -42,4 +43,10 @@ public class WorkStationController { ...@@ -42,4 +43,10 @@ public class WorkStationController {
public ApiResponseEntity<WorkStationHomeStatisticsVO> homeStatistics(@RequestBody WorkStationQueryDTO dto) { public ApiResponseEntity<WorkStationHomeStatisticsVO> homeStatistics(@RequestBody WorkStationQueryDTO dto) {
return ApiResponseUtils.success(workStationService.homeStatistics(dto)); return ApiResponseUtils.success(workStationService.homeStatistics(dto));
} }
@ApiOperation("居家-列表")
@PostMapping("homeList")
public ApiResponseEntity<WorkStationHomeRoomVO> homeList(@RequestBody WorkStationQueryDTO dto) {
return ApiResponseUtils.success(workStationService.homeList(dto));
}
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.makeit.dto.platform.space.PlatBedPanoramaDTO; import com.makeit.dto.platform.space.PlatBedPanoramaDTO;
import com.makeit.entity.platform.space.PlatBed; import com.makeit.entity.platform.space.PlatBed;
import com.makeit.vo.platform.space.PlatBedPanoramaVO; import com.makeit.vo.platform.space.PlatBedPanoramaVO;
import com.makeit.vo.platform.workstation.WorkStationBedVO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -19,4 +20,6 @@ public interface PlatBedMapper extends BaseMapper<PlatBed> { ...@@ -19,4 +20,6 @@ public interface PlatBedMapper extends BaseMapper<PlatBed> {
List<PlatBedPanoramaVO> selectByRoomIdAndStatus(@Param("dto")PlatBedPanoramaDTO dto); List<PlatBedPanoramaVO> selectByRoomIdAndStatus(@Param("dto")PlatBedPanoramaDTO dto);
long countByOrdIdsAndType(@Param("orgIds") List<String> orgIds, @Param("orgType")String orgType); long countByOrdIdsAndType(@Param("orgIds") List<String> orgIds, @Param("orgType")String orgType);
List<WorkStationBedVO> selectByRoomIds(@Param("roomIds")List<String> roomIds);
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.makeit.dto.platform.space.PlatSpaceQueryDTO; import com.makeit.dto.platform.space.PlatSpaceQueryDTO;
import com.makeit.entity.platform.space.PlatSpace; import com.makeit.entity.platform.space.PlatSpace;
import com.makeit.vo.platform.space.PlatSpaceAndRoomVO; import com.makeit.vo.platform.space.PlatSpaceAndRoomVO;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -15,4 +16,6 @@ import java.util.List; ...@@ -15,4 +16,6 @@ import java.util.List;
public interface PlatSpaceMapper extends BaseMapper<PlatSpace> { public interface PlatSpaceMapper extends BaseMapper<PlatSpace> {
List<PlatSpaceAndRoomVO> spaceListExcludeLast(); List<PlatSpaceAndRoomVO> spaceListExcludeLast();
List<PlatSpace> listChild(@Param("spaceIds") List<String> spaceIds);
} }
...@@ -22,6 +22,7 @@ import com.makeit.service.platform.device.PlatDeviceService; ...@@ -22,6 +22,7 @@ import com.makeit.service.platform.device.PlatDeviceService;
import com.makeit.service.platform.elder.PlatElderService; import com.makeit.service.platform.elder.PlatElderService;
import com.makeit.service.platform.space.PlatBedService; import com.makeit.service.platform.space.PlatBedService;
import com.makeit.service.platform.space.PlatSpaceService; import com.makeit.service.platform.space.PlatSpaceService;
import com.makeit.utils.area.AreaUtil;
import com.makeit.utils.area.ChinaAreaVO; import com.makeit.utils.area.ChinaAreaVO;
import com.makeit.utils.data.convert.BeanDtoVoUtils; import com.makeit.utils.data.convert.BeanDtoVoUtils;
import com.makeit.vo.platform.dataScreen.*; import com.makeit.vo.platform.dataScreen.*;
...@@ -62,9 +63,7 @@ public class DataScreenServiceImpl implements DataScreenService { ...@@ -62,9 +63,7 @@ public class DataScreenServiceImpl implements DataScreenService {
PlatAgeStatisticsVO vo = new PlatAgeStatisticsVO(); PlatAgeStatisticsVO vo = new PlatAgeStatisticsVO();
if(dto.getOrgIds().isEmpty()){ if(dto.getOrgIds().isEmpty()){
//获取该账号的权限组织 //获取该账号的权限组织
PlatOrg param = new PlatOrg(); List<PlatOrg> orgs = belongToScopeList(dto.getType());
param.setType(dto.getType());
List<PlatOrg> orgs = platOrgService.belongToScopeList(param);
if(orgs.isEmpty()){ if(orgs.isEmpty()){
return vo; return vo;
} }
...@@ -92,9 +91,7 @@ public class DataScreenServiceImpl implements DataScreenService { ...@@ -92,9 +91,7 @@ public class DataScreenServiceImpl implements DataScreenService {
PlatSexStatisticsVO vo = new PlatSexStatisticsVO(); PlatSexStatisticsVO vo = new PlatSexStatisticsVO();
if(dto.getOrgIds().isEmpty()){ if(dto.getOrgIds().isEmpty()){
//获取该账号的权限组织 //获取该账号的权限组织
PlatOrg param = new PlatOrg(); List<PlatOrg> orgs = belongToScopeList(dto.getType());
param.setType(dto.getType());
List<PlatOrg> orgs = platOrgService.belongToScopeList(param);
if(orgs.isEmpty()){ if(orgs.isEmpty()){
return vo; return vo;
} }
...@@ -133,9 +130,7 @@ public class DataScreenServiceImpl implements DataScreenService { ...@@ -133,9 +130,7 @@ public class DataScreenServiceImpl implements DataScreenService {
PlatDeviceStatisticsVO vo = new PlatDeviceStatisticsVO(); PlatDeviceStatisticsVO vo = new PlatDeviceStatisticsVO();
if(dto.getOrgIds().isEmpty()){ if(dto.getOrgIds().isEmpty()){
//获取该账号的权限组织 //获取该账号的权限组织
PlatOrg param = new PlatOrg(); List<PlatOrg> orgs = belongToScopeList(dto.getType());
param.setType(dto.getType());
List<PlatOrg> orgs = platOrgService.belongToScopeList(param);
if(orgs.isEmpty()){ if(orgs.isEmpty()){
return vo; return vo;
} }
...@@ -153,7 +148,7 @@ public class DataScreenServiceImpl implements DataScreenService { ...@@ -153,7 +148,7 @@ public class DataScreenServiceImpl implements DataScreenService {
long fallNumber = devices.stream().filter(t-> PlatDeviceEnum.CategoryEnum.FALL.getValue().equals(t.getCategory())).count(); long fallNumber = devices.stream().filter(t-> PlatDeviceEnum.CategoryEnum.FALL.getValue().equals(t.getCategory())).count();
long spaceNumber = devices.stream().filter(t-> PlatDeviceEnum.CategoryEnum.SPACE.getValue().equals(t.getCategory())).count(); long spaceNumber = devices.stream().filter(t-> PlatDeviceEnum.CategoryEnum.SPACE.getValue().equals(t.getCategory())).count();
vo.setTotla(total); vo.setTotal(total);
vo.setOnlineNumber(onlineNumber); vo.setOnlineNumber(onlineNumber);
vo.setOfflineNumber(offlineNumber); vo.setOfflineNumber(offlineNumber);
vo.setDisableNumber(disableNumber); vo.setDisableNumber(disableNumber);
...@@ -168,9 +163,7 @@ public class DataScreenServiceImpl implements DataScreenService { ...@@ -168,9 +163,7 @@ public class DataScreenServiceImpl implements DataScreenService {
PlatAlarmStatisticsVO vo = new PlatAlarmStatisticsVO(); PlatAlarmStatisticsVO vo = new PlatAlarmStatisticsVO();
if(dto.getOrgIds().isEmpty()){ if(dto.getOrgIds().isEmpty()){
//获取该账号的权限组织 //获取该账号的权限组织
PlatOrg param = new PlatOrg(); List<PlatOrg> orgs = belongToScopeList(dto.getType());
param.setType(dto.getType());
List<PlatOrg> orgs = platOrgService.belongToScopeList(param);
if(orgs.isEmpty()){ if(orgs.isEmpty()){
return vo; return vo;
} }
...@@ -184,7 +177,7 @@ public class DataScreenServiceImpl implements DataScreenService { ...@@ -184,7 +177,7 @@ public class DataScreenServiceImpl implements DataScreenService {
List<PlatElder> platElders = platElderService.list(); List<PlatElder> platElders = platElderService.list();
Map<String,String> elderNameMap = platElders.stream().collect(Collectors.toMap(PlatElder::getId,PlatElder::getName)); Map<String,String> elderNameMap = platElders.stream().collect(Collectors.toMap(PlatElder::getId,PlatElder::getName));
List<PlatAlarmStatisticsListVo> list = new ArrayList<>(); List<PlatAlarmStatisticsListVo> list = new ArrayList<>();
long totla = 0; long total = 0;
long handledNumber = 0; long handledNumber = 0;
long unhandledNumber = 0; long unhandledNumber = 0;
for (PlatAlarmRecord record : alarmRecords){ for (PlatAlarmRecord record : alarmRecords){
...@@ -203,7 +196,7 @@ public class DataScreenServiceImpl implements DataScreenService { ...@@ -203,7 +196,7 @@ public class DataScreenServiceImpl implements DataScreenService {
} }
listVo.setElderName(elderName); listVo.setElderName(elderName);
listVo.setType(record.getAlarmType()); listVo.setType(record.getAlarmType());
totla ++; total ++;
if(PlatAlarmRecordEnum.AlarmRecordStatusEnum.HANDLED.getValue().equals(record.getStatus())){ if(PlatAlarmRecordEnum.AlarmRecordStatusEnum.HANDLED.getValue().equals(record.getStatus())){
handledNumber ++; handledNumber ++;
}else { }else {
...@@ -213,7 +206,7 @@ public class DataScreenServiceImpl implements DataScreenService { ...@@ -213,7 +206,7 @@ public class DataScreenServiceImpl implements DataScreenService {
} }
} }
vo.setTotla(totla); vo.setTotal(total);
vo.setHandledNumber(handledNumber); vo.setHandledNumber(handledNumber);
vo.setUnhandledNumber(unhandledNumber); vo.setUnhandledNumber(unhandledNumber);
vo.setList(list); vo.setList(list);
...@@ -225,9 +218,7 @@ public class DataScreenServiceImpl implements DataScreenService { ...@@ -225,9 +218,7 @@ public class DataScreenServiceImpl implements DataScreenService {
PlatBaseInfoStatisticsVO vo = new PlatBaseInfoStatisticsVO(); PlatBaseInfoStatisticsVO vo = new PlatBaseInfoStatisticsVO();
if(dto.getOrgIds().isEmpty()){ if(dto.getOrgIds().isEmpty()){
//获取该账号的权限组织 //获取该账号的权限组织
PlatOrg param = new PlatOrg(); List<PlatOrg> orgs = belongToScopeList(dto.getType());
param.setType(dto.getType());
List<PlatOrg> orgs = platOrgService.belongToScopeList(param);
if(orgs.isEmpty()){ if(orgs.isEmpty()){
return vo; return vo;
} }
...@@ -257,9 +248,7 @@ public class DataScreenServiceImpl implements DataScreenService { ...@@ -257,9 +248,7 @@ public class DataScreenServiceImpl implements DataScreenService {
List<PlatMapStatisticsVO> list = new ArrayList<>(); List<PlatMapStatisticsVO> list = new ArrayList<>();
if(dto.getOrgIds().isEmpty()){ if(dto.getOrgIds().isEmpty()){
//获取该账号的权限组织 //获取该账号的权限组织
PlatOrg param = new PlatOrg(); List<PlatOrg> orgs = belongToScopeList(dto.getType());
param.setType(dto.getType());
List<PlatOrg> orgs = platOrgService.belongToScopeList(param);
if(orgs.isEmpty()){ if(orgs.isEmpty()){
return new ArrayList<>(); return new ArrayList<>();
} }
...@@ -330,8 +319,41 @@ public class DataScreenServiceImpl implements DataScreenService { ...@@ -330,8 +319,41 @@ public class DataScreenServiceImpl implements DataScreenService {
@Override @Override
public List<ChinaAreaVO> mapList(PlatDataScreenQueryDTO dto) { public List<ChinaAreaVO> mapList(PlatDataScreenQueryDTO dto) {
List<ChinaAreaVO> list = new ArrayList<>();
if(dto.getOrgIds().isEmpty()){
//获取该账号的权限组织
List<PlatOrg> orgs = belongToScopeList(dto.getType());
if(orgs.isEmpty()){
return new ArrayList<>();
}
List<String> codes = orgs.stream().map(PlatOrg::getRegion).collect(Collectors.toList());
list = AreaUtil.getByCodeList(codes);
}else {
List<PlatOrg> orgs = platOrgService.list(new QueryWrapper<PlatOrg>().lambda()
.in(PlatOrg::getId, dto.getOrgIds()));
Set<String> parentOrgIds = new HashSet<>();
orgs.forEach(t->{
parentOrgIds.addAll(Arrays.asList(t.getPath().split(",")));
});
List<PlatOrg> ancestorsOrgList = getAncestorsOrgList(orgs, parentOrgIds);
List<String> codes = ancestorsOrgList.stream().map(PlatOrg::getRegion).collect(Collectors.toList());
list = AreaUtil.getByCodeList(codes);
return null; }
return list;
}
private List<PlatOrg> getAncestorsOrgList(List<PlatOrg> orgs, Set<String> parentOrgIds) {
orgs = orgs.stream().filter(t->parentOrgIds.contains(t.getId())).collect(Collectors.toList());
Set<String> ancestorsOrgIdList = new HashSet<>();
orgs.forEach(t->{
ancestorsOrgIdList.addAll(Arrays.asList(t.getPath().split(",")));
});
if(ancestorsOrgIdList.size() != parentOrgIds.size()){
getAncestorsOrgList(orgs,ancestorsOrgIdList);
}
return orgs;
} }
private List<PlatAlarmRecordStatisticsVo> coverToVoList(List<PlatAlarmRecord> alarmRecords, Map<String,PlatElder> platElderMap) { private List<PlatAlarmRecordStatisticsVo> coverToVoList(List<PlatAlarmRecord> alarmRecords, Map<String,PlatElder> platElderMap) {
...@@ -350,5 +372,10 @@ public class DataScreenServiceImpl implements DataScreenService { ...@@ -350,5 +372,10 @@ public class DataScreenServiceImpl implements DataScreenService {
return statisticsVos; return statisticsVos;
} }
private List<PlatOrg> belongToScopeList(String type) {
PlatOrg param = new PlatOrg();
param.setType(type);
List<PlatOrg> orgs = platOrgService.belongToScopeList(param);
return orgs;
}
} }
...@@ -9,6 +9,7 @@ import com.makeit.dto.platform.space.*; ...@@ -9,6 +9,7 @@ import com.makeit.dto.platform.space.*;
import com.makeit.entity.platform.space.PlatBed; import com.makeit.entity.platform.space.PlatBed;
import com.makeit.entity.platform.space.PlatRoom; import com.makeit.entity.platform.space.PlatRoom;
import com.makeit.vo.platform.space.PlatBedPanoramaVO; import com.makeit.vo.platform.space.PlatBedPanoramaVO;
import com.makeit.vo.platform.workstation.WorkStationBedVO;
import java.util.List; import java.util.List;
...@@ -59,4 +60,7 @@ public interface PlatBedService extends IService<PlatBed> { ...@@ -59,4 +60,7 @@ public interface PlatBedService extends IService<PlatBed> {
List<PlatBedPanoramaVO> selectByRoomIdAndStatus(PlatBedPanoramaDTO dto); List<PlatBedPanoramaVO> selectByRoomIdAndStatus(PlatBedPanoramaDTO dto);
List<PlatBed> list(PlatBedQueryDTO dto); List<PlatBed> list(PlatBedQueryDTO dto);
long countByOrdIds(List<String> orgIds);} long countByOrdIds(List<String> orgIds);
List<WorkStationBedVO> selectByRoomIds(List<String> roomIds);
}
...@@ -49,4 +49,6 @@ public interface PlatSpaceService extends IService<PlatSpace> { ...@@ -49,4 +49,6 @@ public interface PlatSpaceService extends IService<PlatSpace> {
PlatSpaceAddDTO view(String id); PlatSpaceAddDTO view(String id);
List<PlatSpaceAndRoomVO> spaceListExcludeLast(); List<PlatSpaceAndRoomVO> spaceListExcludeLast();
List<PlatSpace> listChild(List<String> spaceIds);
} }
...@@ -21,6 +21,7 @@ import com.makeit.service.platform.space.PlatRoomBedDeviceService; ...@@ -21,6 +21,7 @@ import com.makeit.service.platform.space.PlatRoomBedDeviceService;
import com.makeit.service.platform.space.PlatRoomService; import com.makeit.service.platform.space.PlatRoomService;
import com.makeit.utils.data.convert.BeanDtoVoUtils;import com.makeit.utils.data.convert.PageUtil; import com.makeit.utils.data.convert.BeanDtoVoUtils;import com.makeit.utils.data.convert.PageUtil;
import com.makeit.vo.platform.space.PlatBedPanoramaVO; import com.makeit.vo.platform.space.PlatBedPanoramaVO;
import com.makeit.vo.platform.workstation.WorkStationBedVO;
import jodd.util.StringUtil; import jodd.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -183,4 +184,10 @@ public class PlatBedServiceImpl extends ServiceImpl<PlatBedMapper, PlatBed> impl ...@@ -183,4 +184,10 @@ public class PlatBedServiceImpl extends ServiceImpl<PlatBedMapper, PlatBed> impl
@Override @Override
public long countByOrdIds(List<String> orgIds) { public long countByOrdIds(List<String> orgIds) {
return baseMapper.countByOrdIdsAndType(orgIds, PlatOrgEnum.OrgTypeEnum.INSTITUTION.getValue()); return baseMapper.countByOrdIdsAndType(orgIds, PlatOrgEnum.OrgTypeEnum.INSTITUTION.getValue());
}} }
@Override
public List<WorkStationBedVO> selectByRoomIds(List<String> roomIds) {
return baseMapper.selectByRoomIds(roomIds);
}
}
...@@ -142,6 +142,11 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace ...@@ -142,6 +142,11 @@ public class PlatSpaceServiceImpl extends ServiceImpl<PlatSpaceMapper, PlatSpace
return baseMapper.spaceListExcludeLast(); return baseMapper.spaceListExcludeLast();
} }
@Override
public List<PlatSpace> listChild(List<String> spaceIds) {
return baseMapper.listChild(spaceIds);
}
private PlatSpaceVO child(PlatSpaceVO vo,Map<String,List<PlatSpace>> map){ private PlatSpaceVO child(PlatSpaceVO vo,Map<String,List<PlatSpace>> map){
if(!map.containsKey(vo.getId())){ if(!map.containsKey(vo.getId())){
......
...@@ -2,6 +2,7 @@ package com.makeit.service.platform.workstation; ...@@ -2,6 +2,7 @@ package com.makeit.service.platform.workstation;
import com.makeit.dto.platform.workstation.WorkStationQueryDTO; import com.makeit.dto.platform.workstation.WorkStationQueryDTO;
import com.makeit.vo.platform.workstation.WorkStationHomeRoomVO;
import com.makeit.vo.platform.workstation.WorkStationHomeStatisticsVO; import com.makeit.vo.platform.workstation.WorkStationHomeStatisticsVO;
import com.makeit.vo.platform.workstation.WorkStationInstitutionRoomVO; import com.makeit.vo.platform.workstation.WorkStationInstitutionRoomVO;
import com.makeit.vo.platform.workstation.WorkStationInstitutionStatisticsVO; import com.makeit.vo.platform.workstation.WorkStationInstitutionStatisticsVO;
...@@ -21,4 +22,6 @@ public interface WorkStationService { ...@@ -21,4 +22,6 @@ public interface WorkStationService {
List<WorkStationInstitutionRoomVO> institutionList(WorkStationQueryDTO dto); List<WorkStationInstitutionRoomVO> institutionList(WorkStationQueryDTO dto);
WorkStationHomeStatisticsVO homeStatistics(WorkStationQueryDTO dto); WorkStationHomeStatisticsVO homeStatistics(WorkStationQueryDTO dto);
WorkStationHomeRoomVO homeList(WorkStationQueryDTO dto);
} }
...@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel; ...@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime;
/** /**
* Controller * Controller
* *
...@@ -20,4 +22,10 @@ public class PlatAlarmStatisticsListVo { ...@@ -20,4 +22,10 @@ public class PlatAlarmStatisticsListVo {
private String type; private String type;
@ApiModelProperty(value = "状态") @ApiModelProperty(value = "状态")
private String status; private String status;
@ApiModelProperty(value = "告警日期")
private String alarmDate;
@ApiModelProperty(value = "告警时间")
private String alarmTime;
@ApiModelProperty(value = "路径")
private String path;
} }
...@@ -17,7 +17,7 @@ import java.util.List; ...@@ -17,7 +17,7 @@ import java.util.List;
public class PlatAlarmStatisticsVO { public class PlatAlarmStatisticsVO {
@ApiModelProperty(value = "累计告警") @ApiModelProperty(value = "累计告警")
private Long totla; private Long total;
@ApiModelProperty(value = "已处理数") @ApiModelProperty(value = "已处理数")
private Long handledNumber; private Long handledNumber;
@ApiModelProperty(value = "待处理数") @ApiModelProperty(value = "待处理数")
......
...@@ -17,7 +17,7 @@ import java.util.List; ...@@ -17,7 +17,7 @@ import java.util.List;
public class PlatDeviceStatisticsVO { public class PlatDeviceStatisticsVO {
@ApiModelProperty(value = "总数") @ApiModelProperty(value = "总数")
private Long totla; private Long total;
@ApiModelProperty(value = "在线数") @ApiModelProperty(value = "在线数")
private Long onlineNumber; private Long onlineNumber;
@ApiModelProperty(value = "故障数") @ApiModelProperty(value = "故障数")
......
...@@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -6,6 +6,8 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.Set;
/** /**
* Controller * Controller
...@@ -23,6 +25,9 @@ public class WorkStationBedVO { ...@@ -23,6 +25,9 @@ public class WorkStationBedVO {
@ApiModelProperty(value = "床id") @ApiModelProperty(value = "床id")
private String bedId; private String bedId;
@ApiModelProperty(value = "房间id")
private String roomId;
@ApiModelProperty(value = "状态") @ApiModelProperty(value = "状态")
private String stauts; private String stauts;
...@@ -32,9 +37,12 @@ public class WorkStationBedVO { ...@@ -32,9 +37,12 @@ public class WorkStationBedVO {
@ApiModelProperty(value = "长者姓名") @ApiModelProperty(value = "长者姓名")
private String elderName; private String elderName;
@ApiModelProperty(value = "设备id")
private String deviceId;
@ApiModelProperty(value = "长者状态") @ApiModelProperty(value = "长者状态")
private String elderStatus; private String elderStatus;
@ApiModelProperty(value = "告警类型") @ApiModelProperty(value = "告警类型")
private List<String> alarmTypes; private Map<String,List<String>> alarmTypeMap;
} }
package com.makeit.vo.platform.workstation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* Controller
*
* @author zm
* @version 2023/9/13
*/
@Data
@ApiModel("WorkStationHomeRoomVO对象")
public class WorkStationHomeRoomVO {
@ApiModelProperty(value = "房间路径id")
private String spacePath;
@ApiModelProperty(value = "房间id")
private String roomId;
@ApiModelProperty(value = "房间名称")
private String roomName;
@ApiModelProperty(value = "房间路径")
private String pathName;
private WorkStationBedVO bedVo;
}
...@@ -22,6 +22,9 @@ public class WorkStationInstitutionRoomVO { ...@@ -22,6 +22,9 @@ public class WorkStationInstitutionRoomVO {
@ApiModelProperty(value = "房间id") @ApiModelProperty(value = "房间id")
private String roomId; private String roomId;
@ApiModelProperty(value = "房间名称")
private String roomName;
@ApiModelProperty(value = "房间路径") @ApiModelProperty(value = "房间路径")
private String pathName; private String pathName;
......
...@@ -49,5 +49,21 @@ ...@@ -49,5 +49,21 @@
</where> </where>
</select> </select>
<select id="selectByRoomIds" resultType="com.makeit.vo.platform.workstation.WorkStationBedVO">
SELECT pb.`name` as bedName, pb.id as bedId, pb.room_id , pe.id as elderId, pb.name as elderName, prbd.device_id
FROM plat_bed pb
LEFT JOIN plat_elder pe ON pe.bed_id = pb.id
LEFT JOIN plat_room_bed_device rpbd ON rpbd.bed_id = pb.id
<where>
pb.del_flag = 0 and pe.del_flag = 0 and rpbd.del_flag = 0
<if test="roomIds != null and roomIds.size() > 0 ">
AND pb.room_id IN
<foreach collection="roomIds" item="item" separator="," open="(" close=")" index="">
#{item}
</foreach>
</if>
</where>
</select>
</mapper> </mapper>
...@@ -8,6 +8,19 @@ ...@@ -8,6 +8,19 @@
WHERE ps.id in (SELECT parent_id FROM `plat_space` WHERE del_flag =0) and ps.del_flag = 0 WHERE ps.id in (SELECT parent_id FROM `plat_space` WHERE del_flag =0) and ps.del_flag = 0
</select> </select>
<select id="listChild" resultType="com.makeit.entity.platform.space.PlatSpace">
SELECT id,name,parent_id,type,address,longitude,latitude,parent_path,tenant_id,org_id,attribute
FROM plat_space
<where>
del_flag = 0
<if test="spaceIds != null and spaceIds.size() > 0 ">
AND (
<foreach collection="roomIds" item="item" separator="," open="(" close=")" index="">
FIND_IN_SET(#{item},parent_path) OR id = #{item}
</foreach>
)
</if>
</where>
</select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment