Commit 2e33a4d3 authored by maoying's avatar maoying

合并冲突添加分支说明

parents b47aec23 839bb6b3
# 机场消防监管_特种设备监管V1.0.0 # 电力总部系统;旧巡检功能现场版本,次版本对应现场韶山数字1.0;兼容数字化2.0非双月报功能(对应平台1.7.14版本)
\ No newline at end of file \ No newline at end of file
...@@ -150,4 +150,8 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> { ...@@ -150,4 +150,8 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
List<Map<String, Object>> getNewEquipmentForSpecifyDate(String dutyDate,String groupCode,String equipmentId,String equipmentName,String groupByName); List<Map<String, Object>> getNewEquipmentForSpecifyDate(String dutyDate,String groupCode,String equipmentId,String equipmentName,String groupByName);
String getFirstAidCompanyId (); String getFirstAidCompanyId ();
List<Map<String, Object>> dayDutyStatistics(String date, String groupCode, String fieldCode, String dictType);
List<Map<String, Object>> dayDutyList(String date, String dictCodes);
} }
...@@ -37,4 +37,8 @@ public interface IDutyPersonService extends IDutyCommonService { ...@@ -37,4 +37,8 @@ public interface IDutyPersonService extends IDutyCommonService {
List<Map<String, Object>> queryByCompanyId(List<String> bizNames); List<Map<String, Object>> queryByCompanyId(List<String> bizNames);
List<Map<String, Object>> queryByCompanyNew(String bizOrgName); List<Map<String, Object>> queryByCompanyNew(String bizOrgName);
List<Map<String, Object>> dayDutyStatistics(String date, String groupCode, String fieldCode, String dictType);
List<Map<String, Object>> dayDutyList(String date, String dictCodes);
} }
...@@ -119,6 +119,82 @@ ...@@ -119,6 +119,82 @@
AND i.field_value != '' AND i.field_value != ''
GROUP BY i.field_value GROUP BY i.field_value
</select> </select>
<select id="dayDutyStatistics" resultType="java.util.Map">
SELECT
i.field_value AS postTypeName,
count( 1 ) AS total,
d.`code`,
MAX( CASE d.`code` WHEN '1601' THEN 'firePerson' WHEN '1602' THEN 'opsPerson' WHEN '1603' THEN 'securityPerson' WHEN '1604' THEN 'overhaulPerson' ELSE 'otherPerson' END ) AS postType
FROM
cb_duty_person_shift s,
cb_dynamic_form_instance i
LEFT JOIN cb_data_dictionary d ON i.field_value = d.`name`
WHERE
s.instance_id = i.instance_id
<if test="fieldCode != null and fieldCode != ''">
AND i.field_code = #{fieldCode}
</if>
<if test="date != null and date != ''">
AND s.duty_date = #{date}
</if>
AND s.shift_id IS NOT NULL
<if test="groupCode != null and groupCode != ''">
AND i.group_code = #{groupCode}
</if>
AND i.field_value IS NOT NULL
AND i.field_value != ''
<if test="dictType != null and dictType != ''">
AND d.type = #{dictType}
</if>
GROUP BY
i.field_value
</select>
<select id="dayDutyList" resultType="java.util.Map">
SELECT
id,
userName,
telephone,
peopleType
FROM
(
SELECT
ou.sequence_nbr AS id,
ou.biz_org_name AS userName,
IFNULL( MAX( CASE WHEN cfi.field_code = 'telephone' THEN field_value END ), '' ) AS telephone,
IFNULL( MAX( CASE WHEN cfi.field_code = 'positionType' THEN field_value END ), '' ) AS postTypeName,
IFNULL( MAX( CASE WHEN cfi.field_code = 'personImg' THEN field_value END ), '' ) AS personImg,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
FROM
(
SELECT
IFNULL( max( CASE WHEN fi.field_code = 'userId' THEN fi.field_value END ), ps.instance_id ) AS id
FROM
cb_duty_person_shift ps
LEFT JOIN cb_dynamic_form_instance fi ON fi.instance_id = ps.instance_id
<where>
<if test="date != null and date != ''">
ps.duty_date = #{date}
</if>
</where>
GROUP BY
fi.instance_id
) a
LEFT JOIN cb_org_usr ou ON ou.sequence_nbr = a.id
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
GROUP BY
a.id
) b
<where>
<if test="dictCodes != null and dictCodes.split(',').length >0">
b.peopleType IN
<foreach collection="dictCodes.split(',')" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
GROUP BY
b.id
</select>
<select id="genRangeDate" resultType="map"> <select id="genRangeDate" resultType="map">
SELECT SELECT
DATE_FORMAT(DATE( DATE_ADD( #{beginDate}, INTERVAL @s DAY )),'%Y-%m-%d') AS date, DATE_FORMAT(DATE( DATE_ADD( #{beginDate}, INTERVAL @s DAY )),'%Y-%m-%d') AS date,
......
...@@ -123,4 +123,7 @@ public class EquipmentIndex extends BaseEntity { ...@@ -123,4 +123,7 @@ public class EquipmentIndex extends BaseEntity {
@TableField(value = "emergency_level_describe") @TableField(value = "emergency_level_describe")
private String emergencyLevelDescribe; private String emergencyLevelDescribe;
@TableField(value = "unit")
private String unit;
} }
...@@ -176,4 +176,7 @@ public class EquipmentSpecificIndex extends BaseEntity { ...@@ -176,4 +176,7 @@ public class EquipmentSpecificIndex extends BaseEntity {
// 直流中心方便前端刷新展示 // 直流中心方便前端刷新展示
@TableField(exist = false) @TableField(exist = false)
private String UUID; private String UUID;
@TableField(value = "unit")
private String unit;
} }
package com.yeejoin.equipmanage.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author keyong
* @title: UnitEnum
* <pre>
* @description: TODO
* </pre>
* @date 2023/1/13 20:44
*/
@Getter
@AllArgsConstructor
public enum IndexStatusEnum {
LOW("0", "液位低", ""),
NORMAL("1", "正常", ""),
HIGH("2", "液位高", "");
private String key;
private String describe1;
private String describe2;
public static IndexStatusEnum getEnumByKey(String key) {
IndexStatusEnum statusEnum = null;
for (IndexStatusEnum u : IndexStatusEnum.values()) {
if (u.getKey().equals(key)) {
statusEnum = u;
break;
}
}
return statusEnum;
}
}
package com.yeejoin.equipmanage.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author keyong
* @title: UnitEnum
* <pre>
* @description: TODO
* </pre>
* @date 2023/1/13 20:44
*/
@Getter
@AllArgsConstructor
public enum UnitEnum {
M("m", "米", ""),
DM("dm", "分米", ""),
CM("cm", "厘米", ""),
MM("mm", "毫米", "");
private String key;
private String name;
private String description;
public static UnitEnum getEnum(String key) {
UnitEnum unitEnum = null;
for (UnitEnum u : UnitEnum.values()) {
if (u.getKey().equals(key)) {
unitEnum = u;
break;
}
}
return unitEnum;
}
}
package com.yeejoin.equipmanage.common.utils;
import com.yeejoin.equipmanage.common.enums.UnitEnum;
import lombok.extern.slf4j.Slf4j;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
/**
* @author
* @title: UnitTransformUtil
* <pre>
* @description: TODO
* </pre>
* @date 2023/1/13 20:43
*/
@Slf4j
public class UnitTransformUtil {
public static Map<String, Object> transformValues(String currentValue, String currentUnit, String minValue, String maxValue) {
Map<String, Object> map = new HashMap<>();
if (UnitEnum.MM.getKey().equalsIgnoreCase(currentUnit) || UnitEnum.MM.getName().equals(currentUnit)){
BigDecimal divide = new BigDecimal(1000);
if (StringUtil.isNotEmpty(currentValue) && !"--".equals(currentValue)){
BigDecimal nowLevel = new BigDecimal(currentValue);
map.put("nowValue", nowLevel.divide(divide,2,BigDecimal.ROUND_HALF_UP));
BigDecimal nowVal = new BigDecimal(currentValue).divide(divide,2,BigDecimal.ROUND_HALF_UP);
// status 中 0 表示过低;1 表示正常;2 表示过高
if (StringUtil.isNotEmpty(minValue) && !"--".equals(minValue) && StringUtil.isNotEmpty(maxValue)
&& !"--".equals(maxValue) && !"null".equalsIgnoreCase(minValue)&& !"--".equals(maxValue) && !"null".equalsIgnoreCase(maxValue)) {
if (nowVal.compareTo(new BigDecimal(minValue)) < 0) {
map.put("status", "0");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
} else if (nowVal.compareTo(new BigDecimal(maxValue)) == 1) {
map.put("status", "2");
map.put("abs", 100);
} else {
map.put("status", "1");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
}
} else {
map.put("status", "--");
map.put("abs", "--");
}
} else {
map.put("nowValue", "--");
map.put("status", "--");
map.put("abs", "--");
}
} else if (UnitEnum.CM.getKey().equalsIgnoreCase(currentUnit) || UnitEnum.CM.getName().equals(currentUnit)){
BigDecimal divide = new BigDecimal(100);
if (StringUtil.isNotEmpty(currentValue) && !"--".equals(currentValue)){
BigDecimal nowLevel = new BigDecimal(currentValue);
map.put("nowValue", nowLevel.divide(divide,2,BigDecimal.ROUND_HALF_UP));
BigDecimal nowVal = new BigDecimal(currentValue).divide(divide,2,BigDecimal.ROUND_HALF_UP);
// status 中 0 表示过低;1 表示正常;2 表示过高
if (StringUtil.isNotEmpty(minValue) && !"--".equals(minValue) && StringUtil.isNotEmpty(maxValue)
&& !"--".equals(maxValue) && !"null".equalsIgnoreCase(minValue)&& !"--".equals(maxValue) && !"null".equalsIgnoreCase(maxValue)) {
if (nowVal.compareTo(new BigDecimal(minValue)) < 0) {
map.put("status", "0");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
} else if (nowVal.compareTo(new BigDecimal(maxValue)) == 1) {
map.put("status", "2");
map.put("abs", 100);
} else {
map.put("status", "1");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
}
} else {
map.put("status", "--");
map.put("abs", "--");
}
} else {
map.put("nowValue", "--");
map.put("status", "--");
map.put("abs", "--");
}
} else if (UnitEnum.DM.getKey().equalsIgnoreCase(currentUnit) || UnitEnum.DM.getName().equals(currentUnit)) {
BigDecimal divide = new BigDecimal(10);
if (StringUtil.isNotEmpty(currentValue) && !"--".equals(currentValue)){
BigDecimal nowLevel = new BigDecimal(currentValue);
map.put("nowValue",nowLevel.divide(divide,2,BigDecimal.ROUND_HALF_UP));
BigDecimal nowVal = new BigDecimal(currentValue).divide(divide,2,BigDecimal.ROUND_HALF_UP);
// status 中 0 表示过低;1 表示正常;2 表示过高
if (StringUtil.isNotEmpty(minValue) && !"--".equals(minValue) && StringUtil.isNotEmpty(maxValue)
&& !"--".equals(maxValue) && !"null".equalsIgnoreCase(minValue)&& !"--".equals(maxValue) && !"null".equalsIgnoreCase(maxValue)) {
if (nowVal.compareTo(new BigDecimal(minValue)) < 0) {
map.put("status", "0");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
} else if (nowVal.compareTo(new BigDecimal(maxValue)) == 1) {
map.put("status", "2");
map.put("abs", 100);
} else {
map.put("status", "1");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
}
} else {
map.put("status", "--");
map.put("abs", "--");
}
} else {
map.put("nowValue", "--");
map.put("status", "--");
map.put("abs", "--");
}
} else {
BigDecimal nowVal = new BigDecimal(0);
if (StringUtil.isNotEmpty(currentValue) && !"--".equals(currentValue)) {
nowVal = new BigDecimal(currentValue);
map.put("nowValue", nowVal);
} else {
map.put("nowValue", "--");
}
// status 中 0 表示过低;1 表示正常;2 表示过高
if (StringUtil.isNotEmpty(currentValue) && !"--".equals(currentValue)
&& StringUtil.isNotEmpty(minValue) && !"--".equals(minValue)
&& StringUtil.isNotEmpty(maxValue) && !"--".equals(maxValue) && StringUtil.isNotEmpty(currentUnit)
&& !"null".equalsIgnoreCase(minValue)&& !"--".equals(maxValue) && !"null".equalsIgnoreCase(maxValue)) {
if (nowVal.compareTo(new BigDecimal(minValue)) < 0) {
map.put("status", "0");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
} else if (nowVal.compareTo(new BigDecimal(maxValue)) == 1) {
map.put("status", "2");
map.put("abs", 100);
} else {
map.put("status", "1");
map.put("abs", nowVal.divide(new BigDecimal(maxValue),2,BigDecimal.ROUND_HALF_UP).movePointRight(2));
}
} else {
map.put("status", "--");
map.put("abs", "--");
}
}
return map;
}
}
...@@ -149,6 +149,28 @@ public class DutyPersonController extends BaseController { ...@@ -149,6 +149,28 @@ public class DutyPersonController extends BaseController {
return ResponseHelper.buildResponse(iDutyPersonService.newStatisticsDay(beginDate, endDate, fieldCode)); return ResponseHelper.buildResponse(iDutyPersonService.newStatisticsDay(beginDate, endDate, fieldCode));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/day-duty-statistics")
@ApiOperation(httpMethod = "GET", value = "获取指定日期值班人员统计", notes = "获取指定日期值班人员统计")
public ResponseModel<List<Map<String, Object>>> dayDutyStatistics(
@ApiParam(value = "值班日期") @RequestParam(required = false) String date,
@ApiParam(value = "分组编码") @RequestParam(required = false) String groupCode,
@ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode,
@ApiParam(value = "字典类型") @RequestParam(required = false) String dictType
) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.dayDutyStatistics(date, groupCode, fieldCode, dictType));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/day-duty-list")
@ApiOperation(httpMethod = "GET", value = "获取指定日期值班人员列表", notes = "获取指定日期值班人员列表")
public ResponseModel<List<Map<String, Object>>> dayDutyList(
@ApiParam(value = "值班日期") @RequestParam(required = false) String date,
@ApiParam(value = "字典编码") @RequestParam(required = false) String dictCodes
) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.dayDutyList(date, dictCodes));
}
/** /**
* 调班 * 调班
* *
......
...@@ -329,8 +329,17 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType ...@@ -329,8 +329,17 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
public List<Map<String, Object>> queryByCompanyNew(String bizOrgName){ public List<Map<String, Object>> queryByCompanyNew(String bizOrgName){
return dutyPersonShiftMapper.queryByCompanyNew(bizOrgName); return dutyPersonShiftMapper.queryByCompanyNew(bizOrgName);
} }
@Override
public List<Map<String, Object>> dayDutyStatistics(String date, String groupCode, String fieldCode, String dictType) {
return dutyPersonShiftMapper.dayDutyStatistics(date, groupCode, fieldCode, dictType);
}
@Override
public List<Map<String, Object>> dayDutyList(String date, String dictCodes) {
return dutyPersonShiftMapper.dayDutyList(date, dictCodes);
}
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode) { public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getNewEquipmentForSpecifyDate(dutyDay, List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getNewEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "deptId", "deptName", "result.deptId"); this.getGroupCode(), "deptId", "deptName", "result.deptId");
......
...@@ -255,17 +255,27 @@ public class ConfigureController extends AbstractBaseController { ...@@ -255,17 +255,27 @@ public class ConfigureController extends AbstractBaseController {
String bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null; String bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
Page page = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize()); Page page = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize());
Page<Map<String, Object>> waterInfo = fireFightingSystemMapper.getWaterInfo(page, bizOrgCode, null); Page<Map<String, Object>> waterInfo = fireFightingSystemMapper.getWaterInfo(page, bizOrgCode, null);
Map<String, Object> unit = fireFightingSystemMapper.getWaterlevelUnit(); for (Map<String, Object> record : waterInfo.getRecords()) {
if ("CM".equals(unit.get("unit")) || "cm".equals(unit.get("unit")) || "厘米".equals(unit.get("unit"))){ Map<String, Object> unit = null;
for (Map<String, Object> record : waterInfo.getRecords()) { String deviceId = String.valueOf(record.get("level_device_id"));
String[] split = deviceId.split(",");
if (!ObjectUtils.isEmpty(split) && !ObjectUtils.isEmpty(split[0])) {
String s = split[0];
if ("pool".equals(record.get("resource_type"))) {
unit = fireFightingSystemMapper.getWaterlevelUnit(s, "FHS_FirePoolDevice_WaterLevel");
} else {
unit = fireFightingSystemMapper.getWaterlevelUnit(s, "FHS_WirelessliquidDetector_WaterLevel");
}
}
if (!ObjectUtils.isEmpty(unit) && "CM".equals(unit.get("unit")) || "cm".equals(unit.get("unit")) || "厘米".equals(unit.get("unit"))){
BigDecimal divide = new BigDecimal(100); BigDecimal divide = new BigDecimal(100);
if (!ObjectUtils.isEmpty(record.get("nowLevel")) && !"--".equals(record.get("nowLevel"))){ if (!ObjectUtils.isEmpty(record.get("nowLevel")) && !"--".equals(record.get("nowLevel"))){
BigDecimal nowLevel = new BigDecimal(String.valueOf(record.get("nowLevel"))); BigDecimal nowLevel = new BigDecimal(String.valueOf(record.get("nowLevel")));
record.put("nowLevel",nowLevel.divide(divide,2,BigDecimal.ROUND_HALF_UP)); record.put("nowLevel", nowLevel.divide(divide, 2, BigDecimal.ROUND_HALF_UP));
} }
if (!ObjectUtils.isEmpty(record.get("levelAbs")) && !"--".equals(record.get("nowLevel"))){ if (!ObjectUtils.isEmpty(record.get("levelAbs")) && !"--".equals(record.get("nowLevel"))){
BigDecimal levelAbs = new BigDecimal(String.valueOf(record.get("levelAbs"))); BigDecimal levelAbs = new BigDecimal(String.valueOf(record.get("levelAbs")));
record.put("levelAbs",levelAbs.divide(divide,2,BigDecimal.ROUND_HALF_UP)); record.put("levelAbs", levelAbs.divide(divide, 2, BigDecimal.ROUND_HALF_UP));
} }
} }
} }
......
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.enums.IndexStatusEnum;
import com.yeejoin.equipmanage.common.utils.*; import com.yeejoin.equipmanage.common.utils.*;
import com.yeejoin.equipmanage.config.PersonIdentify; import com.yeejoin.equipmanage.config.PersonIdentify;
import com.yeejoin.equipmanage.fegin.IotFeign; import com.yeejoin.equipmanage.fegin.IotFeign;
...@@ -57,6 +58,9 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -57,6 +58,9 @@ public class SupervisionConfigureController extends AbstractBaseController {
@Value("${equipment.pressurepump.start}") @Value("${equipment.pressurepump.start}")
private String pressurePumpStart; private String pressurePumpStart;
@Value("${equipment.pressurepump.stop}")
private String pressurePumpStop;
@PersonIdentify @PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "监盘概览水源信息") @ApiOperation(value = "监盘概览水源信息")
...@@ -70,7 +74,22 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -70,7 +74,22 @@ public class SupervisionConfigureController extends AbstractBaseController {
bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null; bizOrgCode = !ValidationUtil.isEmpty(reginParams.getPersonIdentity()) && StringUtil.isNotEmpty(reginParams.getPersonIdentity().getBizOrgCode()) ? reginParams.getPersonIdentity().getBizOrgCode() : null;
} }
Page page = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize()); Page page = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize());
return CommonResponseUtil.success(fireFightingSystemMapper.getWaterInfoBySuper(page, bizOrgCode)); Page<Map<String, Object>> page1 = fireFightingSystemMapper.getWaterInfoBySuper(page, bizOrgCode);
List<Map<String, Object>> res = page1.getRecords();
if (0 < res.size()) {
for (Map<String, Object> m : res) {
Map<String, Object> transResult = UnitTransformUtil.transformValues(String.valueOf(m.get("nowLevel")),
String.valueOf(m.get("unit")), String.valueOf(m.get("minLevel")), String.valueOf(m.get("maxLevel")));
m.put("nowLevel", transResult.get("nowValue"));
if (StringUtil.isNotEmpty(IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))))) {
m.put("levelStatus", IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))).getDescribe1());
} else {
m.put("levelStatus", "--");
}
m.put("levelAbs", transResult.get("abs"));
}
}
return CommonResponseUtil.success(page1);
} }
@PersonIdentify @PersonIdentify
...@@ -257,7 +276,8 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -257,7 +276,8 @@ public class SupervisionConfigureController extends AbstractBaseController {
} }
Page page = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize()); Page page = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize());
Page<Map<String, Object>> pressurePumpInfo = fireFightingSystemMapper.getPressurePumpInfo(page, bizOrgCode, null); Page<Map<String, Object>> pressurePumpInfo = fireFightingSystemMapper.getPressurePumpInfo(page, bizOrgCode, null);
List<Long> ids = new ArrayList(); List<Long> startTimeList = new ArrayList();
List<Long> stopTimeList = new ArrayList();
pressurePumpInfo.getRecords().stream().map(item -> { pressurePumpInfo.getRecords().stream().map(item -> {
item.put("monthStartNum", 0); item.put("monthStartNum", 0);
item.put("halfHourStartNum", 0); item.put("halfHourStartNum", 0);
...@@ -296,12 +316,16 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -296,12 +316,16 @@ public class SupervisionConfigureController extends AbstractBaseController {
ResponseModel twoHourEntity = null; ResponseModel twoHourEntity = null;
ResponseModel fourHourEntity = null; ResponseModel fourHourEntity = null;
ResponseModel oneHourEntity = null; ResponseModel oneHourEntity = null;
ResponseModel start = null;
ResponseModel stop = null;
try { try {
mounthEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, pressurePumpStart); mounthEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), startDateStr, nowStrLong, prefix, suffix, pressurePumpStart);
halfHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), half, nowStrLong, prefix, suffix, pressurePumpStart); halfHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), half, nowStrLong, prefix, suffix, pressurePumpStart);
twoHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), two, nowStrLong, prefix, suffix, pressurePumpStart); twoHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), two, nowStrLong, prefix, suffix, pressurePumpStart);
fourHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), four, nowStrLong, prefix, suffix, pressurePumpStart); fourHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), four, nowStrLong, prefix, suffix, pressurePumpStart);
oneHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), one, nowStrLong, prefix, suffix, pressurePumpStart); oneHourEntity = iotFeign.selectList(getAppKey(), getProduct(), getToken(), one, nowStrLong, prefix, suffix, pressurePumpStart);
start = iotFeign.selectOne(getAppKey(), getProduct(), getToken(), "1", prefix, suffix, "true", pressurePumpStart);
stop = iotFeign.selectOne(getAppKey(), getProduct(), getToken(), "1", prefix, suffix, "flase", pressurePumpStart);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -340,53 +364,90 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -340,53 +364,90 @@ public class SupervisionConfigureController extends AbstractBaseController {
int num = collect.size(); int num = collect.size();
item.put("oneHourStartNum", num); item.put("oneHourStartNum", num);
} }
if (200 == start.getStatus() && !ObjectUtils.isEmpty(start.getResult())) {
String json1 = JSON.toJSONString(start.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1);
List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey("time"))).collect(Collectors.toList());
item.put("start", collect.get(0).get("time"));
}
if (200 == stop.getStatus() && !ObjectUtils.isEmpty(stop.getResult())) {
String json1 = JSON.toJSONString(stop.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1);
List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey("time"))).collect(Collectors.toList());
item.put("stop", collect.get(0).get("time"));
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long nowDateTime = new Date().getTime();//当前时间戳 long nowDateTime = new Date().getTime();//当前时间戳
Map<String, String> stateMap = fireFightingSystemMapper.queryPressureNowStateBySpecificId((Long) item.get("id"));
ids.add((Long) item.get("id"));
boolean time = true; boolean time = true;
if (!ObjectUtils.isEmpty(stateMap) && stateMap.containsKey("update_date") && stateMap.containsKey("equipment_index_name")) { String startTime = null;
item.put("update_time", String.valueOf(stateMap.get("update_date")).replaceAll("T", " ")); String stopTime = null;
if (!ObjectUtils.isEmpty(stateMap.get("value"))) { Long start_time = 0L;
item.put("equipment_index_name", stateMap.get("equipment_index_name")); Long stop_time = 0L;
Date startDate = null;
Date stopDate = null;
if (ObjectUtils.isEmpty(item.get("start")) && ObjectUtils.isEmpty(item.get("stop"))) {
item.put("equipment_index_name", "无信号");
} else {
if (!ObjectUtils.isEmpty(item.get("start"))) {
startTime = item.get("start").toString().substring(0, 19).replace("T", " ");
startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTime), +8);
startTimeList.add(startDate.getTime());
start_time = startDate.getTime();
item.put("startTime", startDate);
} else { } else {
item.put("equipment_index_name", "无信号"); item.put("startTime", 0);
} }
if ("启动".equals(item.get("equipment_index_name"))) { if (!ObjectUtils.isEmpty(item.get("stop"))) {
long update_time = 0L; stopTime = item.get("stop").toString().substring(0, 19).replace("T", " ");
try { stopDate = DateUtils.dateAddHours(DateUtils.longStr2Date(stopTime), +8);
update_time = sdf.parse(String.valueOf(stateMap.get("update_date")).replaceAll("T", " ")).getTime(); stopTimeList.add(stopDate.getTime());
} catch (ParseException e) { stop_time = stopDate.getTime();
throw new RuntimeException(e); item.put("stopTime", stopDate);
} } else {
long res = nowDateTime - update_time; item.put("stopTime", 0);
long diffMinute = res / 1000 / 60; }
if (diffMinute > 5) { if (!"0".equals(item.get("startTime"))) {
time = false; if ("0".equals(item.get("stopTime"))) {
long res = nowDateTime - start_time;
long diffMinute = res / 1000 / 60;
if (diffMinute > 5) {
time = false;
}
item.put("upTime", diffMinute);
item.put("equipment_index_name", "启动");
item.put("update_time", startDate);
} else {
String startOrStop = start_time - stop_time > 0 ? "start" : " stop";
if ("start".equals(startOrStop)) {
long res = nowDateTime - start_time;
long diffMinute = res / 1000 / 60;
if (diffMinute > 5) {
time = false;
}
item.put("upTime", diffMinute);
item.put("equipment_index_name", "启动");
item.put("update_time", startDate);
} else {
item.put("upTime", 0);
item.put("equipment_index_name", "停止");
item.put("update_time", stopDate);
}
} }
item.put("upTime", diffMinute); } else {
item.put("upTime", 0);
} }
} }
item.put("stateDesc", Integer.parseInt(String.valueOf(item.get("isAlarm"))) == 0 && time ? "正常" : "异常"); item.put("stateDesc", Integer.parseInt(String.valueOf(item.get("isAlarm"))) == 0 && time ? "正常" : "异常");
return item; return item;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
List<Map<String, Object>> stateMap = fireFightingSystemMapper.queryStartAndStopBySpecificId(ids); List<Long> startCollect = startTimeList.stream().sorted(Comparator.reverseOrder()).limit(1).collect(Collectors.toList());
long diffMinute = 0L; List<Long> stopCollect = stopTimeList.stream().sorted(Comparator.reverseOrder()).limit(1).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(stateMap)) { long res = 0L;
String startTime = stateMap.get(0).get("update_date").toString(); if (startCollect.size() > 0 && stopCollect.size() > 0) {
String endTime = stateMap.get(1).get("update_date").toString(); res = Math.abs(startCollect.get(0) - stopCollect.get(0));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long start = 0L;
long end = 0L;
try {
start = sdf.parse(startTime.replaceAll("T", " ")).getTime();
end = sdf.parse(endTime.replaceAll("T", " ")).getTime();
} catch (ParseException e) {
throw new RuntimeException(e);
}
long res = Math.abs(start - end);
diffMinute = res / 1000 / 60;
} }
long diffMinute = 0L;
diffMinute = res / 1000 / 60;
long finalDiffMinute = diffMinute; long finalDiffMinute = diffMinute;
pressurePumpInfo.getRecords().stream( pressurePumpInfo.getRecords().stream(
).map(item -> { ).map(item -> {
...@@ -515,7 +576,8 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -515,7 +576,8 @@ public class SupervisionConfigureController extends AbstractBaseController {
map.put("name", pressurePump.get("name")); map.put("name", pressurePump.get("name"));
String json1 = JSON.toJSONString(mounthEntity.getResult()); String json1 = JSON.toJSONString(mounthEntity.getResult());
List<Map<String, String>> list = (List<Map<String, String>>) JSONArray.parse(json1); List<Map<String, String>> list = (List<Map<String, String>>) JSONArray.parse(json1);
List<Map<String, String>> collect = list.stream().filter(t -> (t.containsKey("time") && t.get("time").substring(0, 10).equals(item.get("date")))).collect(Collectors.toList()); List<Map<String, String>> collect = list.stream().filter(t -> (t.containsKey("time") && t.get("time").substring(0, 10).equals(item.get("date"))) && ((t.containsKey(pressurePumpStart) && t.get(pressurePumpStart).equals("true"))
|| (t.containsKey(pressurePumpStart) && t.get(pressurePumpStart).equals("false")))).collect(Collectors.toList());
map.put("value", collect.size()); map.put("value", collect.size());
map.put("id", pressurePump.get("id")); map.put("id", pressurePump.get("id"));
if (item.containsKey("yData")) { if (item.containsKey("yData")) {
...@@ -540,16 +602,74 @@ public class SupervisionConfigureController extends AbstractBaseController { ...@@ -540,16 +602,74 @@ public class SupervisionConfigureController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "稳压泵详情", produces = "application/json;charset=UTF-8", notes = "稳压泵详情") @ApiOperation(httpMethod = "GET", value = "稳压泵详情", produces = "application/json;charset=UTF-8", notes = "稳压泵详情")
public ResponseModel selectPressureDetails(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) { public ResponseModel selectPressureDetails(@RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
ReginParams reginParams = getSelectedOrgInfo(); if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity(); ReginParams reginParams = getSelectedOrgInfo();
if (!ValidationUtil.isEmpty(personIdentity)) { ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
bizOrgCode = personIdentity.getBizOrgCode(); if (!ValidationUtil.isEmpty(personIdentity)) {
if (bizOrgCode == null) { bizOrgCode = personIdentity.getBizOrgCode();
return CommonResponseUtil.success(null); if (bizOrgCode == null) {
return CommonResponseUtil.success(null);
}
} }
} }
List<Map<String, Object>> pressurePumps = fireFightingSystemMapper.selectPressureDetails(bizOrgCode); List<Map<String, Object>> pressurePumpInfo = fireFightingSystemMapper.selectAllPressurePumpInfo(bizOrgCode);
return CommonResponseUtil.success(pressurePumps); pressurePumpInfo.stream().map(item -> {
String prefix = null;
String suffix = null;
String iotCode = item.get("iot_code").toString();
if (iotCode.length() > 8) {
prefix = iotCode.substring(0, 8);
suffix = iotCode.substring(8);
} else {
throw new BadRequest("装备物联编码错误,请确认!");
}
ResponseModel start = null;
ResponseModel stop = null;
try {
start = iotFeign.selectOne(getAppKey(), getProduct(), getToken(), "1", prefix, suffix, "true", pressurePumpStart);
stop = iotFeign.selectOne(getAppKey(), getProduct(), getToken(), "1", prefix, suffix, "flase", pressurePumpStart);
} catch (Exception e) {
e.printStackTrace();
}
if (200 == start.getStatus() && !ObjectUtils.isEmpty(start.getResult())) {
String json1 = JSON.toJSONString(start.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1);
List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey("time"))).collect(Collectors.toList());
if (collect.size() > 0) {
String startTime = collect.get(0).get("time").substring(0, 19).replace("T", " ");
Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTime), +8);
item.put("startTime", startDate);
} else {
item.put("startTime", "");
}
}
if (200 == stop.getStatus() && !ObjectUtils.isEmpty(stop.getResult())) {
String json1 = JSON.toJSONString(stop.getResult());
List<Map<String, String>> listObject1 = (List<Map<String, String>>) JSONArray.parse(json1);
List<Map<String, String>> collect = listObject1.stream().filter(t -> (t.containsKey("time"))).collect(Collectors.toList());
if (collect.size() > 0) {
String stopTime = collect.get(0).get("time").substring(0, 19).replace("T", " ");
Date stopDate = DateUtils.dateAddHours(DateUtils.longStr2Date(stopTime), +8);
item.put("stopTime", stopDate);
} else {
item.put("stopTime", "");
}
}
return item;
}).collect(Collectors.toList());
return CommonResponseUtil.success(pressurePumpInfo);
// ReginParams reginParams = getSelectedOrgInfo();
// ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
// if (!ValidationUtil.isEmpty(personIdentity)) {
// bizOrgCode = personIdentity.getBizOrgCode();
// if (bizOrgCode == null) {
// return CommonResponseUtil.success(null);
// }
// }
// List<Map<String, Object>> pressurePumps = fireFightingSystemMapper.selectPressureDetails(bizOrgCode);
// return CommonResponseUtil.success(pressurePumps);
} }
......
package com.yeejoin.equipmanage.fegin; package com.yeejoin.equipmanage.fegin;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -25,4 +26,18 @@ public interface IotFeign { ...@@ -25,4 +26,18 @@ public interface IotFeign {
@RequestParam(value = "deviceName") String deviceName, @RequestParam(value = "deviceName") String deviceName,
@RequestParam(required = false, value = "fieldKey") String fieldKey); @RequestParam(required = false, value = "fieldKey") String fieldKey);
@RequestMapping(value = "v1/livedata/common/top", method = RequestMethod.GET, consumes = "application/json")
ResponseModel selectOne(
@RequestHeader("appKey") String appKey,
@RequestHeader("product") String product,
@RequestHeader("token") String token,
@RequestParam(value = "top") String top,
@RequestParam(value = "productKey") String productKey,
@RequestParam(value = "deviceName") String deviceName,
@RequestParam("FHS_FirePump_RunStatus") String key,
@RequestParam(required = false, value = "fieldKey") String fieldKey);
} }
...@@ -632,7 +632,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -632,7 +632,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
String selectEquipSystemType(String code); String selectEquipSystemType(String code);
Map<String, Object> getWaterlevelUnit(); Map<String, Object> getWaterlevelUnit(@Param("equipmentSpecificId") String equipmentSpecificId, @Param("equipmentIndexKey") String equipmentIndexKey);
Map<String, Object> getStationConnectStatus(); Map<String, Object> getStationConnectStatus();
......
package com.yeejoin.equipmanage.service.impl; package com.yeejoin.equipmanage.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.equipmanage.common.enums.IndexStatusEnum;
import com.yeejoin.equipmanage.common.utils.DateUtils; import com.yeejoin.equipmanage.common.utils.DateUtils;
import com.yeejoin.equipmanage.common.utils.StringUtil;
import com.yeejoin.equipmanage.common.utils.UnitTransformUtil;
import com.yeejoin.equipmanage.mapper.EmergencyMapper; import com.yeejoin.equipmanage.mapper.EmergencyMapper;
import com.yeejoin.equipmanage.service.IEmergencyService; import com.yeejoin.equipmanage.service.IEmergencyService;
import org.apache.commons.compress.utils.Lists; import org.apache.commons.compress.utils.Lists;
...@@ -51,17 +54,19 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -51,17 +54,19 @@ public class EmergencyServiceImpl implements IEmergencyService {
@Override @Override
public List<Map<String, Object>> getCAFSWaterTankInfo() { public List<Map<String, Object>> getCAFSWaterTankInfo() {
List<Map<String, Object>> list = emergencyMapper.getCAFSWaterTankInfo(); List<Map<String, Object>> list = emergencyMapper.getCAFSWaterTankInfo();
// List<Map<String, Object>> res = new ArrayList(); if (0 < list.size()) {
// if (0 < list.size()) { for (Map<String, Object> m : list) {
// list.forEach(x -> { Map<String, Object> transResult = UnitTransformUtil.transformValues(String.valueOf(m.get("value")),
// Map<String, Object> map = new HashMap<>(); String.valueOf(m.get("unit")), String.valueOf(m.get("minLevel")), String.valueOf(m.get("maxLevel")));
// map.put("key", x.get("specificId")); m.put("value", transResult.get("nowValue"));
// map.put("code", x.get("code")); if (StringUtil.isNotEmpty(IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))))) {
// map.put("name", x.get("name")); m.put("statusDesc", IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))).getDescribe1());
// map.put("value", x.get("specificId")); } else {
// map.put("key", x.get("specificId")); m.put("statusDesc", "--");
// }); }
// } m.put("sxyl", transResult.get("abs"));
}
}
return Optional.ofNullable(list).orElse(Lists.newArrayList()); return Optional.ofNullable(list).orElse(Lists.newArrayList());
} }
...@@ -82,7 +87,22 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -82,7 +87,22 @@ public class EmergencyServiceImpl implements IEmergencyService {
@Override @Override
public Page<Map<String, Object>> selectFoamTank(Page<Map<String, Object>> page) { public Page<Map<String, Object>> selectFoamTank(Page<Map<String, Object>> page) {
return emergencyMapper.selectFoamTank(page); Page<Map<String, Object>> page1 = emergencyMapper.selectFoamTank(page);
List<Map<String, Object>> res = page1.getRecords();
if (0 < res.size()) {
for (Map<String, Object> m : res) {
Map<String, Object> transResult = UnitTransformUtil.transformValues(String.valueOf(m.get("nowLevel")),
String.valueOf(m.get("unit")), String.valueOf(m.get("minLevel")), String.valueOf(m.get("maxLevel")));
m.put("nowLevel", transResult.get("nowValue"));
if (StringUtil.isNotEmpty(IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))))) {
m.put("status", IndexStatusEnum.getEnumByKey(String.valueOf(transResult.get("status"))).getDescribe1());
} else {
m.put("status", "--");
}
m.put("abs", transResult.get("abs"));
}
}
return page1;
} }
@Override @Override
......
...@@ -1577,6 +1577,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1577,6 +1577,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
equipmentSpecificIndex.setIsAlarm(index.getIsAlarm()); equipmentSpecificIndex.setIsAlarm(index.getIsAlarm());
equipmentSpecificIndex.setEmergencyLevel(index.getEmergencyLevel()); equipmentSpecificIndex.setEmergencyLevel(index.getEmergencyLevel());
equipmentSpecificIndex.setEmergencyLevelDescribe(index.getEmergencyLevelDescribe()); equipmentSpecificIndex.setEmergencyLevelDescribe(index.getEmergencyLevelDescribe());
equipmentSpecificIndex.setUnit(index.getUnit());
equipmentSpecificIndices.add(equipmentSpecificIndex); equipmentSpecificIndices.add(equipmentSpecificIndex);
}); });
} }
......
...@@ -84,15 +84,9 @@ public class DocLibraryResource { ...@@ -84,15 +84,9 @@ public class DocLibraryResource {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "知识库卡片信息") @ApiOperation(value = "知识库卡片信息")
@RequestMapping(value = "/card", method = RequestMethod.GET) @RequestMapping(value = "/card", method = RequestMethod.GET)
public ResponseModel<Object> queryDocCard(HttpServletRequest request, public ResponseModel<Object> queryDocCard( @RequestParam(value = "id", required = false) Long id,
@RequestParam(value = "offset") Integer offset, @RequestParam(value = "ids", required = false) List<Long> ids) {
@RequestParam(value = "end") Integer end, return ResponseHelper.buildResponse(docLibraryService.queryCardList(id , ids));
@RequestParam(value = "filterByCollection") String filterByCollection,
@RequestParam(value = "directoryId", required = false) Long directoryId,
@RequestParam(value = "docTitle", required = false) String docTitle,
@RequestParam(value = "createTimeLeft", required = false) String createTimeLeft,
@RequestParam(value = "createTimeRight", required = false) String createTimeRight) {
return ResponseHelper.buildResponse(docLibraryService.queryCardList());
} }
/** /**
......
...@@ -29,7 +29,7 @@ public interface DocContentMapper extends BaseMapper<KnowledgeDocContent> { ...@@ -29,7 +29,7 @@ public interface DocContentMapper extends BaseMapper<KnowledgeDocContent> {
List<Map<String,Object>> queryDocBaseInfoList(Map<String, Object> paramMap); List<Map<String,Object>> queryDocBaseInfoList(Map<String, Object> paramMap);
List<Map<String,Object>> queryDocCardList(); List<Map<String,Object>> queryDocCardList(@Param("id")Long id, @Param("ids") List<Long> ids);
List<Map<String,Object>> queryCardCount(); List<Map<String,Object>> queryCardCount();
......
...@@ -181,13 +181,21 @@ public class DocLibraryService { ...@@ -181,13 +181,21 @@ public class DocLibraryService {
return page; return page;
} }
public Map<String,Object> queryCardList(){ public Map<String,Object> queryCardList(Long id, List<Long> ids){
List<Map<String, Object>> content = docContentService.getBaseMapper().queryDocCardList(); List<Map<String, Object>> content = docContentService.getBaseMapper().queryDocCardList(id, ids);
List<Map<String, Object>> countMap = docContentService.getBaseMapper().queryCardCount(); List<Map<String, Object>> countMap = docContentService.getBaseMapper().queryCardCount();
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>(2);
resultMap.put("content",content); resultMap.put("content",content);
countMap.forEach(e->resultMap.put(e.get("directoryName").toString(),e.get("num"))); List<Map<String, Object>> list = new ArrayList<>();
return resultMap; countMap.forEach(e-> {
Map<String, Object> map = new HashMap<>(2);
map.put("value",e.get("num"));
map.put("name",e.get("categoryName"));
map.put("id",e.get("id"));
list.add(map);
});
resultMap.put("count", list);
return resultMap;
} }
......
...@@ -108,7 +108,7 @@ equipment.scrap.day=30 ...@@ -108,7 +108,7 @@ equipment.scrap.day=30
equipment.scrap.cron=0 0 9 * * ? equipment.scrap.cron=0 0 9 * * ?
# 稳压泵启动信号 # 稳压泵启动信号
equipment.pressurepump.start=FHS_PressurePump_Start equipment.pressurepump.start=FHS_FirePump_RunStatus
# 稳压泵停止信号 # 稳压泵停止信号
equipment.pressurepump.stop=FHS_PressurePump_Stop equipment.pressurepump.stop=FHS_PressurePump_Stop
......
...@@ -553,7 +553,7 @@ ...@@ -553,7 +553,7 @@
<sql> <sql>
ALTER TABLE `wl_equipment` ADD COLUMN `shbz_img` varchar(255) NULL COMMENT '四横八纵图片' AFTER `img`;</sql> ALTER TABLE `wl_equipment` ADD COLUMN `shbz_img` varchar(255) NULL COMMENT '四横八纵图片' AFTER `img`;</sql>
</changeSet> </changeSet>
<changeSet author="gaojianqiang" id="20230113-01"> <changeSet author="gaojianqiang" id="20230113-02">
<preConditions onFail="MARK_RAN"> <preConditions onFail="MARK_RAN">
<columnExists tableName="wl_equipment" columnName="shbz_img"/> <columnExists tableName="wl_equipment" columnName="shbz_img"/>
</preConditions> </preConditions>
...@@ -576,72 +576,72 @@ ...@@ -576,72 +576,72 @@
-- ---------------------------- -- ----------------------------
-- Records of equipment_icon -- Records of equipment_icon
-- ---------------------------- -- ----------------------------
INSERT INTO `equipment_icon` VALUES ('1392361049260539906', '自动喷水灭火系统', 'FHS-消防泵', '920106007GV44', 'upload/state/dcfc/viewicon/firePump.png', 46); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361070315945986', '排油注氮系统', 'ONL-交流电源', '921002000JK44', 'upload/state/dcfc/viewicon/jiaoLiuDianYuan.png', 1);
INSERT INTO `equipment_icon` VALUES ('1392361051122810882', '火灾自动报警系统', 'FAS-烟雾报警器', '920402009EM44', 'upload/state/dcfc/viewicon/ganYanTanCeQi.png', 44); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1578945741864742914', '排油注氮系统', '消防水箱', '93060600HQK44', 'upload/state/dcfc/viewicon/fireShuiXiang.png', 2);
INSERT INTO `equipment_icon` VALUES ('1392361052318187522', '火灾自动报警系统', 'FAS-手动报警器', '920404002PU44', 'upload/state/dcfc/viewicon/shouDongBaoJingQi.png', 43); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1417377349053444098', '排油注氮系统', 'ONL-智能终端', '92101800NKO44', 'upload/state/dcfc/viewicon/zhunDuan.png', 3);
INSERT INTO `equipment_icon` VALUES ('1392361052926361602', '火灾自动报警系统', 'FAS-空气采样探测器', '920405002O544', NULL, 52); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361071851061250', '排油注氮系统', 'ONL-排油注氮装置', '92100500RIP44', 'upload/state/dcfc/viewicon/paiyouzhudanzhuangzhi.png', 4);
INSERT INTO `equipment_icon` VALUES ('1392361054348230658', '火灾自动报警系统', 'FAS-感温电缆', '92040700PEM44', 'upload/state/dcfc/viewicon/ganWenDianLan.png', 34); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361070907342850', '排油注氮系统', 'ONL-直流电源', '92100300MNL44', 'upload/state/dcfc/viewicon/zhiLiuDianYuan.png', 5);
INSERT INTO `equipment_icon` VALUES ('1392361056457965569', '火灾自动报警系统', 'FAS-声光报警器', '92041000LCW44', 'upload/state/dcfc/viewicon/shengGuangBaoJingQi.png', 41); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361071419047937', '排油注氮系统', 'ONL-排油阀', '92100400VWE44', 'upload/state/dcfc/viewicon/benTiPaiYouFa.png', 6);
INSERT INTO `equipment_icon` VALUES ('1392361057196163073', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-主机', '92030100TGX44', 'upload/state/dcfc/viewicon/zhuji.png', 30); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1404693507742093314', '排油注氮系统', 'ONL-采集模块', '92101400P3N44', 'upload/state/dcfc/viewicon/caiJiMuKuai.png', 7);
INSERT INTO `equipment_icon` VALUES ('1392361057749811202', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-炮阀', '92030200DOD44', 'upload/state/dcfc/viewicon/paofa.png', 11); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361063550533634', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-交换机', '92031300WFJ44', 'upload/state/dcfc/viewicon/jiaoHuanji.png', 8);
INSERT INTO `equipment_icon` VALUES ('1392361058299265025', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-切换阀', '92030300DI444', 'upload/state/dcfc/viewicon/qieHuanFa.png', 17); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361062007029761', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-设备间', '92031000EXB44', 'upload/state/dcfc/viewicon/sheBeiJian.png', 9);
INSERT INTO `equipment_icon` VALUES ('1392361058894856194', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-卷帘门', '92030400FTV44', 'upload/state/dcfc/viewicon/juanLianMen.png', 12); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361061012979713', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-控制柜', '92030800K2R44', 'upload/state/dcfc/viewicon/kongZhiGui.png', 10);
INSERT INTO `equipment_icon` VALUES ('1392361059477864450', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-产生装置', '92030500MG644', 'upload/state/dcfc/viewicon/chanshengzhuangzhi.png', 13); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361057749811202', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-炮阀', '92030200DOD44', 'upload/state/dcfc/viewicon/paofa.png', 11);
INSERT INTO `equipment_icon` VALUES ('1392361059951820801', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-泡沫泵', '92030600QO344', 'upload/state/dcfc/viewicon/paoMoPump.png', 18); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361058894856194', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-卷帘门', '92030400FTV44', 'upload/state/dcfc/viewicon/juanLianMen.png', 12);
INSERT INTO `equipment_icon` VALUES ('1392361060509663233', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-空压机', '92030700SFT44', 'upload/state/dcfc/viewicon/kongYaMachine.png', 19); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361059477864450', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-产生装置', '92030500MG644', 'upload/state/dcfc/viewicon/chanshengzhuangzhi.png', 13);
INSERT INTO `equipment_icon` VALUES ('1392361061012979713', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-控制柜', '92030800K2R44', 'upload/state/dcfc/viewicon/kongZhiGui.png', 10); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361064620081153', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-电源', '92031500Z9E44', 'upload/state/dcfc/viewicon/power.png', 14);
INSERT INTO `equipment_icon` VALUES ('1392361061486936066', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-电源柜', '92030900KYD44', 'upload/state/dcfc/viewicon/pwoerGui.png', 16); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361065161146370', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-AD通道', '92031600TQ244', 'upload/state/dcfc/viewicon/tongDao.png', 15);
INSERT INTO `equipment_icon` VALUES ('1392361062007029761', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-设备间', '92031000EXB44', 'upload/state/dcfc/viewicon/sheBeiJian.png', 9); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361061486936066', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-电源柜', '92030900KYD44', 'upload/state/dcfc/viewicon/pwoerGui.png', 16);
INSERT INTO `equipment_icon` VALUES ('1392361062543900673', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-控制按钮', '92031100HQL44', 'upload/state/dcfc/viewicon/kongZhiButton.png', 20); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361058299265025', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-切换阀', '92030300DI444', 'upload/state/dcfc/viewicon/qieHuanFa.png', 17);
INSERT INTO `equipment_icon` VALUES ('1392361063101743105', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-插件', '92031200DMT44', 'upload/state/dcfc/viewicon/chaJian.png', 29); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361059951820801', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-泡沫泵', '92030600QO344', 'upload/state/dcfc/viewicon/paoMoPump.png', 18);
INSERT INTO `equipment_icon` VALUES ('1392361063550533634', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-交换机', '92031300WFJ44', 'upload/state/dcfc/viewicon/jiaoHuanji.png', 8); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361060509663233', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-空压机', '92030700SFT44', 'upload/state/dcfc/viewicon/kongYaMachine.png', 19);
INSERT INTO `equipment_icon` VALUES ('1392361064016101378', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-光纤', '92031400GMT44', 'upload/state/dcfc/viewicon/guangxian.png', 32); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361062543900673', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-控制按钮', '92031100HQL44', 'upload/state/dcfc/viewicon/kongZhiButton.png', 20);
INSERT INTO `equipment_icon` VALUES ('1392361064620081153', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-电源', '92031500Z9E44', 'upload/state/dcfc/viewicon/power.png', 14); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361065656074242', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-断路器', '92031700EGW44', 'upload/state/dcfc/viewicon/duanLuQi.png', 21);
INSERT INTO `equipment_icon` VALUES ('1392361065161146370', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-AD通道', '92031600TQ244', 'upload/state/dcfc/viewicon/tongDao.png', 15); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1417377350970241025', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-直流系统', '92032400MWX44', 'upload/state/dcfc/viewicon/zhiliuSystem.png', 22);
INSERT INTO `equipment_icon` VALUES ('1392361065656074242', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-断路器', '92031700EGW44', 'upload/state/dcfc/viewicon/duanLuQi.png', 21); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392662055093518337', '消防给水及消火栓系统', 'FHS-稳压泵', '92010800KAL44', 'upload/state/dcfc/viewicon/wenYaBeng.png', 23);
INSERT INTO `equipment_icon` VALUES ('1392361066734010370', '其他系统', 'CAFS-泡沫罐', '92031900INJ44', NULL, 64); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1401866678450778114', '消防给水及消火栓系统', 'FHS-液位探测器', '92011100BIK44', 'upload/state/dcfc/viewicon/yeWeiDetecor.png', 24);
INSERT INTO `equipment_icon` VALUES ('1392361070315945986', '排油注氮系统', 'ONL-交流电源', '921002000JK44', 'upload/state/dcfc/viewicon/jiaoLiuDianYuan.png', 1); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1418444533010169858', '消防给水及消火栓系统', '消火栓', '31050000ZLF44', 'upload/state/dcfc/viewicon/fireMachine.png', 25);
INSERT INTO `equipment_icon` VALUES ('1392361070907342850', '排油注氮系统', 'ONL-直流电源', '92100300MNL44', 'upload/state/dcfc/viewicon/zhiLiuDianYuan.png', 5); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1418466180761026562', '压缩空气泡沫灭火系统(CAFS)', '压缩空气泡沫灭火系统', '92030000WEW44', 'upload/state/dcfc/viewicon/yasuokongqi.png', 26);
INSERT INTO `equipment_icon` VALUES ('1392361071419047937', '排油注氮系统', 'ONL-排油阀', '92100400VWE44', 'upload/state/dcfc/viewicon/benTiPaiYouFa.png', 6); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1418505479128817666', '消防给水及消火栓系统', '消防供水设施', '92010000S0F44', 'upload/state/dcfc/viewicon/gongshuiSheShi.png', 27);
INSERT INTO `equipment_icon` VALUES ('1392361071851061250', '排油注氮系统', 'ONL-排油注氮装置', '92100500RIP44', 'upload/state/dcfc/viewicon/paiyouzhudanzhuangzhi.png', 4); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1527227300964233217', '消防给水及消火栓系统', '消火栓', '93060400CQX44', 'upload/state/dcfc/viewicon/fireMachine.png', 28);
INSERT INTO `equipment_icon` VALUES ('1392662028300304385', '自动喷水灭火系统', 'WSS-雨淋阀', '92130300BH644', NULL, 55); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361063101743105', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-插件', '92031200DMT44', 'upload/state/dcfc/viewicon/chaJian.png', 29);
INSERT INTO `equipment_icon` VALUES ('1392662045933158401', '火灾自动报警系统', 'SCS-防火阀', '92160200J4244', NULL, 53); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361057196163073', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-主机', '92030100TGX44', 'upload/state/dcfc/viewicon/zhuji.png', 30);
INSERT INTO `equipment_icon` VALUES ('1392662048705593345', '其他系统', 'ES-电梯', '92170100NKI44', NULL, 66); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1401866678975066113', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-CAFS消防炮', '92032200BUX44', 'upload/state/dcfc/viewicon/CAFSGun.png', 31);
INSERT INTO `equipment_icon` VALUES ('1392662052493049858', '自动喷水灭火系统', 'FFS-雨淋蝶阀', '92110900ATW44', NULL, 54); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361064016101378', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-光纤', '92031400GMT44', 'upload/state/dcfc/viewicon/guangxian.png', 32);
INSERT INTO `equipment_icon` VALUES ('1392662054481149954', '其他系统', 'FHS-消防水池装置', '92010700SHY44', NULL, 63); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1401866673925124097', '火灾自动报警系统', 'FAS-感温式火灾探测器', '92041200KNU44', 'upload/state/dcfc/viewicon/ganYanTanCeQi.png', 33);
INSERT INTO `equipment_icon` VALUES ('1392662055093518337', '消防给水及消火栓系统', 'FHS-稳压泵', '92010800KAL44', 'upload/state/dcfc/viewicon/wenYaBeng.png', 23); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361054348230658', '火灾自动报警系统', 'FAS-感温电缆', '92040700PEM44', 'upload/state/dcfc/viewicon/ganWenDianLan.png', 34);
INSERT INTO `equipment_icon` VALUES ('1401866673925124097', '火灾自动报警系统', 'FAS-感温式火灾探测器', '92041200KNU44', 'upload/state/dcfc/viewicon/ganYanTanCeQi.png', 33); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1417377347702878209', '火灾自动报警系统', 'FAS-复位电源', '92042300YBA44', 'upload/state/dcfc/viewicon/fuWeiPower.png', 35);
INSERT INTO `equipment_icon` VALUES ('1401866675300855810', '火灾自动报警系统', 'FAS-备用设备', '92041800CK844', NULL, 50); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1418462802521784321', '火灾自动报警系统', '火灾自动报警系统', '92040000KPO44', 'upload/state/dcfc/viewicon/fireAutoAlarm.png', 36);
INSERT INTO `equipment_icon` VALUES ('1401866678102650882', '自动喷水灭火系统', 'FHS-压力开关', '92010900K8G44', NULL, 45); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1418464225015791617', '自动喷水灭火系统', '消防专用电话', '92120000GYI44', 'upload/state/dcfc/viewicon/fireMobile.png', 37);
INSERT INTO `equipment_icon` VALUES ('1401866678308171778', '其他系统', 'FHS-管网压力探测器', '92011000T5Q44', 'upload/state/dcfc/viewicon/guanWangYaLi.png', 65); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1418465438318886913', '自动喷水灭火系统', '雨淋阀', '92110900V9B44', 'upload/state/dcfc/viewicon/yuLinFa.png', 38);
INSERT INTO `equipment_icon` VALUES ('1401866678450778114', '消防给水及消火栓系统', 'FHS-液位探测器', '92011100BIK44', 'upload/state/dcfc/viewicon/yeWeiDetecor.png', 24); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1417377345773498370', '火灾自动报警系统', 'FAS-强切设备', '92042200EKM44', 'upload/state/dcfc/viewicon/qiangQieShebei.png', 39);
INSERT INTO `equipment_icon` VALUES ('1401866678975066113', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-CAFS消防炮', '92032200BUX44', 'upload/state/dcfc/viewicon/CAFSGun.png', 31); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1418466508642353153', '自动喷水灭火系统', '自动喷水灭火系统', '92130000YCG44', 'upload/state/dcfc/viewicon/autoPenShui.png', 40);
INSERT INTO `equipment_icon` VALUES ('1401866680124305409', '火灾自动报警系统', 'AIRCS-空调', '92200100VAC44', NULL, 48); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361056457965569', '火灾自动报警系统', 'FAS-声光报警器', '92041000LCW44', 'upload/state/dcfc/viewicon/shengGuangBaoJingQi.png', 41);
INSERT INTO `equipment_icon` VALUES ('1404693507742093314', '排油注氮系统', 'ONL-采集模块', '92101400P3N44', 'upload/state/dcfc/viewicon/caiJiMuKuai.png', 7); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1418822147562434562', '自动喷水灭火系统', '消防水池', '92010000XBB44', 'upload/state/dcfc/viewicon/xiaoFangShuiChi.png', 42);
INSERT INTO `equipment_icon` VALUES ('1404693508211855361', '火灾自动报警系统', 'FAS-感光式火灾探测器', '92041900GNS44', 'upload/state/dcfc/viewicon/ziWaiHuoYanTanCeQi.png', 49); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361052318187522', '火灾自动报警系统', 'FAS-手动报警器', '920404002PU44', 'upload/state/dcfc/viewicon/shouDongBaoJingQi.png', 43);
INSERT INTO `equipment_icon` VALUES ('1404693508639674370', '火灾自动报警系统', 'FAS-模块', '92042000YVN44', NULL, 51); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361051122810882', '火灾自动报警系统', 'FAS-烟雾报警器', '920402009EM44', 'upload/state/dcfc/viewicon/ganYanTanCeQi.png', 44);
INSERT INTO `equipment_icon` VALUES ('1404693512771063809', '其他系统', 'FPMS-配电开关', '922206009JO44', NULL, 60); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1401866678102650882', '自动喷水灭火系统', 'FHS-压力开关', '92010900K8G44', 'upload/state/dcfc/viewicon/yaLiKaiGuan.png', 45);
INSERT INTO `equipment_icon` VALUES ('1417377345773498370', '火灾自动报警系统', 'FAS-强切设备', '92042200EKM44', 'upload/state/dcfc/viewicon/qiangQieShebei.png', 39); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361049260539906', '自动喷水灭火系统', 'FHS-消防泵', '920106007GV44', 'upload/state/dcfc/viewicon/firePump.png', 46);
INSERT INTO `equipment_icon` VALUES ('1417377347702878209', '火灾自动报警系统', 'FAS-复位电源', '92042300YBA44', 'upload/state/dcfc/viewicon/fuWeiPower.png', 35); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1417377352845094913', '火灾自动报警系统', 'FAS-切电设备', '92042400X2V44', 'upload/state/dcfc/viewicon/cutPower.png', 47);
INSERT INTO `equipment_icon` VALUES ('1417377349053444098', '排油注氮系统', 'ONL-智能终端', '92101800NKO44', 'upload/state/dcfc/viewicon/zhunDuan.png', 3); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1401866680124305409', '火灾自动报警系统', 'AIRCS-空调', '92200100VAC44', 'upload/state/dcfc/viewicon/airCondition.png', 48);
INSERT INTO `equipment_icon` VALUES ('1417377350970241025', '压缩空气泡沫灭火系统(CAFS)', 'CAFS-直流系统', '92032400MWX44', 'upload/state/dcfc/viewicon/zhiliuSystem.png', 22); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1404693508211855361', '火灾自动报警系统', 'FAS-感光式火灾探测器', '92041900GNS44', 'upload/state/dcfc/viewicon/ziWaiHuoYanTanCeQi.png', 49);
INSERT INTO `equipment_icon` VALUES ('1417377352845094913', '火灾自动报警系统', 'FAS-切电设备', '92042400X2V44', NULL, 47); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1401866675300855810', '火灾自动报警系统', 'FAS-备用设备', '92041800CK844', 'upload/state/dcfc/viewicon/spareEquipment.png', 50);
INSERT INTO `equipment_icon` VALUES ('1418444533010169858', '消防给水及消火栓系统', '消火栓', '31050000ZLF44', 'upload/state/dcfc/viewicon/fireMachine.png', 25); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1404693508639674370', '火灾自动报警系统', 'FAS-模块', '92042000YVN44', 'upload/state/dcfc/viewicon/module.png', 51);
INSERT INTO `equipment_icon` VALUES ('1418445233194696705', '其他系统', '灭火器', '31040000PV244', NULL, 61); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361052926361602', '火灾自动报警系统', 'FAS-空气采样探测器', '920405002O544', 'upload/state/dcfc/viewicon/AirSamplingDetector.png', 52);
INSERT INTO `equipment_icon` VALUES ('1418462802521784321', '火灾自动报警系统', '火灾自动报警系统', '92040000KPO44', 'upload/state/dcfc/viewicon/fireAutoAlarm.png', 36); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392662045933158401', '火灾自动报警系统', 'SCS-防火阀', '92160200J4244', 'upload/state/dcfc/viewicon/fireDamper.png', 53);
INSERT INTO `equipment_icon` VALUES ('1418464225015791617', '自动喷水灭火系统', '消防专用电话', '92120000GYI44', 'upload/state/dcfc/viewicon/fireMobile.png', 37); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392662052493049858', '自动喷水灭火系统', 'FFS-雨淋蝶阀', '92110900ATW44', 'upload/state/dcfc/viewicon/DelugeButterflyValve.png', 54);
INSERT INTO `equipment_icon` VALUES ('1418464823584915458', '其他系统', '防火分隔设施', '92990000UVR44', NULL, 59); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392662028300304385', '自动喷水灭火系统', 'WSS-雨淋阀', '92130300BH644', 'upload/state/dcfc/viewicon/delugeValve.png', 55);
INSERT INTO `equipment_icon` VALUES ('1418465438318886913', '自动喷水灭火系统', '雨淋阀', '92110900V9B44', 'upload/state/dcfc/viewicon/yuLinFa.png', 38); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1418465836974899202', '其他系统', '消防小室', '92990000AQT44', 'upload/state/dcfc/viewicon/fireCompartment.png', 56);
INSERT INTO `equipment_icon` VALUES ('1418465836974899202', '其他系统', '消防小室', '92990000AQT44', NULL, 56); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1418496226158649346', '其他系统', '灭火器巡检', '92990000N2844', 'upload/state/dcfc/viewicon/fireExtinguisherInspection.png', 57);
INSERT INTO `equipment_icon` VALUES ('1418466180761026562', '压缩空气泡沫灭火系统(CAFS)', '压缩空气泡沫灭火系统', '92030000WEW44', 'upload/state/dcfc/viewicon/yasuokongqi.png', 26); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1418497428988567554', '其他系统', '消火栓系统', '92990000RIN44', 'upload/state/dcfc/viewicon/fireWaterSystem.png', 58);
INSERT INTO `equipment_icon` VALUES ('1418466508642353153', '自动喷水灭火系统', '自动喷水灭火系统', '92130000YCG44', NULL, 40); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1418464823584915458', '其他系统', '防火分隔设施', '92990000UVR44', 'upload/state/dcfc/viewicon/separationFacility.png', 59);
INSERT INTO `equipment_icon` VALUES ('1418496226158649346', '其他系统', '灭火器巡检', '92990000N2844', NULL, 57); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1404693512771063809', '其他系统', 'FPMS-配电开关', '922206009JO44', 'upload/state/dcfc/viewicon/distributionSwitch.png', 60);
INSERT INTO `equipment_icon` VALUES ('1418497428988567554', '其他系统', '消火栓系统', '92990000RIN44', NULL, 58); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1418445233194696705', '其他系统', '灭火器', '31040000PV244', 'upload/state/dcfc/viewicon/fireExtinguisher.png', 61);
INSERT INTO `equipment_icon` VALUES ('1418505479128817666', '消防给水及消火栓系统', '消防供水设施', '92010000S0F44', 'upload/state/dcfc/viewicon/gongshuiSheShi.png', 27); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1450756152672518146', '其他系统', 'FHS-无线液位探测器', '92011500EBH44', 'upload/state/dcfc/viewicon/wirelessLiquidLevelDetector.png', 62);
INSERT INTO `equipment_icon` VALUES ('1418822147562434562', '自动喷水灭火系统', '消防水池', '92010000XBB44', 'upload/state/dcfc/viewicon/xiaoFangShuiChi.png', 42); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392662054481149954', '其他系统', 'FHS-消防水池装置', '92010700SHY44', 'upload/state/dcfc/viewicon/poolInstallation.png', 63);
INSERT INTO `equipment_icon` VALUES ('1450756152672518146', '其他系统', 'FHS-无线液位探测器', '92011500EBH44', NULL, 62); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392361066734010370', '其他系统', 'CAFS-泡沫罐', '92031900INJ44', 'upload/state/dcfc/viewicon/foamTank.png', 64);
INSERT INTO `equipment_icon` VALUES ('1527227300964233217', '消防给水及消火栓系统', '消火栓', '93060400CQX44', 'upload/state/dcfc/viewicon/fireMachine.png', 28); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1401866678308171778', '其他系统', 'FHS-管网压力探测器', '92011000T5Q44', 'upload/state/dcfc/viewicon/guanWangYaLi.png', 65);
INSERT INTO `equipment_icon` VALUES ('1578945741864742914', '排油注氮系统', '消防水箱', '93060600HQK44', 'upload/state/dcfc/viewicon/fireShuiXiang.png', 2); INSERT INTO `equipment_icon`(`id`, `sys_name`, `type_name`, `type_code`, `icon`, `sort`) VALUES ('1392662048705593345', '其他系统', 'ES-电梯', '92170100NKI44', 'upload/state/dcfc/viewicon/elevator.png', 66);
UPDATE wl_equipment e SET e.shbz_img = (SELECT ei.icon FROM equipment_icon ei WHERE e.`code` = ei.`type_code`); UPDATE wl_equipment e SET e.shbz_img = (SELECT ei.icon FROM equipment_icon ei WHERE e.`code` = ei.`type_code`);
...@@ -649,4 +649,26 @@ ...@@ -649,4 +649,26 @@
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="keyong" id="1673609612-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_equipment_specific_index" columnName="unit"/>
</not>
</preConditions>
<comment>新增属性字段 unit</comment>
<sql>
alter table `wl_equipment_specific_index` add column `unit` varchar(50) DEFAULT NULL COMMENT '指标单位(冗余字段)';
</sql>
</changeSet>
<changeSet author="keyong" id="1673609612-2">
<preConditions onFail="MARK_RAN">
<tableExists tableName="wl_equipment_specific_index" />
</preConditions>
<comment>sync field</comment>
<sql>
UPDATE wl_equipment_specific_index wesi
SET wesi.unit = ( SELECT unit FROM wl_equipment_index wei WHERE wei.id = wesi.equipment_index_id );
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -40,49 +40,25 @@ ...@@ -40,49 +40,25 @@
SELECT SELECT
wes.id AS specificId, wes.id AS specificId,
wes.`name`, wes.`name`,
a.statusDesc,
a.sxyl,
a.`value`, a.`value`,
wes.`code`, wes.`code`,
a.sxrj a.sxrj,
a.`unit`,
a.minLevel,
a.maxLevel
FROM FROM
wl_equipment_specific wes wl_equipment_specific wes
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
wlesi.equipment_specific_id, wlesi.equipment_specific_id,
IFNULL(wlesi.`value`, '--') AS `value`, IFNULL(wlesi.`value`, '--') AS `value`,
CASE wlesi.`unit`,
WHEN wlesi.`value` IS NULL THEN (SELECT wfie.field_value FROM wl_form_instance_equip wfie WHERE wfie.instance_id = wlesi.equipment_specific_id AND field_name = 'maxLevel') AS maxLevel,
'--' (SELECT IFNULL( wfie.field_value, 0 ) FROM wl_form_instance_equip wfie WHERE wfie.instance_id = wlesi.equipment_specific_id AND field_name = 'minLevel') AS minLevel,
WHEN wlesi.`value` - ( SELECT IFNULL( wfie.field_value, 0 ) FROM wl_form_instance_equip wfie WHERE wfie.instance_id = wlesi.equipment_specific_id AND field_name = 'maxLevel' ) &gt; 0 THEN
'液位高'
WHEN wlesi.`value` - ( SELECT IFNULL( wfie.field_value, 0 ) FROM wl_form_instance_equip wfie WHERE wfie.instance_id = wlesi.equipment_specific_id AND field_name = 'minLevel' ) &lt; 0 THEN
'液位低' ELSE '正常'
END AS statusDesc,
CASE CASE
WHEN ( SELECT IFNULL( wfie.field_value, 0 ) FROM wl_form_instance_equip wfie WHERE wfie.instance_id = wlesi.equipment_specific_id AND field_name = 'volume' ) <![CDATA[<>]]> 0 THEN WHEN ( SELECT IFNULL( wfie.field_value, 0 ) FROM wl_form_instance_equip wfie WHERE wfie.instance_id = wlesi.equipment_specific_id AND field_name = 'volume' ) <![CDATA[<>]]> 0 THEN
CONCAT(( SELECT field_value FROM wl_form_instance_equip wfie WHERE wfie.instance_id = wlesi.equipment_specific_id AND field_name = 'volume' ),'m³') ELSE '--m³' CONCAT(( SELECT field_value FROM wl_form_instance_equip wfie WHERE wfie.instance_id = wlesi.equipment_specific_id AND field_name = 'volume' ),'m³') ELSE '--m³'
END AS sxrj, END AS sxrj
CASE
WHEN wlesi.`value` IS NULL THEN
'--' ELSE
IF
(
wlesi.`value` - ( SELECT IFNULL( field_value, 0 ) FROM wl_form_instance_equip wfie WHERE wfie.instance_id = wlesi.equipment_specific_id AND field_name = 'maxLevel' ) &gt; 0,
100,
ROUND(abs(
(
wlesi.`value` /
IF
(
( SELECT IFNULL( field_value, 0 ) FROM wl_form_instance_equip wfie WHERE wfie.instance_id = wlesi.equipment_specific_id AND field_name = 'maxLevel' ) = 0,
1,
( SELECT IFNULL( field_value, 0 ) FROM wl_form_instance_equip wfie WHERE wfie.instance_id = wlesi.equipment_specific_id AND field_name = 'maxLevel' )
)
)
) * 100, 2)
)
END AS sxyl
FROM FROM
wl_equipment_specific_index wlesi wl_equipment_specific_index wlesi
WHERE WHERE
...@@ -169,36 +145,40 @@ ...@@ -169,36 +145,40 @@
temp.name, temp.name,
temp.nowLevel, temp.nowLevel,
temp.volume, temp.volume,
CASE temp.unit,
WHEN ( temp.nowLevel = '--' ) THEN temp.minLevel,
'--' temp.maxLevel
WHEN ( temp.minLevel - temp.nowLevel > 0 ) THEN -- CASE
'液位低' -- WHEN ( temp.nowLevel = '--' ) THEN
WHEN ( temp.nowLevel - temp.maxLevel > 0) THEN -- '--'
'液位高' ELSE '正常' -- WHEN ( temp.minLevel - temp.nowLevel > 0 ) THEN
END AS status, -- '液位低'
CASE -- WHEN ( temp.nowLevel - temp.maxLevel > 0) THEN
WHEN ( temp.nowLevel = '--' ) THEN -- '液位高' ELSE '正常'
'--' ELSE format( -- END AS status,
IF -- CASE
( -- WHEN ( temp.nowLevel = '--' ) THEN
( -- '--' ELSE format(
abs( ( ( temp.nowLevel ) / IF ( temp.maxLevel = 0, 1, temp.maxLevel ) ) ) * 100 -- IF
) > 100, -- (
100, -- (
( -- abs( ( ( temp.nowLevel ) / IF ( temp.maxLevel = 0, 1, temp.maxLevel ) ) ) * 100
abs( ( ( temp.nowLevel ) / IF ( temp.maxLevel = 0, 1, temp.maxLevel ) ) ) * 100 -- ) > 100,
) -- 100,
), -- (
2 -- abs( ( ( temp.nowLevel ) / IF ( temp.maxLevel = 0, 1, temp.maxLevel ) ) ) * 100
) -- )
END AS abs -- ),
-- 2
-- )
-- END AS abs
FROM FROM
( (
SELECT SELECT
wes.id, wes.id,
wes.name, wes.name,
IFNULL( ( SELECT value FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' ), '--' ) AS nowLevel, IFNULL( ( SELECT value FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' ), '--' ) AS nowLevel,
IFNULL( ( SELECT unit FROM wl_equipment_specific_index wesi WHERE wesi.equipment_specific_id = wes.id AND equipment_index_key = 'CAFS_FoamTank_FoamTankLevel' ), '--' ) AS unit,
IFNULL(( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxLevel' ) , 0 )AS maxLevel, IFNULL(( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'maxLevel' ) , 0 )AS maxLevel,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minLevel' ), 0 ) AS minLevel, IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'minLevel' ), 0 ) AS minLevel,
IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'volume' ), 0 ) AS volume IFNULL( ( SELECT field_value FROM wl_form_instance_equip WHERE instance_id = wes.id AND field_name = 'volume' ), 0 ) AS volume
......
...@@ -2381,7 +2381,7 @@ ...@@ -2381,7 +2381,7 @@
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) &lt; IFNULL( rp.min_water_level, 0 ) WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) &lt; IFNULL( rp.min_water_level, 0 )
AND rp.max_water_level IS NULL THEN AND rp.max_water_level IS NULL THEN
'--' ELSE IFNULL(( '--' ELSE IFNULL((
FORMAT(
abs( abs(
IFNULL( IFNULL(
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ), max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),
...@@ -2390,9 +2390,7 @@ ...@@ -2390,9 +2390,7 @@
( (
IFNULL( rp.max_water_level, 0 ) = 0, IFNULL( rp.max_water_level, 0 ) = 0,
1, 1,
IFNULL( rp.max_water_level, 0 ))) * 100, IFNULL( rp.max_water_level, 0 ))) * 100
2
)
), ),
0 0
) )
...@@ -2415,6 +2413,7 @@ ...@@ -2415,6 +2413,7 @@
ec.image, ec.image,
r.resource_type, r.resource_type,
r.sequence_nbr, r.sequence_nbr,
rp.level_device_id,
fs.`code` AS systemCode fs.`code` AS systemCode
FROM FROM
cb_water_resource r cb_water_resource r
...@@ -2453,7 +2452,7 @@ ...@@ -2453,7 +2452,7 @@
WHEN IFNULL( a.minLevel, 0 ) > a.nowLevel WHEN IFNULL( a.minLevel, 0 ) > a.nowLevel
AND a.maxLevel IS NULL THEN AND a.maxLevel IS NULL THEN
'--' ELSE IFNULL(( '--' ELSE IFNULL((
FORMAT(
abs( abs(
IFNULL( IFNULL(
a.nowLevel, a.nowLevel,
...@@ -2462,9 +2461,7 @@ ...@@ -2462,9 +2461,7 @@
( (
IFNULL( a.maxLevel, 0 ) = 0, IFNULL( a.maxLevel, 0 ) = 0,
1, 1,
IFNULL( a.maxLevel, 0 ))) * 100, IFNULL( a.maxLevel, 0 ))) * 100
2
)
), ),
0 0
) )
...@@ -2487,6 +2484,7 @@ ...@@ -2487,6 +2484,7 @@
a.image, a.image,
a.resource_type, a.resource_type,
a.sequence_nbr, a.sequence_nbr,
a.level_device_id,
a.`code` AS systemCode a.`code` AS systemCode
FROM FROM
( (
...@@ -2496,7 +2494,7 @@ ...@@ -2496,7 +2494,7 @@
IFNULL( rp.min_water_level, 0 ) AS minLevel, IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel, IFNULL( rp.max_water_level, 0 ) AS maxLevel,
(select (select
FORMAT(avg(IFNULL(ei.`value`,0)), 2) avg(IFNULL(ei.`value`,0))
from from
wl_equipment_specific_index ei wl_equipment_specific_index ei
where where
...@@ -4611,47 +4609,8 @@ ...@@ -4611,47 +4609,8 @@
r.`name`, r.`name`,
IFNULL( rp.min_water_level, 0 ) AS minLevel, IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel, IFNULL( rp.max_water_level, 0 ) AS maxLevel,
(
CASE
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) IS NULL THEN
'--'
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) >= IFNULL( rp.min_water_level, 0 )
AND rp.max_water_level IS NULL THEN
'100'
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) &lt; IFNULL( rp.min_water_level, 0 )
AND rp.max_water_level IS NULL THEN
'--' ELSE IFNULL((
FORMAT(
abs(
IFNULL(
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),
IFNULL( rp.min_water_level, 0 )) /
IF
(
IFNULL( rp.max_water_level, 0 ) = 0,
1,
IFNULL( rp.max_water_level, 0 ))) * 100,
2
)
),
0
)
END
) AS levelAbs,
IFNULL(max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),'--') AS nowLevel, IFNULL(max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),'--') AS nowLevel,
( IFNULL(CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' THEN ei.`unit` END,'--') AS 'unit',
CASE
WHEN max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ) IS NULL
OR rp.min_water_level IS NULL THEN
'--'
WHEN IFNULL(
max( CASE WHEN ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' THEN ei.`value` END ),
IFNULL( rp.min_water_level, 0 )) &lt; IFNULL( rp.min_water_level, 0 ) THEN
'缺水' ELSE '正常'
END
) AS levelStatus,
IFNULL( rp.volume, 0 ) AS volume, IFNULL( rp.volume, 0 ) AS volume,
ec.image, ec.image,
r.resource_type, r.resource_type,
...@@ -4676,47 +4635,8 @@ ...@@ -4676,47 +4635,8 @@
a.`name`, a.`name`,
a.minLevel, a.minLevel,
a.maxLevel, a.maxLevel,
(
CASE
WHEN a.nowLevel IS NULL THEN
'--'
WHEN a.nowLevel >= IFNULL( a.minLevel, 0 )
AND a.maxLevel IS NULL THEN
'100'
WHEN IFNULL( a.minLevel, 0 ) > a.nowLevel
AND a.maxLevel IS NULL THEN
'--' ELSE IFNULL((
FORMAT(
abs(
IFNULL(
a.nowLevel,
IFNULL( a.minLevel, 0 )) /
IF
(
IFNULL( a.maxLevel, 0 ) = 0,
1,
IFNULL( a.maxLevel, 0 ))) * 100,
2
)
),
0
)
END
) AS levelAbs,
IFNULL( a.nowLevel, '--' ) nowLevel, IFNULL( a.nowLevel, '--' ) nowLevel,
( a.`unit`,
CASE
WHEN a.nowLevel IS NULL
OR a.minLevel IS NULL THEN
'--'
WHEN IFNULL( a.minLevel, 0 ) > IFNULL(
a.nowLevel,
IFNULL( a.minLevel, 0 )) THEN
'缺水' ELSE '正常'
END
) AS levelStatus,
a.volume, a.volume,
a.image, a.image,
a.resource_type, a.resource_type,
...@@ -4728,12 +4648,20 @@ ...@@ -4728,12 +4648,20 @@
IFNULL( rp.min_water_level, 0 ) AS minLevel, IFNULL( rp.min_water_level, 0 ) AS minLevel,
IFNULL( rp.max_water_level, 0 ) AS maxLevel, IFNULL( rp.max_water_level, 0 ) AS maxLevel,
(select (select
FORMAT(avg(IFNULL(ei.`value`,0)), 2) avg(IFNULL(ei.`value`,0))
from from
wl_equipment_specific_index ei wl_equipment_specific_index ei
where where
(ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel') (ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel' or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel')
and FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id) > 0) AS nowLevel, and FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id) > 0) AS nowLevel,
(select
ei.unit
from
wl_equipment_specific_index ei
where
-- or ei.equipment_index_key = 'FHS_WirelessliquidDetector_WaterLevel' 此处由于单位会出现多个,所以无法确定选择哪一个,所以此处默认用一个指标的单位进行单位换算
ei.equipment_index_key = 'FHS_FirePoolDevice_WaterLevel'
and FIND_IN_SET( ei.equipment_specific_id, rp.level_device_id) > 0) AS 'unit',
IFNULL( rp.volume, 0 ) AS volume, IFNULL( rp.volume, 0 ) AS volume,
ec.image, ec.image,
r.resource_type, r.resource_type,
...@@ -4756,7 +4684,7 @@ ...@@ -4756,7 +4684,7 @@
) a ) a
)) b )) b
ORDER BY ORDER BY
levelStatus DESC,sequence_nbr DESC sequence_nbr DESC
</select> </select>
<select id="getFoamTankBySuper" resultType="java.util.Map"> <select id="getFoamTankBySuper" resultType="java.util.Map">
...@@ -5026,6 +4954,7 @@ ...@@ -5026,6 +4954,7 @@
AND AND
</if> </if>
i.equipment_index_key in ('FHS_PressurePump_Start') i.equipment_index_key in ('FHS_PressurePump_Start')
and i.value = 'true'
ORDER BY ORDER BY
i.update_date DESC i.update_date DESC
limit 1 limit 1
...@@ -5046,6 +4975,7 @@ ...@@ -5046,6 +4975,7 @@
AND AND
</if> </if>
i.equipment_index_key in ('FHS_PressurePump_Stop') i.equipment_index_key in ('FHS_PressurePump_Stop')
and i.value = 'true'
ORDER BY ORDER BY
i.update_date DESC i.update_date DESC
limit 1 limit 1
...@@ -5460,7 +5390,14 @@ ...@@ -5460,7 +5390,14 @@
<select id="getWaterlevelUnit" resultType="java.util.Map"> <select id="getWaterlevelUnit" resultType="java.util.Map">
SELECT unit FROM `wl_equipment_index` WHERE name_key = 'FHS_FirePoolDevice_WaterLevel' SELECT
wes.unit
FROM
wl_equipment_specific_index wes
WHERE
wes.equipment_index_key = #{equipmentIndexKey}
AND wes.equipment_specific_id = #{equipmentSpecificId}
LIMIT 1
</select> </select>
<select id="getStationConnectStatus" resultType="java.util.Map"> <select id="getStationConnectStatus" resultType="java.util.Map">
...@@ -5683,6 +5620,7 @@ ...@@ -5683,6 +5620,7 @@
WHERE WHERE
wesi.equipment_specific_id = es.id wesi.equipment_specific_id = es.id
AND wesi.equipment_index_key IN ('FHS_PressurePump_Stop') AND wesi.equipment_index_key IN ('FHS_PressurePump_Stop')
AND wesi.value = 'true'
ORDER BY ORDER BY
wesi.update_date DESC wesi.update_date DESC
LIMIT 1 LIMIT 1
...@@ -5695,6 +5633,7 @@ ...@@ -5695,6 +5633,7 @@
WHERE WHERE
wesi.equipment_specific_id = es.id wesi.equipment_specific_id = es.id
AND wesi.equipment_index_key IN ('FHS_PressurePump_Start') AND wesi.equipment_index_key IN ('FHS_PressurePump_Start')
AND wesi.value = 'true'
ORDER BY ORDER BY
wesi.update_date DESC wesi.update_date DESC
LIMIT 1 LIMIT 1
......
...@@ -253,70 +253,44 @@ ...@@ -253,70 +253,44 @@
SELECT SEQUENCE_NBR FROM knowledge_doc_content WHERE DOC_STATUS = "PUBLISHED" SELECT SEQUENCE_NBR FROM knowledge_doc_content WHERE DOC_STATUS = "PUBLISHED"
</select> </select>
<select id="queryDocCardList" resultType="map"> <select id="queryDocCardList" parameterType="map" resultType="map">
SELECT SELECT
SEQUENCE_NBR sequenceNbr, kdc.SEQUENCE_NBR id,
REC_DATE recDate, kdc.DOC_TITLE title,
DOC_STATUS docStatus, cat.CATEGORY_NAME categoryName
CREATE_TIME createTime,
USER_ID userId,
AUDIT_STATUS auditStatus,
REJECTION_COMMENT rejectionComment,
AUDITOR_USER_ID auditorUserId,
ORG_CODE orgCode,
DOC_TITLE docTitle,
DIRECTORY_ID directoryId,
( SELECT kdc.CATEGORY_NAME FROM knowledge_doc_category kdc WHERE kdc.SEQUENCE_NBR = DIRECTORY_ID ) directoryName,
releaseDate,
excuteDate,
IFNULL( collectNum, 0 ) collectNum,
IFNULL( quoteNum, 0 ) quoteNum,
IFNULL( collect, "UNCOLLECT" ) collect
FROM FROM
knowledge_doc_content doct knowledge_doc_content kdc LEFT JOIN knowledge_doc_category cat ON cat.SEQUENCE_NBR = kdc.DIRECTORY_ID
LEFT JOIN (
SELECT
INSTANCE_ID,
MAX( CASE FIELD_NAME WHEN 'releaseDate' THEN FIELD_VALUE ELSE NULL END ) AS releaseDate,
MAX( CASE FIELD_NAME WHEN 'excuteDate' THEN FIELD_VALUE ELSE NULL END ) AS excuteDate
FROM
knowledge_dynamics_value
GROUP BY
INSTANCE_ID
) fieldt ON doct.SEQUENCE_NBR = fieldt.INSTANCE_ID
LEFT JOIN ( SELECT ENTITY_ID, COUNT( 1 ) collectNum FROM knowledge_interaction_record WHERE OPERATE_TYPE = "COLLECT" GROUP BY ENTITY_ID ) coll ON doct.SEQUENCE_NBR = coll.ENTITY_ID
LEFT JOIN ( SELECT ENTITY_ID, OPERATE_COUNT quoteNum FROM knowledge_interaction_count WHERE OPERATE_TYPE = "PUBLISH" AND ENTITY_TYPE = "DOC" ) quot ON doct.SEQUENCE_NBR = quot.ENTITY_ID
LEFT JOIN ( SELECT ENTITY_ID, OPERATE_TYPE collect FROM knowledge_interaction_record WHERE OPERATE_TYPE = "COLLECT" AND USER_ID = 3780967 ) favor ON doct.SEQUENCE_NBR = favor.ENTITY_ID
WHERE WHERE
DOC_STATUS = 'PUBLISHED' kdc.DOC_STATUS = "PUBLISHED"
ORDER BY <if test="id != null and id != ''">
directoryName DESC, AND cat.PARENT_ID = #{id}
create_time DESC </if>
<if test="ids != null and ids.size > 0">
AND cat.PARENT_ID not in
<foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</if>
ORDER BY kdc.CREATE_TIME DESC
</select> </select>
<select id="queryCardCount" resultType="map"> <select id="queryCardCount" resultType="map">
SELECT SELECT
SEQUENCE_NBR id,
( SELECT kdc.CATEGORY_NAME FROM knowledge_doc_category kdc WHERE kdc.SEQUENCE_NBR = DIRECTORY_ID ) directoryName, CATEGORY_NAME categoryName,
COUNT(SEQUENCE_NBR) as num (
SELECT
COUNT( doc.SEQUENCE_NBR )
FROM
knowledge_doc_content doc
LEFT JOIN knowledge_doc_category kdc ON kdc.SEQUENCE_NBR = doc.DIRECTORY_ID
WHERE
kdc.PARENT_ID = k.SEQUENCE_NBR
) num
FROM FROM
knowledge_doc_content doct knowledge_doc_category k
LEFT JOIN (
SELECT
INSTANCE_ID,
MAX( CASE FIELD_NAME WHEN 'releaseDate' THEN FIELD_VALUE ELSE NULL END ) AS releaseDate,
MAX( CASE FIELD_NAME WHEN 'excuteDate' THEN FIELD_VALUE ELSE NULL END ) AS excuteDate
FROM
knowledge_dynamics_value
GROUP BY
INSTANCE_ID
) fieldt ON doct.SEQUENCE_NBR = fieldt.INSTANCE_ID
LEFT JOIN ( SELECT ENTITY_ID, COUNT( 1 ) collectNum FROM knowledge_interaction_record WHERE OPERATE_TYPE = "COLLECT" GROUP BY ENTITY_ID ) coll ON doct.SEQUENCE_NBR = coll.ENTITY_ID
LEFT JOIN ( SELECT ENTITY_ID, OPERATE_COUNT quoteNum FROM knowledge_interaction_count WHERE OPERATE_TYPE = "PUBLISH" AND ENTITY_TYPE = "DOC" ) quot ON doct.SEQUENCE_NBR = quot.ENTITY_ID
LEFT JOIN ( SELECT ENTITY_ID, OPERATE_TYPE collect FROM knowledge_interaction_record WHERE OPERATE_TYPE = "COLLECT" ) favor ON doct.SEQUENCE_NBR = favor.ENTITY_ID
WHERE WHERE
DOC_STATUS = 'PUBLISHED' PARENT_ID = 0
GROUP BY DIRECTORY_ID
</select> </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 to comment