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));
} }
} }
} }
......
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
......
...@@ -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