diff --git a/zc-business/src/main/java/com/zc/business/controller/StatusController.java b/zc-business/src/main/java/com/zc/business/controller/StatusController.java index 00d235f4..cb1a077c 100644 --- a/zc-business/src/main/java/com/zc/business/controller/StatusController.java +++ b/zc-business/src/main/java/com/zc/business/controller/StatusController.java @@ -129,7 +129,9 @@ public class StatusController extends BaseController { @GetMapping ("/type") public AjaxResult getTypeList() { - List dcDeviceList = dcDeviceService.numberOfDevicesByType(); + DcDevice dcDevice = new DcDevice(); + dcDevice.setUseState(1); + List dcDeviceList = dcDeviceService.numberOfDevicesByType(dcDevice); HashMap itemTypeMap = new HashMap<>(); itemTypeMap.put("1-1", "高清网络枪型固定摄像机"); itemTypeMap.put("1-2", "高清网络球形摄像机"); @@ -153,7 +155,6 @@ public class StatusController extends BaseController { Status status = new Status(); status.setStartTime(todayStart); status.setTime(currentTime); - status.setUseState(1); List listStatus = statusService.list(status); //根据时间分组 Map> map = listStatus.stream() @@ -184,9 +185,9 @@ public class StatusController extends BaseController { //离线率 maps.put("failRate",failRate); //已使用数量 - maps.put("sumUseState",String.valueOf(groupItems.size())); + maps.put("sum",String.valueOf(groupItems.size())); //总数 - maps.put("sum", String.valueOf(dcDeviceList.stream().filter(item -> Objects.equals(item.getDeviceType(), entrys.getKey())).map(DcDevice::getSumAll).collect(Collectors.toList()).get(0))); + maps.put("sumUseState", String.valueOf(dcDeviceList.stream().filter(item -> Objects.equals(item.getDeviceType(), entrys.getKey())).map(DcDevice::getSumAll).collect(Collectors.toList()).get(0))); if(itemTypeMap.get(entrys.getKey())!=null) { subMap.put(itemTypeMap.get(entrys.getKey()), maps); } @@ -205,8 +206,8 @@ public class StatusController extends BaseController { maps.put("sucessRate",String.format("%.2f", sucessRate)+"%"); //离线率 maps.put("failRate",failRate); - List list = dcDeviceService.list(); //已使用数量 + List list = dcDeviceService.list(); maps.put("sumUseState",String.valueOf(lastEntry.size())); //总数 maps.put("sum",String.valueOf(list.size())); diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcDeviceMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcDeviceMapper.java index 1318201f..0fb3a492 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcDeviceMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcDeviceMapper.java @@ -15,7 +15,7 @@ import java.util.List; public interface DcDeviceMapper extends BaseMapper { List selectDcDeviceList(DcDevice dcDevice); - List numberOfDevicesByType(); + List numberOfDevicesByType(DcDevice dcDevice); } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcDeviceService.java b/zc-business/src/main/java/com/zc/business/service/IDcDeviceService.java index 5e401f43..9ccb83fe 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcDeviceService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcDeviceService.java @@ -78,5 +78,5 @@ public interface IDcDeviceService extends IService { List devicePileNumberQueryDevice(Map parameter); - List numberOfDevicesByType(); + List numberOfDevicesByType(DcDevice dcDevice); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java index 0fb6b647..f011b351 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java @@ -448,8 +448,8 @@ public class DcDeviceServiceImpl extends ServiceImpl i } @Override - public List numberOfDevicesByType() { - return dcDeviceMapper.numberOfDevicesByType(); + public List numberOfDevicesByType(DcDevice dcDevice) { + return dcDeviceMapper.numberOfDevicesByType(dcDevice); } public static List castList(Object obj, Class clazz) { diff --git a/zc-business/src/main/resources/mapper/business/DcDeviceMapper.xml b/zc-business/src/main/resources/mapper/business/DcDeviceMapper.xml index 7c2e06e7..cd5f9e41 100644 --- a/zc-business/src/main/resources/mapper/business/DcDeviceMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcDeviceMapper.xml @@ -110,6 +110,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/zc-business/src/main/resources/mapper/business/StatusMapper.xml b/zc-business/src/main/resources/mapper/business/StatusMapper.xml index cc5d9b16..94b29f40 100644 --- a/zc-business/src/main/resources/mapper/business/StatusMapper.xml +++ b/zc-business/src/main/resources/mapper/business/StatusMapper.xml @@ -103,9 +103,6 @@ AND s.device_id = #{status.deviceId} - - AND d.use_state = #{status.useState} -