修改 设备状态

master
wangh 1 year ago
parent 3bd5ff4ac5
commit 1438b1d244

@ -68,13 +68,12 @@ public class ApiController {
@ApiOperation(tags = {"60脱水机"}, value = "获取历史趋势、获取数据记录")
@GetMapping("/home/queryParamList")
public AjaxResult queryPramList(Date beginTime, Date endTime) {
return success(iApiService.queryPramList(beginTime, endTime));
}
@ApiOperation(tags = {"60脱水机"}, value = "导出数据记录")
@PostMapping("/home/exportParamList")
@ResponseBody
public AjaxResult export(String name ,String type,Date beginTime, Date endTime)
public AjaxResult export(String name ,String type,String colms,Date beginTime, Date endTime)
{
List<RecordRaramData> list = iApiService.queryPramList(beginTime, endTime);
ExcelUtil<RecordRaramData> util = new ExcelUtil(RecordRaramData.class);

@ -748,7 +748,7 @@ public class ExcelUtil<T>
public String encodingFilename(String filename)
{
// filename = UUID.randomUUID().toString() + "_" + filename + ".xlsx";
filename= filename +DateUtils.getTime()+ ".xlsx";
filename= filename +DateUtils.getDate()+ ".xlsx";
return filename;
}

@ -0,0 +1,25 @@
package com.haiwei.manage.domain;
/**
* @author wanghao
* @date 2023/10/20 9:43
*/
public class DeviceState {
private String name,state;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
}

@ -78,4 +78,17 @@ public class RecordRaramData {
public void setA(String A) {
this.A = A;
}
@Override
public String toString() {
return "RecordRaramData{" +
"time='" + time + '\'' +
", 一体机A转速='" + A + '\'' +
", 一体机A电流='" + A + '\'' +
", 一体机A切刀转速='" + A + '\'' +
", 一体机A切刀电流='" + A + '\'' +
", 一体机A机头温度='" + A + '\'' +
", 一体机A机头压力='" + A + '\'' +
'}';
}
}

@ -1,5 +1,6 @@
package com.haiwei.manage.mapper;
import com.haiwei.manage.domain.DeviceState;
import com.haiwei.manage.domain.ParamVo;
import com.haiwei.manage.domain.RecordRaramData;
import org.apache.ibatis.annotations.Param;
@ -15,7 +16,7 @@ import java.util.List;
@Repository
public interface ApiMapper {
List<ParamVo> queryPram();
String queryDeviceState();
List<DeviceState> queryDeviceState();
List<RecordRaramData> queryPramList(@Param("beginTime") Date beginTime,@Param("endTime") Date endTime);
}

@ -1,5 +1,6 @@
package com.haiwei.manage.service;
import com.haiwei.manage.domain.DeviceState;
import com.haiwei.manage.domain.ParamVo;
import com.haiwei.manage.domain.RecordRaramData;
@ -13,7 +14,7 @@ import java.util.List;
public interface IApiService {
List<ParamVo> queryPram();
String queryDeviceState();
List<DeviceState> queryDeviceState();
List<RecordRaramData> queryPramList(Date beginTime, Date endTime);
}

@ -1,5 +1,6 @@
package com.haiwei.manage.service.impl;
import com.haiwei.manage.domain.DeviceState;
import com.haiwei.manage.domain.ParamVo;
import com.haiwei.manage.domain.RecordRaramData;
import com.haiwei.manage.mapper.ApiMapper;
@ -25,7 +26,7 @@ public class ApiServiceImpl implements IApiService {
}
@Override
public String queryDeviceState() {
public List<DeviceState> queryDeviceState() {
return mapper.queryDeviceState();
}

@ -22,17 +22,20 @@
left join base_point_info ee on ee.objid = info.EID
where info.Status = 1 order by order_by
</select>
<select id="queryDeviceState" resultType="string">
SELECT top 1
case
when ID = 1 and DataType = 1 then '停机'
when ID = 1 and DataType = 0 then '运行'
when ID = 1 and DataType = 0 and ID = 2 and DataType = 0 then '故障'
end
<select id="queryDeviceState" resultType="DeviceState">
SELECT CASE
when DataType = 1 then
case when (SELECT DataType FROM EEquipmentState WHERE ID = 1) = 0 then '停机' else '运行' end
else '故障' end AS state, '一体机' as name
FROM EEquipmentState
where PID = 7
WHERE ID = 2
union
SELECT CASE
when DataType = 1 then
case when (SELECT DataType FROM EEquipmentState WHERE ID = 3) = 0 then '停机' else '运行' end
else '故障' end AS state, '切刀' as name
FROM EEquipmentState
WHERE ID = 4
</select>
<select id="queryPramList" resultType="com.haiwei.manage.domain.RecordRaramData">

Loading…
Cancel
Save