diff --git a/haiwei-admin/src/main/java/com/haiwei/web/controller/broad/ApiController.java b/haiwei-admin/src/main/java/com/haiwei/web/controller/broad/ApiController.java index d235c30..4b083af 100644 --- a/haiwei-admin/src/main/java/com/haiwei/web/controller/broad/ApiController.java +++ b/haiwei-admin/src/main/java/com/haiwei/web/controller/broad/ApiController.java @@ -58,7 +58,7 @@ public class ApiController { return success(iApiService.queryPram()); } - @ApiOperation(tags = {"60脱水机"}, value = "获取设备状态 1=绿灯 0红灯") + @ApiOperation(tags = {"60脱水机"}, value = "获取设备状态 msg字段") @GetMapping("/home/queryDeviceState") public AjaxResult queryDeviceState() { return success(iApiService.queryDeviceState()); diff --git a/haiwei-admin/src/main/java/com/haiwei/web/controller/common/CommonController.java b/haiwei-admin/src/main/java/com/haiwei/web/controller/common/CommonController.java index f26f404..764375c 100644 --- a/haiwei-admin/src/main/java/com/haiwei/web/controller/common/CommonController.java +++ b/haiwei-admin/src/main/java/com/haiwei/web/controller/common/CommonController.java @@ -3,6 +3,7 @@ package com.haiwei.web.controller.common; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -95,6 +96,7 @@ public class CommonController /** * 本地资源通用下载 */ + @ApiOperation(tags = {"文档归档"}, value = "下载") @GetMapping("/common/download/resource") public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response) throws Exception diff --git a/haiwei-manage/src/main/java/com/haiwei/manage/mapper/ApiMapper.java b/haiwei-manage/src/main/java/com/haiwei/manage/mapper/ApiMapper.java index 3395c22..175f701 100644 --- a/haiwei-manage/src/main/java/com/haiwei/manage/mapper/ApiMapper.java +++ b/haiwei-manage/src/main/java/com/haiwei/manage/mapper/ApiMapper.java @@ -15,7 +15,7 @@ import java.util.List; @Repository public interface ApiMapper { List queryPram(); - List queryDeviceState(); + String queryDeviceState(); List queryPramList(@Param("beginTime") Date beginTime,@Param("endTime") Date endTime); } diff --git a/haiwei-manage/src/main/java/com/haiwei/manage/service/IApiService.java b/haiwei-manage/src/main/java/com/haiwei/manage/service/IApiService.java index 4bd42c3..d7677e4 100644 --- a/haiwei-manage/src/main/java/com/haiwei/manage/service/IApiService.java +++ b/haiwei-manage/src/main/java/com/haiwei/manage/service/IApiService.java @@ -13,7 +13,7 @@ import java.util.List; public interface IApiService { List queryPram(); - List queryDeviceState(); + String queryDeviceState(); List queryPramList(Date beginTime, Date endTime); } diff --git a/haiwei-manage/src/main/java/com/haiwei/manage/service/impl/ApiServiceImpl.java b/haiwei-manage/src/main/java/com/haiwei/manage/service/impl/ApiServiceImpl.java index 3ea63da..f0cfbc2 100644 --- a/haiwei-manage/src/main/java/com/haiwei/manage/service/impl/ApiServiceImpl.java +++ b/haiwei-manage/src/main/java/com/haiwei/manage/service/impl/ApiServiceImpl.java @@ -25,7 +25,7 @@ public class ApiServiceImpl implements IApiService { } @Override - public List queryDeviceState() { + public String queryDeviceState() { return mapper.queryDeviceState(); } diff --git a/haiwei-manage/src/main/resources/mapper/manage/ApiMapper.xml b/haiwei-manage/src/main/resources/mapper/manage/ApiMapper.xml index 045851d..2d42335 100644 --- a/haiwei-manage/src/main/resources/mapper/manage/ApiMapper.xml +++ b/haiwei-manage/src/main/resources/mapper/manage/ApiMapper.xml @@ -22,12 +22,17 @@ left join base_point_info ee on ee.objid = info.EID where info.Status = 1 order by order_by - + SELECT top 1 + case + when ID = 1 and DataType = 0 then '停机' + when ID = 1 and DataType = 1 then '运行' + when ID = 1 and DataType = 1 and ID = 2 and DataType = 1 then '故障' + end FROM EEquipmentState where PID = 7 +