Commit dbbac0db authored by KeYong's avatar KeYong

Merge branch 'develop_dl_plan6_temp' of…

Merge branch 'develop_dl_plan6_temp' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_plan6_temp
parents 52098b47 ee504d72
...@@ -164,6 +164,9 @@ ...@@ -164,6 +164,9 @@
<if test="map.positionType != null and map.positionType != ''"> <if test="map.positionType != null and map.positionType != ''">
AND FIND_IN_SET(#{map.positionType},g.positionType) AND FIND_IN_SET(#{map.positionType},g.positionType)
</if> </if>
<if test="map.peopleType != null and map.peopleType != ''">
AND g.peopleType = #{map.peopleType}
</if>
GROUP BY GROUP BY
u.sequence_nbr , u.sequence_nbr ,
u.biz_org_name , u.biz_org_name ,
......
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
<select id="getResourcesCount" resultType="java.util.Map"> <select id="getResourcesCount" resultType="java.util.Map">
SELECT SELECT
( SELECT COUNT( DISTINCT cwr.sequence_nbr ) FROM cb_water_resource cwr WHERE cwr.is_delete = 1 AND cwr.resource_type = 'hydrant' ) AS hydrant, ( SELECT COUNT( DISTINCT cwr.sequence_nbr ) FROM cb_water_resource cwr WHERE cwr.is_delete = 1 AND cwr.resource_type = 'hydrant' ) AS hydrant,
( SELECT COUNT( DISTINCT cwr.sequence_nbr ) FROM cb_water_resource cwr WHERE cwr.is_delete = 1 AND cwr.resource_type = 'pool' ) AS pool, ( SELECT COUNT( DISTINCT cwr.sequence_nbr ) FROM cb_water_resource cwr WHERE cwr.is_delete = 1 AND (cwr.resource_type = 'industryPool' or cwr.resource_type = 'pool' ) ) AS pool,
( SELECT COUNT( DISTINCT cwr.sequence_nbr ) FROM cb_water_resource cwr WHERE cwr.is_delete = 1 AND cwr.resource_type = 'waterTank' ) AS waterTank, ( SELECT COUNT( DISTINCT cwr.sequence_nbr ) FROM cb_water_resource cwr WHERE cwr.is_delete = 1 AND cwr.resource_type = 'waterTank' ) AS waterTank,
( (
SELECT SELECT
......
...@@ -604,12 +604,19 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -604,12 +604,19 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
map.put("positionType", positionType); map.put("positionType", positionType);
} }
String peopleType = "";
if(req.containsKey("peopleType")) {
peopleType = req.get("peopleType").toString();
map.put("peopleType", peopleType);
}
req.remove("pageSize"); req.remove("pageSize");
req.remove("pageNum"); req.remove("pageNum");
req.remove("parentId"); req.remove("parentId");
req.remove("amosOrgId"); req.remove("amosOrgId");
req.remove("company"); req.remove("company");
req.remove("positionType"); req.remove("positionType");
req.remove("peopleType");
req.remove("bizOrgName"); req.remove("bizOrgName");
map.put("fieldsValue", req); map.put("fieldsValue", req);
map.put("fields", alertFormServiceImpl.queryListByFormId(OrgPersonEnum.人员.getCode())); map.put("fields", alertFormServiceImpl.queryListByFormId(OrgPersonEnum.人员.getCode()));
......
...@@ -114,8 +114,8 @@ public class BigScreenController extends AbstractBaseController { ...@@ -114,8 +114,8 @@ public class BigScreenController extends AbstractBaseController {
ResponseModel entity1 = null; ResponseModel entity1 = null;
ResponseModel entity2 = null; ResponseModel entity2 = null;
try { try {
entity1 = iotFeign.selectListNew(getAppKey(), getProduct(), getToken(),iotCode, startDateStr, nowStrLong, "true", pressurePumpStart); entity1 = iotFeign.selectListNew(getAppKey(), getProduct(), getToken(),prefix,suffix, startDateStr, nowStrLong, "true", pressurePumpStart);
entity2 = iotFeign.selectListNew(getAppKey(), getProduct(), getToken(),iotCode, startDateStr, nowStrLong, "false", pressurePumpStart); entity2 = iotFeign.selectListNew(getAppKey(), getProduct(), getToken(),prefix,suffix, startDateStr, nowStrLong, "false", pressurePumpStart);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -332,8 +332,8 @@ public class ConfigureController extends AbstractBaseController { ...@@ -332,8 +332,8 @@ public class ConfigureController extends AbstractBaseController {
ResponseModel entity1 = null; ResponseModel entity1 = null;
ResponseModel entity2 = null; ResponseModel entity2 = null;
try { try {
entity1 = iotFeign.selectListNew(getAppKey(), getProduct(), getToken(),iotCode, startDateStr, nowStrLong, "true", pressurePumpStart); entity1 = iotFeign.selectListNew(getAppKey(), getProduct(), getToken(),prefix,suffix, startDateStr, nowStrLong, "true", pressurePumpStart);
entity2 = iotFeign.selectListNew(getAppKey(), getProduct(), getToken(),iotCode, startDateStr, nowStrLong, "false", pressurePumpStart); entity2 = iotFeign.selectListNew(getAppKey(), getProduct(), getToken(),prefix,suffix, startDateStr, nowStrLong, "false", pressurePumpStart);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -393,8 +393,8 @@ public class ConfigureController extends AbstractBaseController { ...@@ -393,8 +393,8 @@ public class ConfigureController extends AbstractBaseController {
ResponseModel entity1 = null; ResponseModel entity1 = null;
ResponseModel entity2 = null; ResponseModel entity2 = null;
try { try {
entity1 = iotFeign.selectListNew(getAppKey(), getProduct(), getToken(),iotCode, startDateStr, nowStrLong, "true", pressurePumpStart); entity1 = iotFeign.selectListNew(getAppKey(), getProduct(), getToken(),prefix,suffix, startDateStr, nowStrLong, "true", pressurePumpStart);
entity2 = iotFeign.selectListNew(getAppKey(), getProduct(), getToken(),iotCode, startDateStr, nowStrLong, "false", pressurePumpStart); entity2 = iotFeign.selectListNew(getAppKey(), getProduct(), getToken(),prefix,suffix, startDateStr, nowStrLong, "false", pressurePumpStart);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil; import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.common.utils.DateUtils; import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.common.vo.IotDataVO;
import com.yeejoin.equipmanage.config.PersonIdentify; import com.yeejoin.equipmanage.config.PersonIdentify;
import com.yeejoin.equipmanage.service.IEmergencyService; import com.yeejoin.equipmanage.service.IEmergencyService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -156,9 +155,13 @@ public class EmergencyController extends AbstractBaseController { ...@@ -156,9 +155,13 @@ public class EmergencyController extends AbstractBaseController {
@RequestParam(value = "systemType") String systemType)throws Exception { @RequestParam(value = "systemType") String systemType)throws Exception {
ArrayList<Map<String, Object>> result = new ArrayList<>(); ArrayList<Map<String, Object>> result = new ArrayList<>();
List<Map<String, Object>> maps = iEmergencyService.selectAlarmAnalysis(startDate, endDate, "0", "", systemType); if ("day".equals(type)) {
return iEmergencyService.selectAlarmAnalysis(startDate, endDate, "0", "", systemType);
if ("week".equals(type)) { } else if ("month".equals(type)) {
String date = startDate.substring(0, 4) + "-01" + "-01";
return iEmergencyService.selectAlarmAnalysis(startDate, endDate, "1", date, systemType);
} else if ("week".equals(type)) {
List<Map<String, Object>> maps = iEmergencyService.selectAlarmAnalysis(startDate, endDate, "0", "", systemType);
String beginMonth = startDate.substring(5,7); String beginMonth = startDate.substring(5,7);
String endMonth = endDate.substring(5,7); String endMonth = endDate.substring(5,7);
List<Map<String, String>> weeksMapInterval = DateUtils.getWeeksMapInterval(DateUtils.dateToStringMonth(startDate)); List<Map<String, String>> weeksMapInterval = DateUtils.getWeeksMapInterval(DateUtils.dateToStringMonth(startDate));
...@@ -258,11 +261,6 @@ public class EmergencyController extends AbstractBaseController { ...@@ -258,11 +261,6 @@ public class EmergencyController extends AbstractBaseController {
} }
} }
} else if ("day".equals(type)) {
return maps;
} else if ("month".equals(type)) {
String date = startDate.substring(0, 4) + "-01" + "-01";
return iEmergencyService.selectAlarmAnalysis(startDate, endDate, "1", date, systemType);
} }
return result; return result;
...@@ -303,10 +301,14 @@ public class EmergencyController extends AbstractBaseController { ...@@ -303,10 +301,14 @@ public class EmergencyController extends AbstractBaseController {
@RequestParam(value = "endDate") String endDate, @RequestParam(value = "endDate") String endDate,
@RequestParam(value = "type") String type, @RequestParam(value = "type") String type,
@RequestParam(value = "systemType") String systemType) { @RequestParam(value = "systemType") String systemType) {
ArrayList<Map<String, Object>> result = new ArrayList<>(); ArrayList<Map<String, Object>> result = new ArrayList<>();
List<Map<String, Object>> maps = iEmergencyService.waterSystemAlarmAnalysis(startDate, endDate, "0", "", systemType); if ("month".equals(type)) {
if ("week".equals(type)) { String date = startDate.substring(0, 4) + "-01" + "-01";
return iEmergencyService.waterSystemAlarmAnalysis(startDate, endDate, "1", date, systemType);
} else if ("day".equals(type)) {
return iEmergencyService.waterSystemAlarmAnalysis(startDate, endDate, "0", "", systemType);
} else if ("week".equals(type)) {
List<Map<String, Object>> maps = iEmergencyService.waterSystemAlarmAnalysis(startDate, endDate, "0", "", systemType);
String beginMonth = startDate.substring(5,7); String beginMonth = startDate.substring(5,7);
String endMonth = endDate.substring(5,7); String endMonth = endDate.substring(5,7);
List<Map<String, String>> weeksMapInterval = DateUtils.getWeeksMapInterval(DateUtils.dateToStringMonth(startDate)); List<Map<String, String>> weeksMapInterval = DateUtils.getWeeksMapInterval(DateUtils.dateToStringMonth(startDate));
...@@ -407,11 +409,6 @@ public class EmergencyController extends AbstractBaseController { ...@@ -407,11 +409,6 @@ public class EmergencyController extends AbstractBaseController {
} }
} }
} else if ("day".equals(type)) {
return maps;
} else if ("month".equals(type)) {
String date = startDate.substring(0, 4) + "-01" + "-01";
return iEmergencyService.waterSystemAlarmAnalysis(startDate, endDate, "1", date, systemType);
} }
return result; return result;
...@@ -425,10 +422,14 @@ public class EmergencyController extends AbstractBaseController { ...@@ -425,10 +422,14 @@ public class EmergencyController extends AbstractBaseController {
@RequestParam(value = "endDate") String endDate, @RequestParam(value = "endDate") String endDate,
@RequestParam(value = "type") String type, @RequestParam(value = "type") String type,
@RequestParam(value = "systemType") String systemType) { @RequestParam(value = "systemType") String systemType) {
ArrayList<Map<String, Object>> result = new ArrayList<>(); ArrayList<Map<String, Object>> result = new ArrayList<>();
List<Map<String, Object>> maps = iEmergencyService.fireCannonSystemAlarmAnalysis(startDate, endDate, "0", "", systemType); if ("day".equals(type)) {
if ("week".equals(type)) { return iEmergencyService.fireCannonSystemAlarmAnalysis(startDate, endDate, "0", "", systemType);
} else if ("month".equals(type)) {
String date = startDate.substring(0, 4) + "-01" + "-01";
return iEmergencyService.fireCannonSystemAlarmAnalysis(startDate, endDate, "1", date, systemType);
} else if ("week".equals(type)) {
List<Map<String, Object>> maps = iEmergencyService.fireCannonSystemAlarmAnalysis(startDate, endDate, "0", "", systemType);
String beginMonth = startDate.substring(5,7); String beginMonth = startDate.substring(5,7);
String endMonth = endDate.substring(5,7); String endMonth = endDate.substring(5,7);
List<Map<String, String>> weeksMapInterval = DateUtils.getWeeksMapInterval(DateUtils.dateToStringMonth(startDate)); List<Map<String, String>> weeksMapInterval = DateUtils.getWeeksMapInterval(DateUtils.dateToStringMonth(startDate));
...@@ -542,11 +543,6 @@ public class EmergencyController extends AbstractBaseController { ...@@ -542,11 +543,6 @@ public class EmergencyController extends AbstractBaseController {
} }
} else if ("day".equals(type)) {
return maps;
} else if ("month".equals(type)) {
String date = startDate.substring(0, 4) + "-01" + "-01";
return iEmergencyService.fireCannonSystemAlarmAnalysis(startDate, endDate, "1", date, systemType);
} }
return result; return result;
...@@ -616,4 +612,29 @@ public class EmergencyController extends AbstractBaseController { ...@@ -616,4 +612,29 @@ public class EmergencyController extends AbstractBaseController {
return CommonResponseUtil.success(iEmergencyService.getPressurePumpDiagnosticAnalysis(equipmentCode, nameKeys, fieldKey, bizOrgCode, getAppKey(), getProduct(), getToken())); return CommonResponseUtil.success(iEmergencyService.getPressurePumpDiagnosticAnalysis(equipmentCode, nameKeys, fieldKey, bizOrgCode, getAppKey(), getProduct(), getToken()));
} }
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/alarmList")
@ApiOperation(httpMethod = "GET", value = "消防告警信息", notes = "消防告警信息")
public ResponseModel alarmList(@RequestParam Integer pageNumber,
@RequestParam Integer pageSize,
@RequestParam(required = false) List<String> types,
@RequestParam(required = false) List<String> emergencyLevels,
@RequestParam(required = false) String name,
@RequestParam(required = false) Integer cleanStatus,
@RequestParam(required = false) String bizOrgCode) {
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
if (StringUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
if (bizOrgCode == null) {
return CommonResponseUtil.success(page);
}
}
}
return CommonResponseUtil.success(iEmergencyService.alarmList(page, bizOrgCode, types, emergencyLevels, name, cleanStatus));
}
} }
...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.controller; ...@@ -3,6 +3,7 @@ package com.yeejoin.equipmanage.controller;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.equipmanage.common.constant.Constant; import com.yeejoin.equipmanage.common.constant.Constant;
import com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO; import com.yeejoin.equipmanage.common.entity.vo.EquiplistSpecificBySystemVO;
...@@ -407,6 +408,19 @@ public class EquipmentSpecificController extends AbstractBaseController { ...@@ -407,6 +408,19 @@ public class EquipmentSpecificController extends AbstractBaseController {
return CommonResponseUtil.success(equipmentSpecificSerivce.normalIndexInfoList(startDate, endDate)); return CommonResponseUtil.success(equipmentSpecificSerivce.normalIndexInfoList(startDate, endDate));
} }
@GetMapping(value = "/index/normalByPage")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "分页查询非告警指标list", notes = "分页查询非告警指标list")
public ResponseModel normalIndexInfoListByPage(@RequestParam(required = false) String startDate,
@RequestParam(required = false) String endDate,
@RequestParam(required = false) String systemCode,
@RequestParam(required = false) String name,
@RequestParam Integer pageNumber,
@RequestParam Integer pageSize){
Page<Map<String, Object>> page = new Page<>(pageNumber, pageSize);
return CommonResponseUtil.success(equipmentSpecificSerivce.normalIndexInfoListByPage(page, startDate, endDate,systemCode,name));
}
@GetMapping(value = "/info/fire") @GetMapping(value = "/info/fire")
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "查询火报系统指标", notes = "查询火报系统指标") @ApiOperation(httpMethod = "GET", value = "查询火报系统指标", notes = "查询火报系统指标")
......
...@@ -528,8 +528,8 @@ public class FireFightingSystemController extends AbstractBaseController { ...@@ -528,8 +528,8 @@ public class FireFightingSystemController extends AbstractBaseController {
equipmentCategory = equipmentCategoryService.getById(equipmentCategory.getParentId()); equipmentCategory = equipmentCategoryService.getById(equipmentCategory.getParentId());
} }
} }
String classificationCode = equipTypeAmountPage.getEquipmentClassificationCode().replaceAll("0+$", "");
return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, equipTypeAmountPage.getEquipmentClassificationCode().replaceAll("0+$", ""), equipTypeAmountPage); return fireFightingSystemService.getColaCategoryAmountEquList(inhierarchy, classificationCode.length() % 2 == 0 ? classificationCode : classificationCode + "0", equipTypeAmountPage);
} else { } else {
if (null != equipTypeAmountPage.getIsDefect() && 1 == equipTypeAmountPage.getIsDefect()) { if (null != equipTypeAmountPage.getIsDefect() && 1 == equipTypeAmountPage.getIsDefect()) {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
......
...@@ -51,12 +51,24 @@ public interface IotFeign { ...@@ -51,12 +51,24 @@ public interface IotFeign {
@RequestParam("FHS_PressurePump_Start") String key, @RequestParam("FHS_PressurePump_Start") String key,
@RequestParam(required = false, value = "fieldKey") String fieldKey); @RequestParam(required = false, value = "fieldKey") String fieldKey);
@RequestMapping(value = "v1/livedata/common/top/single-field", method = RequestMethod.GET, consumes = "application/json")
ResponseModel topSingleField(
@RequestHeader("appKey") String appKey,
@RequestHeader("product") String product,
@RequestHeader("token") String token,
@RequestParam(value = "top") String top,
@RequestParam(value = "productKey") String productKey,
@RequestParam( required = false, value = "deviceName") String deviceName,
@RequestParam("FHS_PressurePump_Start") String key,
@RequestParam(required = false, value = "fieldKey") String fieldKey);
@RequestMapping(value = "v1/livedata/common/list", method = RequestMethod.GET, consumes = "application/json") @RequestMapping(value = "v1/livedata/common/list", method = RequestMethod.GET, consumes = "application/json")
ResponseModel selectListNew( ResponseModel selectListNew(
@RequestHeader("appKey") String appKey, @RequestHeader("appKey") String appKey,
@RequestHeader("product") String product, @RequestHeader("product") String product,
@RequestHeader("token") String token, @RequestHeader("token") String token,
@RequestParam(value = "measurement") String measurement, @RequestParam(value = "measurement") String measurement,
@RequestParam( required = false, value = "deviceName") String deviceName,
@RequestParam(value = "timeStart") String beginDate, @RequestParam(value = "timeStart") String beginDate,
@RequestParam(value = "timeEnd") String endDate, @RequestParam(value = "timeEnd") String endDate,
@RequestParam("FHS_PressurePump_Start") String key, @RequestParam("FHS_PressurePump_Start") String key,
......
...@@ -83,4 +83,15 @@ public interface EmergencyMapper extends BaseMapper{ ...@@ -83,4 +83,15 @@ public interface EmergencyMapper extends BaseMapper{
List<Map<String, Object>> getEquipExpiryStatistics(@Param("expiryDayNum") Integer expiryDayNum); List<Map<String, Object>> getEquipExpiryStatistics(@Param("expiryDayNum") Integer expiryDayNum);
/**
*
* @param page
* @param bizOrgCode
* @param types 类型
* @param emergencyLevels 等级
* @param name 设备名称
* @return
*/
Page<Map<String, Object>> alarmList(@Param("page") Page<Map<String, Object>> page, @Param("bizOrgCode") String bizOrgCode, @Param("types") List<String> types, @Param("emergencyLevels") List<String> emergencyLevels, @Param("name") String name, @Param("cleanStatus") Integer cleanStatus);
} }
...@@ -246,6 +246,8 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -246,6 +246,8 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
List<Map<String, Object>> normalIndexInfoList(@Param("startDate") String startDate, @Param("endDate") String endDate); List<Map<String, Object>> normalIndexInfoList(@Param("startDate") String startDate, @Param("endDate") String endDate);
Page<Map<String, Object>> normalIndexInfoListByPage(@Param("Page")Page<Map<String, Object>> page, @Param("startDate") String startDate, @Param("endDate") String endDate, @Param("systemCode") String systemCode, @Param("name") String name);
Map<String, Object> getFireAutoSysInfo(); Map<String, Object> getFireAutoSysInfo();
Map<String, Object> getPaomoSysInfo(); Map<String, Object> getPaomoSysInfo();
......
...@@ -57,4 +57,6 @@ public interface IEmergencyService { ...@@ -57,4 +57,6 @@ public interface IEmergencyService {
Map<String, Object> getPressurePumpStatusChart(String equipmentCode, String startTime, String endTime, String bizOrgCode, String appKey, String product, String token); Map<String, Object> getPressurePumpStatusChart(String equipmentCode, String startTime, String endTime, String bizOrgCode, String appKey, String product, String token);
List<Map<String, Object>> getPressurePumpDiagnosticAnalysis(String equipmentCode, String nameKeys, String fieldKey, String bizOrgCode, String appKey, String product, String token); List<Map<String, Object>> getPressurePumpDiagnosticAnalysis(String equipmentCode, String nameKeys, String fieldKey, String bizOrgCode, String appKey, String product, String token);
Page<Map<String, Object>> alarmList(Page<Map<String, Object>> page,String bizOrgCode, List<String> types, List<String> emergencyLevels, String name, Integer cleanStatus);
} }
...@@ -248,6 +248,8 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> { ...@@ -248,6 +248,8 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
List<Map<String, Object>> normalIndexInfoList(String startDate, String endDate); List<Map<String, Object>> normalIndexInfoList(String startDate, String endDate);
Page<Map<String, Object>> normalIndexInfoListByPage(Page<Map<String, Object>> page, String startDate, String endDate, String systemCode, String name);
Map<String, Object> getFireAutoSysInfo(String startDate, String endDate); Map<String, Object> getFireAutoSysInfo(String startDate, String endDate);
Map<String, Object> getPaomoSysInfo(String startDate, String endDate); Map<String, Object> getPaomoSysInfo(String startDate, String endDate);
......
...@@ -23,7 +23,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -23,7 +23,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.text.ParseException; import java.text.ParseException;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -233,39 +232,35 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -233,39 +232,35 @@ public class EmergencyServiceImpl implements IEmergencyService {
yMap.put("name", name); yMap.put("name", name);
Object iotCode = x.get("iotCode"); Object iotCode = x.get("iotCode");
String prefix = null; String prefix = null;
String suffix = null;
if (x.get("iotCode") != null && iotCode.toString().length() > 8) { if (x.get("iotCode") != null && iotCode.toString().length() > 8) {
prefix = iotCode.toString().substring(0, 8); prefix = iotCode.toString().substring(0, 8);
suffix = iotCode.toString().substring(8);
ResponseModel responseModel = null;
try { try {
responseModel = iotFeign.selectListNew(appKey, product, token, prefix, startTime, endTime, null, pressurePumpStart); ResponseModel responseModel = iotFeign.selectListNew(appKey, product, token, prefix,null, startTime, endTime, null, pressurePumpStart);
} catch (Exception e) { if (200 == responseModel.getStatus()) {
e.printStackTrace(); String json = JSON.toJSONString(responseModel.getResult());
} List<Map<String, String>> dataList = (List<Map<String, String>>) JSONArray.parse(json);
if (200 == responseModel.getStatus()) { if (!CollectionUtils.isEmpty(dataList)) {
String json = JSON.toJSONString(responseModel.getResult()); Collections.reverse(dataList);
List<Map<String, String>> dataList = (List<Map<String, String>>) JSONArray.parse(json); Map<String, List<Map<String, String>>> dataMap = dataList.stream().filter(y -> y.containsKey("createdTime")).collect(Collectors.groupingBy(e -> e.get("createdTime").substring(5, 16)));
if (!CollectionUtils.isEmpty(dataList)) { List<Map<String, String>> yDataList = null;
Collections.reverse(dataList); for (String t : timeList) {
Map<String, List<Map<String, String>>> dataMap = dataList.stream().filter(y -> y.containsKey("createdTime")).collect(Collectors.groupingBy(e -> e.get("createdTime").substring(5, 16).replace("T", " "))); List<Map<String, String>> data = dataMap.get(t);
timeList.forEach(t -> { if (!CollectionUtils.isEmpty(data)) {
List<Map<String, String>> data = dataMap.get(t); yDataList = data.stream().filter(o -> "true".equalsIgnoreCase(o.get(pressurePumpStart))).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(data)) { }
List<Map<String, String>> yDataList = dataMap.get(t).stream().filter(o -> "true".equals(o.get(pressurePumpStart).toString())).collect(Collectors.toList());
yList.add(CollectionUtils.isEmpty(yDataList) ? 0 : 1); yList.add(CollectionUtils.isEmpty(yDataList) ? 0 : 1);
} else {
yList.add(0);
} }
}); } else {
} else { timeList.forEach(t -> {
timeList.forEach(t -> { yList.add(0);
yList.add(0); });
}); }
} }
yMap.put("data", yList);
yData.add(yMap);
} catch (Exception e) {
e.printStackTrace();
} }
yMap.put("data", yList);
yData.add(yMap);
} }
}); });
map.put("xData", timeList); map.put("xData", timeList);
...@@ -319,9 +314,9 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -319,9 +314,9 @@ public class EmergencyServiceImpl implements IEmergencyService {
AtomicInteger twoNum = new AtomicInteger(); AtomicInteger twoNum = new AtomicInteger();
if (!CollectionUtils.isEmpty(specificList)) { if (!CollectionUtils.isEmpty(specificList)) {
String prefix = null; String prefix = null;
String suffix = null;
for (Map<String, Object> x : specificList) { for (Map<String, Object> x : specificList) {
Object iotCode = x.get("iotCode"); Object iotCode = x.get("iotCode");
String suffix = null;
if (x.get("iotCode") != null && iotCode.toString().length() > 8) { if (x.get("iotCode") != null && iotCode.toString().length() > 8) {
prefix = iotCode.toString().substring(0, 8); prefix = iotCode.toString().substring(0, 8);
suffix = iotCode.toString().substring(8); suffix = iotCode.toString().substring(8);
...@@ -331,13 +326,13 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -331,13 +326,13 @@ public class EmergencyServiceImpl implements IEmergencyService {
if (200 == halfResponseModel.getStatus()) { if (200 == halfResponseModel.getStatus()) {
String json = JSON.toJSONString(halfResponseModel.getResult()); String json = JSON.toJSONString(halfResponseModel.getResult());
List<Map<String, String>> halfDataList = (List<Map<String, String>>) JSONArray.parse(json); List<Map<String, String>> halfDataList = (List<Map<String, String>>) JSONArray.parse(json);
List<Map<String, String>> halfCollect = halfDataList.stream().filter(o -> "true".equals(o.get(pressurePumpStart).toString())).collect(Collectors.toList()); List<Map<String, String>> halfCollect = halfDataList.stream().filter(o -> "true".equalsIgnoreCase(o.get(pressurePumpStart))).collect(Collectors.toList());
halfNum.addAndGet(halfCollect.size()); halfNum.addAndGet(halfCollect.size());
} }
if (200 == twoResponseModel.getStatus()) { if (200 == twoResponseModel.getStatus()) {
String json = JSON.toJSONString(twoResponseModel.getResult()); String json = JSON.toJSONString(twoResponseModel.getResult());
List<Map<String, String>> twoDataList = (List<Map<String, String>>) JSONArray.parse(json); List<Map<String, String>> twoDataList = (List<Map<String, String>>) JSONArray.parse(json);
List<Map<String, String>> twoCollect = twoDataList.stream().filter(o -> "true".equals(o.get(pressurePumpStart).toString())).collect(Collectors.toList()); List<Map<String, String>> twoCollect = twoDataList.stream().filter(o -> "true".equalsIgnoreCase(o.get(pressurePumpStart))).collect(Collectors.toList());
twoNum.addAndGet(twoCollect.size()); twoNum.addAndGet(twoCollect.size());
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -345,66 +340,53 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -345,66 +340,53 @@ public class EmergencyServiceImpl implements IEmergencyService {
} }
} }
} }
ResponseModel intervalResponseModel = iotFeign.selectOne(appKey, product, token, "1", prefix, null, null, pressurePumpStart); ResponseModel intervalResponseModel = iotFeign.topSingleField(appKey, product, token, "10", prefix, null, null, pressurePumpStart);
String intervalTime = nowStrLong; String intervalTime1 = nowStrLong;
String intervalTime2 = nowStrLong;
String durationTime = nowStrLong; String durationTime = nowStrLong;
if (200 == intervalResponseModel.getStatus()) { if (200 == intervalResponseModel.getStatus()) {
String json = JSON.toJSONString(intervalResponseModel.getResult()); String json = JSON.toJSONString(intervalResponseModel.getResult());
List<Map<String, String>> intervalDataList = (List<Map<String, String>>) JSONArray.parse(json); List<Map<String, String>> intervalDataList = (List<Map<String, String>>) JSONArray.parse(json);
if (!CollectionUtils.isEmpty(intervalDataList)) { if (!CollectionUtils.isEmpty(intervalDataList)) {
String value = intervalDataList.get(0).get(pressurePumpStart); String value = intervalDataList.get(0).get(pressurePumpStart);
if ("true".equals(value)) { List<Map<String, String>> falseDataList = intervalDataList.stream().filter(x -> x.containsKey("createdTime") && "false".equalsIgnoreCase(x.get(pressurePumpStart))).collect(Collectors.toList());
ResponseModel stopResponseModel = iotFeign.selectOne(appKey, product, token, "1", prefix, null, "false", pressurePumpStart); List<Map<String, String>> trueDataList = intervalDataList.stream().filter(x -> x.containsKey("createdTime") && "true".equalsIgnoreCase(x.get(pressurePumpStart))).collect(Collectors.toList());
if (200 == stopResponseModel.getStatus()) { if (!CollectionUtils.isEmpty(falseDataList) && !CollectionUtils.isEmpty(trueDataList)) {
String stopJson = JSON.toJSONString(stopResponseModel.getResult()); intervalTime1 = falseDataList.get(0).get("createdTime");
List<Map<String, String>> stopDataList = (List<Map<String, String>>) JSONArray.parse(stopJson); intervalTime2 = trueDataList.get(0).get("createdTime");
List<Map<String, String>> collect = stopDataList.stream().filter(o -> o.containsKey("createdTime")).collect(Collectors.toList()); }
if (!CollectionUtils.isEmpty(collect)) { if ("true".equalsIgnoreCase(value)) {
intervalTime = collect.get(0).get("createdTime").substring(0, 19).replace("T", " "); if (!CollectionUtils.isEmpty(trueDataList)) {
// 停泵前的前5分钟,判断管网压力状态 durationTime = intervalTime2;
try { }
String stop5BeforeTime = DateUtils.convertDateToString(DateUtils.dateAddMinutes(DateUtils.convertStrToDate(intervalTime, "yyyy-MM-dd HH:mm:ss"), -5), "yyyy-MM-dd HH:mm:ss"); if (!CollectionUtils.isEmpty(falseDataList)) {
ResponseModel pipeResponseModel = iotFeign.selectListNew(appKey, product, token, prefix, stop5BeforeTime, intervalTime, null, "FHS_PipePressureDetector_PipePressure"); try {
if (200 == pipeResponseModel.getStatus()) { String stop5BeforeTime = DateUtils.convertDateToString(DateUtils.dateAddMinutes(DateUtils.convertStrToDate(intervalTime1, "yyyy-MM-dd HH:mm:ss"), -5), "yyyy-MM-dd HH:mm:ss");
String pipeJson = JSON.toJSONString(pipeResponseModel.getResult()); ResponseModel pipeResponseModel = iotFeign.selectListNew(appKey, product, token, prefix, null, stop5BeforeTime, intervalTime2, null, "FHS_PipePressureDetector_PipePressure");
List<Map<String, String>> pipeDataList = (List<Map<String, String>>) JSONArray.parse(pipeJson); if (200 == pipeResponseModel.getStatus()) {
List<Map<String, String>> collect1 = pipeDataList.stream().filter(o -> o.containsKey("FHS_PipePressureDetector_PipePressure")).collect(Collectors.toList()); String pipeJson = JSON.toJSONString(pipeResponseModel.getResult());
if (!CollectionUtils.isEmpty(collect1)) { List<Map<String, String>> pipeDataList = (List<Map<String, String>>) JSONArray.parse(pipeJson);
int val1 = Integer.parseInt(collect1.get(0).get("FHS_PipePressureDetector_PipePressure")); List<Map<String, String>> collect1 = pipeDataList.stream().filter(o -> o.containsKey("FHS_PipePressureDetector_PipePressure")).collect(Collectors.toList());
int val2 = Integer.parseInt(collect1.get(pipeDataList.size() - 1).get("FHS_PipePressureDetector_PipePressure")); if (!CollectionUtils.isEmpty(collect1)) {
pipeMap.put("value", (val1 - val2) > 0.05 ? "异常" : "正常"); double val1 = Double.parseDouble(collect1.get(0).get("FHS_PipePressureDetector_PipePressure"));
} double val2 = Double.parseDouble(collect1.get(collect1.size() - 1).get("FHS_PipePressureDetector_PipePressure"));
pipeMap.put("value", Math.abs(val1 - val2) > 0.05 ? "异常" : "正常");
} }
} catch (ParseException e) {
throw new RuntimeException(e);
} }
} } catch (ParseException e) {
} throw new RuntimeException(e);
ResponseModel startResponseModel = iotFeign.selectOne(appKey, product, token, "2", prefix, null, "true", pressurePumpStart);
if (200 == startResponseModel.getStatus()) {
String startJson = JSON.toJSONString(startResponseModel.getResult());
List<Map<String, String>> startDataList = (List<Map<String, String>>) JSONArray.parse(startJson);
List<Map<String, String>> collect = startDataList.stream().filter(o -> o.containsKey("createdTime")).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(collect) && collect.size() > 1) {
durationTime = collect.get(1).get("createdTime").substring(0, 19).replace("T", " ");
} }
} }
} else { } else {
ResponseModel startResponseModel = iotFeign.selectOne(appKey, product, token, "1", prefix, null, "true", pressurePumpStart); if (!CollectionUtils.isEmpty(falseDataList) && !CollectionUtils.isEmpty(trueDataList)) {
if (200 == startResponseModel.getStatus()) { durationTime = trueDataList.get(0).get("createdTime");
String startJson = JSON.toJSONString(startResponseModel.getResult()); nowStrLong = falseDataList.get(0).get("createdTime");
List<Map<String, String>> startDataList = (List<Map<String, String>>) JSONArray.parse(startJson);
List<Map<String, String>> collect = startDataList.stream().filter(o -> o.containsKey("createdTime")).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(collect)) {
intervalTime = collect.get(0).get("createdTime").substring(0, 19).replace("T", " ");
durationTime = intervalTime;
}
} }
} }
} }
} }
intervalMap.put("value", DateUtils.getDurationMinutes(intervalTime, nowStrLong, "yyyy-MM-dd HH:mm:ss")); intervalMap.put("value", Math.abs(DateUtils.getDurationMinutes(intervalTime1, intervalTime2, "yyyy-MM-dd HH:mm:ss")));
durationlMap.put("value", DateUtils.getDurationMinutes(durationTime, nowStrLong, "yyyy-MM-dd HH:mm:ss")); durationlMap.put("value", Math.abs(DateUtils.getDurationMinutes(durationTime, nowStrLong, "yyyy-MM-dd HH:mm:ss")));
} else { } else {
intervalMap.put("value", 0); intervalMap.put("value", 0);
durationlMap.put("value", 0); durationlMap.put("value", 0);
...@@ -432,4 +414,8 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -432,4 +414,8 @@ public class EmergencyServiceImpl implements IEmergencyService {
return list; return list;
} }
@Override
public Page<Map<String, Object>> alarmList(Page<Map<String, Object>> page,String bizOrgCode, List<String> types, List<String> emergencyLevels, String name, Integer cleanStatus) {
return emergencyMapper.alarmList(page, bizOrgCode, types, emergencyLevels, name, cleanStatus);
}
} }
...@@ -789,7 +789,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec ...@@ -789,7 +789,7 @@ public class EquipmentSpecificAlarmServiceImpl extends ServiceImpl<EquipmentSpec
vo = equipmentSpecificMapper.getEquipmentSpecificIotCodeWYB().get(0); vo = equipmentSpecificMapper.getEquipmentSpecificIotCodeWYB().get(0);
} }
int startNum = Integer.parseInt(stringObjectMap.get("startNum").toString()); int startNum = Integer.parseInt(stringObjectMap.get("startNum").toString());
ResponseModel start = iotFeign.selectListNew(remoteSecurityService.getServerToken().getAppKey(), remoteSecurityService.getServerToken().getProduct(), remoteSecurityService.getServerToken().getToke(), vo.getIotCode().substring(0,8), startTime, endTime,"true", pressurePumpStart); ResponseModel start = iotFeign.selectListNew(remoteSecurityService.getServerToken().getAppKey(), remoteSecurityService.getServerToken().getProduct(), remoteSecurityService.getServerToken().getToke(), vo.getIotCode().substring(0,8),null, startTime, endTime,"true", pressurePumpStart);
if (200 == start.getStatus() && !ObjectUtils.isEmpty(start.getResult())) { if (200 == start.getStatus() && !ObjectUtils.isEmpty(start.getResult())) {
String json1 = JSON.toJSONString(start.getResult()); String json1 = JSON.toJSONString(start.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1); List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1);
......
...@@ -2003,6 +2003,11 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -2003,6 +2003,11 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
} }
@Override @Override
public Page<Map<String, Object>> normalIndexInfoListByPage(Page<Map<String, Object>> page, String startDate, String endDate, String systemCode, String name) {
return equipmentSpecificMapper.normalIndexInfoListByPage(page, startDate, endDate, systemCode, name);
}
@Override
public Map<String, Object> getFireAutoSysInfo(String startDate, String endDate) { public Map<String, Object> getFireAutoSysInfo(String startDate, String endDate) {
return equipmentSpecificMapper.getFireAutoSysInfo(); return equipmentSpecificMapper.getFireAutoSysInfo();
} }
......
...@@ -1019,22 +1019,16 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1019,22 +1019,16 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
int i = 1; int i = 1;
if (0 < list.size()) { if (0 < list.size()) {
for (Map<String, Object> m : list) { for (Map<String, Object> m : list) {
List<Map<String, Object>> list1 = new ArrayList();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
Map<String, Object> statusMap = new HashMap<>();
map.put("key", i); map.put("key", i);
map.put("name", m.get("name")); map.put("name", m.get("name"));
map.put("code", m.get("code")); map.put("code", m.get("code"));
map.put("systemTypeCode", systemCode); map.put("systemTypeCode", systemCode);
map.put("img", m.get("shbzImg")); map.put("img", m.get("shbzImg"));
statusMap.put("name", m.get("status")); map.put("type", m.get("type"));
if ("正常".equals(String.valueOf(m.get("status")))) { map.put("status", m.get("status"));
statusMap.put("level", "success"); map.put("fullName", m.get("fullName"));
} else { map.put("updateDate", m.get("updateDate").toString().replace("T", " "));
statusMap.put("level", "warning");
}
list1.add(statusMap);
map.put("status", list1);
resList.add(map); resList.add(map);
i++; i++;
}; };
......
...@@ -3076,4 +3076,14 @@ ...@@ -3076,4 +3076,14 @@
</preConditions> </preConditions>
<dropTable tableName="idx_width_defect"/> <dropTable tableName="idx_width_defect"/>
</changeSet> </changeSet>
<changeSet author="ls" id="20230209-1">
<preConditions onFail="MARK_RAN">
<tableExists tableName="wl_equipment_specific_alarm_log" />
</preConditions>
<comment>添加索引 index_equipment_code</comment>
<sql>
create index index_equipment_code on wl_equipment_specific_alarm_log (`equipment_code`);
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -662,10 +662,8 @@ ...@@ -662,10 +662,8 @@
FROM FROM
wl_equipment_specific_alarm_log wespa wl_equipment_specific_alarm_log wespa
WHERE WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm') wespa.create_date LIKE concat(temp.date, '%')
AND wespa.create_date LIKE concat(temp.date, '%') and wespa.equipment_code LIKE CONCAT('92010600','%')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.equipment_id = (SELECT we.id FROM wl_equipment we WHERE we.category_id = (SELECT wec.id FROM wl_equipment_category wec WHERE wec.code = '92010600' ) )
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or"> <foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%') wespa.system_codes like concat('%',#{code},'%')
</foreach> </foreach>
...@@ -676,10 +674,8 @@ ...@@ -676,10 +674,8 @@
FROM FROM
wl_equipment_specific_alarm_log wespa wl_equipment_specific_alarm_log wespa
WHERE WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm') wespa.create_date LIKE concat(temp.date, '%')
AND wespa.create_date LIKE concat(temp.date, '%') and wespa.equipment_code LIKE CONCAT('92010800','%')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.equipment_id = (SELECT we.id FROM wl_equipment we WHERE we.category_id = (SELECT wec.id FROM wl_equipment_category wec WHERE wec.code = '92010800' ) )
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or"> <foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%') wespa.system_codes like concat('%',#{code},'%')
</foreach> </foreach>
...@@ -690,10 +686,8 @@ ...@@ -690,10 +686,8 @@
FROM FROM
wl_equipment_specific_alarm_log wespa wl_equipment_specific_alarm_log wespa
WHERE WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm') wespa.create_date LIKE concat(temp.date, '%')
AND wespa.create_date LIKE concat(temp.date, '%') and wespa.equipment_code LIKE CONCAT('92010500','%')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.equipment_id = (SELECT we.id FROM wl_equipment we WHERE we.category_id = (SELECT wec.id FROM wl_equipment_category wec WHERE wec.code = '92010500' ) )
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or"> <foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%') wespa.system_codes like concat('%',#{code},'%')
</foreach> </foreach>
...@@ -795,7 +789,7 @@ ...@@ -795,7 +789,7 @@
FROM FROM
wl_equipment_specific_alarm_log wespa wl_equipment_specific_alarm_log wespa
WHERE WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm ') wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm')
AND wespa.create_date LIKE concat(temp.date, '%') AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true' AND wespa.equipment_specific_index_value = 'true'
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or"> <foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
...@@ -821,7 +815,7 @@ ...@@ -821,7 +815,7 @@
FROM FROM
wl_equipment_specific_alarm_log wespa wl_equipment_specific_alarm_log wespa
WHERE WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Fault ') wespa.equipment_specific_index_key LIKE concat('%', 'Fault')
AND wespa.create_date LIKE concat(temp.date, '%') AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true' AND wespa.equipment_specific_index_value = 'true'
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or"> <foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
...@@ -834,7 +828,7 @@ ...@@ -834,7 +828,7 @@
FROM FROM
wl_equipment_specific_alarm_log wespa wl_equipment_specific_alarm_log wespa
WHERE WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'PowerLoss ') wespa.equipment_specific_index_key LIKE concat('%', 'PowerLoss')
AND wespa.create_date LIKE concat(temp.date, '%') AND wespa.create_date LIKE concat(temp.date, '%')
AND wespa.equipment_specific_index_value = 'true' AND wespa.equipment_specific_index_value = 'true'
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or"> <foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
...@@ -932,18 +926,14 @@ ...@@ -932,18 +926,14 @@
( (
SELECT SELECT
COUNT( COUNT(
wespa.equipment_specific_id
wespa.equipment_specific_id
) )
FROM FROM
wl_equipment_specific_alarm_log wespa wl_equipment_specific_alarm_log wespa
WHERE WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm') wespa.create_date BETWEEN #{startDate}
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate} AND #{endDate}
AND wespa.equipment_id = (SELECT we.id FROM wl_equipment we WHERE we.category_id = (SELECT wec.id FROM wl_equipment_category wec WHERE wec.code = '92010600' ) ) and wespa.equipment_code LIKE CONCAT('92010600','%')
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or"> <foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%') wespa.system_codes like concat('%',#{code},'%')
</foreach> </foreach>
...@@ -951,18 +941,13 @@ ...@@ -951,18 +941,13 @@
( (
SELECT SELECT
COUNT( COUNT(
wespa.equipment_specific_id
wespa.equipment_specific_id
) )
FROM FROM
wl_equipment_specific_alarm_log wespa wl_equipment_specific_alarm_log wespa
WHERE WHERE wespa.create_date BETWEEN #{startDate}
wespa.equipment_specific_index_key LIKE concat('%', 'FireAlarm')
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate} AND #{endDate}
AND wespa.equipment_id = (SELECT we.id FROM wl_equipment we WHERE we.category_id = (SELECT wec.id FROM wl_equipment_category wec WHERE wec.code = '92010800' ) ) and wespa.equipment_code LIKE CONCAT('92010800','%')
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or"> <foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%') wespa.system_codes like concat('%',#{code},'%')
</foreach> </foreach>
...@@ -970,18 +955,14 @@ ...@@ -970,18 +955,14 @@
( (
SELECT SELECT
COUNT( COUNT(
wespa.equipment_specific_id
wespa.equipment_specific_id
) )
FROM FROM
wl_equipment_specific_alarm_log wespa wl_equipment_specific_alarm_log wespa
WHERE WHERE
wespa.equipment_specific_index_key LIKE concat('%', 'Shield') wespa.create_date BETWEEN #{startDate}
AND wespa.equipment_specific_index_value = 'true'
AND wespa.create_date BETWEEN #{startDate}
AND #{endDate} AND #{endDate}
AND wespa.equipment_id = (SELECT we.id FROM wl_equipment we WHERE we.category_id = (SELECT wec.id FROM wl_equipment_category wec WHERE wec.code = '92010500' ) ) and wespa.equipment_code LIKE CONCAT('92010500','%')
<foreach collection="list" open="and (" close=")" item="code" index="index" separator="or"> <foreach collection="list" open="and (" close=")" item="code" index="index" separator="or">
wespa.system_codes like concat('%',#{code},'%') wespa.system_codes like concat('%',#{code},'%')
</foreach> </foreach>
...@@ -1004,15 +985,16 @@ ...@@ -1004,15 +985,16 @@
( (
SELECT SELECT
CONCAT( temp.NAME, '类' ) AS `name`, CONCAT( temp.NAME, '类' ) AS `name`,
count( 1 ) AS `value`, FORMAT(IFNULL(SUM(temp.amount),0),0) AS `value`,
CODE CODE
FROM FROM
( (
SELECT SELECT
es.id, es.id,
ed.`name`, e.`name`,
DATE_FORMAT( ed.production_date, '%Y-%m-%d' ) AS productDate, DATE_FORMAT( ed.production_date, '%Y-%m-%d' ) AS productDate,
ed.CODE ed.CODE,
ifnull(sd.amount,0) as amount
FROM FROM
wl_equipment_specific es wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
...@@ -1044,7 +1026,7 @@ ...@@ -1044,7 +1026,7 @@
ed.`name` AS specificName, ed.`name` AS specificName,
IFNULL( ed.standard, '' ) AS modelNumber, IFNULL( ed.standard, '' ) AS modelNumber,
DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) AS dayNum, DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) AS dayNum,
COUNT( ed.CODE ) sum, format(nullif(SUM(sd.amount), 0), 0) sum,
IFNULL( ws.full_name, '' ) AS equipAddress IFNULL( ws.full_name, '' ) AS equipAddress
FROM FROM
wl_equipment_specific es wl_equipment_specific es
...@@ -1089,10 +1071,36 @@ ...@@ -1089,10 +1071,36 @@
WHERE WHERE
sd.`status` = 7 sd.`status` = 7
AND update_date LIKE CONCAT( DATE_FORMAT( CURRENT_DATE, '%Y-%m' ), '%' )) monthScrap, AND update_date LIKE CONCAT( DATE_FORMAT( CURRENT_DATE, '%Y-%m' ), '%' )) monthScrap,
( SELECT count( 1 ) FROM wl_stock_detail sd LEFT JOIN wl_equipment_specific es ON es.id = sd.equipment_specific_id WHERE sd.`status` = 7 ) scrap,
( (
SELECT SELECT
count( es.id ) FORMAT(IFNULL(SUM(sd.amount),0),0)
FROM
wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
LEFT JOIN wl_equipment e ON ed.equipment_id = e.id
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id
WHERE
ed.production_date IS NOT NULL
AND (
(sd.`status` != 7)
OR (sd.`status` IS NULL)
OR (sd.`status` = '')
)
AND e.expiry_date IS NOT NULL
AND 0 > DATEDIFF(
DATE_ADD(
DATE_FORMAT(
ed.production_date,
'%Y-%m-%d'
),
INTERVAL e.expiry_date YEAR
),
CURRENT_DATE
)
) scrap,
(
SELECT
FORMAT(IFNULL(SUM(sd.amount),0),0)
FROM FROM
wl_equipment_specific es wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
...@@ -1108,7 +1116,7 @@ ...@@ -1108,7 +1116,7 @@
AND 30 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )) oneImminent, AND 30 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )) oneImminent,
( (
SELECT SELECT
count( es.id ) FORMAT(IFNULL(SUM(sd.amount),0),0)
FROM FROM
wl_equipment_specific es wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
...@@ -1124,7 +1132,7 @@ ...@@ -1124,7 +1132,7 @@
AND 60 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )) twoImminent, AND 60 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )) twoImminent,
( (
SELECT SELECT
count( es.id ) FORMAT(IFNULL(SUM(sd.amount),0),0)
FROM FROM
wl_equipment_specific es wl_equipment_specific es
LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id LEFT JOIN wl_equipment_detail ed ON ed.id = es.equipment_detail_id
...@@ -1137,7 +1145,89 @@ ...@@ -1137,7 +1145,89 @@
OR ( sd.`status` IS NULL ) OR ( sd.`status` IS NULL )
OR ( sd.`status` = '' )) OR ( sd.`status` = '' ))
AND e.expiry_date IS NOT NULL AND e.expiry_date IS NOT NULL
AND 90 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )) sixImminent AND 180 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )) sixImminent
</select>
<select id="alarmList" resultType="java.util.Map">
SELECT
wlesal.id,
concat(
wlesal.equipment_specific_name,
wlesal.equipment_specific_index_name
) AS alamContent,
IF (
wlesal.confirm_type IS NULL,
'未处理',
'已处理'
) handleStatus,
IF (
wlesal.clean_time IS NOT NULL,
'已消除',
'未消除'
) cleanStatus,
wlesal.equipment_index_id AS fireEquipmentIndexId,
wlesal.equipment_specific_index_key AS fireEquipmentSpecificIndexKey,
wlesal.equipment_specific_index_name AS fireEquipmentSpecificIndexName,
CASE wlesal.equipment_specific_index_value
WHEN 'true' THEN
'是'
WHEN 'false' THEN
'否'
ELSE
wlesal.equipment_specific_index_value
END AS fireEquipmentPointValue,
wlesal.type AS typeCode,
(
SELECT
type_name
FROM
wl_signal_classify sc
WHERE
sc.type_code = wlesal.type
LIMIT 1
) AS type,
wlesal.equipment_specific_name AS equipmentSpecificName,
wlesal.location,
date_format(
wlesal.create_date,
'%Y-%m-%d %H:%i:%s'
) createDate,
wlesal.emergency_level_describe AS emergencyLevelDescribe
FROM
wl_equipment_specific_alarm_log wlesal
<where>
<if test="bizOrgCode != null and bizOrgCode != ''">
and wlesal.biz_org_code like concat(#{bizOrgCode},'%')
</if>
<if test="name != null and name != ''">
and wlesal.equipment_specific_name like concat(#{name},'%')
</if>
<if test="cleanStatus != null and cleanStatus != '' and cleanStatus == 2">
and wlesal.clean_time IS NULL
</if>
<if test="cleanStatus != null and cleanStatus != '' and cleanStatus == 1">
and wlesal.clean_time IS NOT NULL
</if>
<if test="types != null">
<foreach collection="types" index="index" item="item" open="and (" separator=" OR " close=")">
wlesal.type = #{item}
</foreach>
</if>
<if test="emergencyLevels != null">
<foreach collection="emergencyLevels" index="index" item="item" open="and (" separator=" OR " close=")">
wlesal.emergency_level = #{item}
</foreach>
</if>
</where>
ORDER BY
wlesal.create_date DESC
</select> </select>
</mapper> </mapper>
...@@ -261,10 +261,10 @@ ...@@ -261,10 +261,10 @@
<if test="value != null and value != ''"> <if test="value != null and value != ''">
AND wesal.equipment_specific_index_value = #{value} AND wesal.equipment_specific_index_value = #{value}
</if> </if>
<if test="isCleanTime != null and isCleanTime = 'false'"> <if test="isCleanTime != null and isCleanTime == 'false'">
AND wesal.clean_time IS NULL AND wesal.clean_time IS NULL
</if> </if>
<if test="isCleanTime != null and isCleanTime = 'true'"> <if test="isCleanTime != null and isCleanTime == 'true'">
AND wesal.clean_time IS NOT NULL AND wesal.clean_time IS NOT NULL
</if> </if>
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
......
...@@ -1816,6 +1816,73 @@ ...@@ -1816,6 +1816,73 @@
AND DATE_FORMAT(si.update_date,'%y-%m-%d') <![CDATA[<=]]> DATE_FORMAT(#{endDate},'%y-%m-%d') AND DATE_FORMAT(si.update_date,'%y-%m-%d') <![CDATA[<=]]> DATE_FORMAT(#{endDate},'%y-%m-%d')
</if> </if>
</select> </select>
<select id="normalIndexInfoListByPage" resultType="java.util.Map">
SELECT
si.id,
`s`.`name` AS `equipName`,
`si`.`equipment_index_key` AS `equipmentIndexKey`,
(
CASE
WHEN si.value_label IS NULL
OR trim(si.value_label) = '' THEN
(
CASE si.`value`
WHEN 'true' THEN
'开'
WHEN 'false' THEN
'关'
ELSE
si.`value`
END
)
ELSE
si.value_label
END
) AS `value`,
si.unit,
'' AS standardValue,
DATE_FORMAT(
si.update_date,
'%Y-%m-%d %H:%i:%s'
) AS `time`,
`si`.`equipment_index_name` AS `equipmentIndexName`,
`s`.`code` AS `code`,
ifnull(ed.area, '--') AS area,
(
SELECT
group_concat(`fs`.`name` SEPARATOR ',')
FROM
`f_fire_fighting_system` `fs`
WHERE
(
0 <![CDATA[<>]]> find_in_set(`fs`.`id`, `s`.`system_id`)
)
) AS `fightSysName`
FROM
`wl_equipment_specific_index` `si`
JOIN `wl_equipment_specific` `s`
LEFT JOIN wl_equipment_detail ed ON s.equipment_detail_id = ed.id
LEFT JOIN wl_equipment_index wei ON wei.id = si.equipment_index_id
WHERE
`si`.`equipment_specific_id` = `s`.`id`
AND si.is_alarm = 0
AND si.`value` IS NOT NULL
<if test="startDate!=null">
AND DATE_FORMAT(si.update_date,'%y-%m-%d') <![CDATA[>=]]> DATE_FORMAT(#{startDate},'%y-%m-%d')
</if>
<if test="endDate!=null">
AND DATE_FORMAT(si.update_date,'%y-%m-%d') <![CDATA[<=]]> DATE_FORMAT(#{endDate},'%y-%m-%d')
</if>
<if test="name != null and name != ''">
AND (s.name LIKE CONCAT('%', #{name}, '%') or si.equipment_index_name LIKE CONCAT('%',#{name},'%'))
</if>
<if test="systemCode != null and systemCode != ''">
AND FIND_IN_SET((SELECT id FROM f_fire_fighting_system WHERE code = #{systemCode} ),s.system_id)
</if>
order by si.update_date desc
</select>
<select id="getFireAutoSysInfo" resultType="java.util.Map"> <select id="getFireAutoSysInfo" resultType="java.util.Map">
SELECT SELECT
ifnull(`b`.`fightSysId`, NULL) AS `fightSysId`, ifnull(`b`.`fightSysId`, NULL) AS `fightSysId`,
......
...@@ -5595,19 +5595,18 @@ ...@@ -5595,19 +5595,18 @@
spe.id, spe.id,
spe.`name`, spe.`name`,
spe.`code`, spe.`code`,
( IFNULL( spe.realtime_iot_index_name, '--' ) AS `status`,
CASE wle.shbz_img shbzImg,
( SELECT count(*) FROM wl_equipment_specific_alarm wesa WHERE wesa.equipment_specific_id = spe.id AND STATUS = 1 ) ei.is_alarm AS type,
WHEN 0 THEN IFNULL( ws.full_name, '--' ) AS fullName,
'正常' ELSE '异常' IFNULL( spe.realtime_iot_index_update_date, '--' ) AS updateDate
END
) `status`,
wle.shbz_img shbzImg
FROM FROM
wl_equipment_specific AS spe wl_equipment_specific AS spe
LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, spe.system_id ) LEFT JOIN wl_equipment_index ei ON spe.realtime_iot_index_id = ei.id
LEFT JOIN wl_equipment_detail AS det ON spe.equipment_detail_id = det.id LEFT JOIN wl_warehouse_structure ws ON spe.warehouse_structure_id = ws.id
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id LEFT JOIN f_fire_fighting_system fs ON FIND_IN_SET( fs.id, spe.system_id )
LEFT JOIN wl_equipment_detail AS det ON spe.equipment_detail_id = det.id
LEFT JOIN wl_equipment AS wle ON wle.id = det.equipment_id
WHERE WHERE
fs.system_type_code IS NOT NULL fs.system_type_code IS NOT NULL
<if test="bizOrgCode != null and bizOrgCode != ''"> <if test="bizOrgCode != null and bizOrgCode != ''">
......
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 to comment