Commit eff4ee07 authored by lisong's avatar lisong

修改bug

parent 53bed829
...@@ -21,6 +21,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType; ...@@ -21,6 +21,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.text.ParseException; import java.text.ParseException;
...@@ -259,7 +260,7 @@ public class ConfigureController extends AbstractBaseController { ...@@ -259,7 +260,7 @@ public class ConfigureController extends AbstractBaseController {
item.put("unNormalNum", (Integer) item.get("startAndStopNum") <= 1 ? 0 : 1); item.put("unNormalNum", (Integer) item.get("startAndStopNum") <= 1 ? 0 : 1);
Map<String, String> stateMap = fireFightingSystemMapper.queryPressureNowStateBySpecificId((Long) item.get("id")); Map<String, String> stateMap = fireFightingSystemMapper.queryPressureNowStateBySpecificId((Long) item.get("id"));
if (!ObjectUtils.isEmpty(stateMap) && stateMap.containsKey("update_date") && stateMap.containsKey("equipment_index_name")) { if (!ObjectUtils.isEmpty(stateMap) && stateMap.containsKey("update_date") && stateMap.containsKey("equipment_index_name")) {
item.put("update_time", stateMap.get("update_date")); item.put("update_time", String.valueOf(stateMap.get("update_date")).replaceAll("T", " "));
item.put("equipment_index_name", stateMap.get("equipment_index_name")); item.put("equipment_index_name", stateMap.get("equipment_index_name"));
} }
return item; return item;
...@@ -449,4 +450,149 @@ public class ConfigureController extends AbstractBaseController { ...@@ -449,4 +450,149 @@ public class ConfigureController extends AbstractBaseController {
return CommonResponseUtil.success(iFireFightingSystemService.equipmentState(result, hashMap)); return CommonResponseUtil.success(iFireFightingSystemService.equipmentState(result, hashMap));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "物联监控大屏3大-获取某站下装备数量、摄像头数量")
@GetMapping("/statisticsByStation")
public ResponseModel getEquipmentState(@RequestParam(required = false) String bizOrgCode) {
if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
}
}
return CommonResponseUtil.success(iFireFightingSystemService.statisticsByStation(bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "物联监控大屏3大-获取某站下今日告警设备")
@GetMapping("/todayAlarmEquipment")
public ResponseModel todayAlarmEquipment(@RequestParam(required = false) String bizOrgCode) {
if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
}
}
return CommonResponseUtil.success(iFireFightingSystemService.todayAlarmEquipment(bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "物联监控大屏3大-获取某站下今日告警信息")
@GetMapping("/todayAlarmMessage")
public ResponseModel todayAlarmMessage(@RequestParam(required = false) String bizOrgCode) {
if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
}
}
return CommonResponseUtil.success(iFireFightingSystemService.todayAlarmMessage(bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "物联监控大屏3大-获取某站下未消除的告警设备")
@GetMapping("/todayAlarmUnEliminateEquipment")
public ResponseModel todayAlarmUnEliminateEquipment(@RequestParam(required = false) String bizOrgCode) {
if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
}
}
return CommonResponseUtil.success(iFireFightingSystemService.todayAlarmUnEliminateEquipment(bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "物联监控大屏3大-获取某站下未消除的告警信息")
@GetMapping("/todayAlarmUnEliminateMessage")
public ResponseModel todayAlarmUnEliminateMessage(@RequestParam(required = false) String bizOrgCode) {
if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
}
}
return CommonResponseUtil.success(iFireFightingSystemService.todayAlarmUnEliminateMessage(bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "物联监控大屏3大-获取某站下近一月的告警信息")
@GetMapping("/monthAlarm")
public ResponseModel monthAlarm(@RequestParam(required = false) String bizOrgCode) {
if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
}
}
return CommonResponseUtil.success(iFireFightingSystemService.monthAlarm(bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "物联监控大屏3大-获取某站下近一年告警统计")
@GetMapping("/yearsAlarm")
public ResponseModel yearsAlarm(@RequestParam(required = false) String bizOrgCode) {
if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
}
}
return CommonResponseUtil.success(iFireFightingSystemService.yearsAlarm(bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "物联监控大屏3大-检测告警记录")
@GetMapping("/alarmList")
public ResponseModel alarmList(@RequestParam(required = false) String bizOrgCode, CommonPageable commonPageable) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
}
}
Page page = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize());
return CommonResponseUtil.success(iFireFightingSystemService.alarmList(page, bizOrgCode));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/equipList")
@ApiOperation(httpMethod = "GET", value = "装备列表-用于站端查看信息卡", notes = "装备列表-用于站端查看信息卡")
public ResponseModel equipList(CommonPageable commonPageable, @RequestParam(value = "bizOrgCode", required = false) String bizOrgCode) {
if (commonPageable.getPageNumber() == 0) {
commonPageable.setPageNumber(1);
}
if (ObjectUtils.isEmpty(bizOrgCode)) {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
if (!ValidationUtil.isEmpty(personIdentity)) {
bizOrgCode = personIdentity.getBizOrgCode();
}
}
Page page = new Page<>(commonPageable.getPageNumber(), commonPageable.getPageSize());
return CommonResponseUtil.success(iFireFightingSystemService.equipList(page, bizOrgCode));
}
} }
...@@ -47,4 +47,17 @@ public class VideoImportantEquipmentController { ...@@ -47,4 +47,17 @@ public class VideoImportantEquipmentController {
} }
return videoImportantEquipmentService.getVideoImportantEquipmentList(map); return videoImportantEquipmentService.getVideoImportantEquipmentList(map);
} }
@RequestMapping(value = "/getVideoList", method = RequestMethod.GET)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "获取视屏监控关联重点设备集合(需求优化)", notes = "获取视屏监控关联重点设备集合(需求优化)")
public List<Map<String, List<VideoImportantEquipmentVo>>> getVideoList(@RequestParam(required = false) Long importantEquipmentId) {
Map<String, Object> map = null;
if (importantEquipmentId != null) {
map = new HashMap<>();
map.put("importantEquipmentId", importantEquipmentId);
}
return videoImportantEquipmentService.getVideoList(map);
}
} }
\ No newline at end of file
...@@ -371,4 +371,66 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE ...@@ -371,4 +371,66 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
* @return * @return
*/ */
List<EquipmentExportVO> exportEquipmentList(@Param("dto") EquipTypeAmountPageDTO dto); List<EquipmentExportVO> exportEquipmentList(@Param("dto") EquipTypeAmountPageDTO dto);
/**
* 统计某站下装备总数、摄像头总数
* @param bizOrgCode
* @return
*/
Map<String, Object> statisticsByStation(@Param("bizOrgCode") String bizOrgCode);
/**
* 查询某站今日告警设备信息
* @param bizOrgCode
* @return
*/
Map<String, Object> todayAlarmEquipment(@Param("bizOrgCode") String bizOrgCode);
/**
* 查询某站今日告警信息
* @param bizOrgCode
* @return
*/
Map<String, Object> todayAlarmMessage(@Param("bizOrgCode") String bizOrgCode);
/**
* 查询某站今日未消除设备
* @param bizOrgCode
* @return
*/
Map<String, Object> todayAlarmUnEliminateEquipment(@Param("bizOrgCode") String bizOrgCode);
/**
* 查询某站今日未消除告警
* @param bizOrgCode
* @return
*/
Map<String, Object> todayAlarmUnEliminateMessage(@Param("bizOrgCode") String bizOrgCode);
/**
* 查询某站近一月告警趋势
* @param bizOrgCode
* @return
*/
List<Map<String, Object>> monthAlarm(@Param("bizOrgCode") String bizOrgCode);
/**
* 查询某站近一年告警统计
* @param bizOrgCode
* @return
*/
List<Map<String, Object>> yearsAlarm(@Param("bizOrgCode") String bizOrgCode);
/**
* 分页查询站下检测告警记录
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> alarmList(Page page, @Param("bizOrgCode") String bizOrgCode);
/**
* 站端装备列表
* @param page
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> equipList (Page page, @Param("bizOrgCode") String bizOrgCode);
} }
...@@ -16,4 +16,9 @@ import java.util.Map; ...@@ -16,4 +16,9 @@ import java.util.Map;
@Mapper @Mapper
public interface VideoImportantEquipmentMapper extends BaseMapper<VideoImportantEquipment> { public interface VideoImportantEquipmentMapper extends BaseMapper<VideoImportantEquipment> {
List<VideoImportantEquipmentVo> getVideoImportantEquipmentList(Map<String, Object> map); List<VideoImportantEquipmentVo> getVideoImportantEquipmentList(Map<String, Object> map);
List<VideoImportantEquipmentVo> getVideoList(Map<String, Object> map);
List<String> getVideoAddressGroupList(Map<String, Object> map);
} }
...@@ -254,4 +254,21 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE ...@@ -254,4 +254,21 @@ public interface IFireFightingSystemService extends IService<FireFightingSystemE
Page<Map<String, Object>> equipmentState(Page result, HashMap<String, Object> hashMap); Page<Map<String, Object>> equipmentState(Page result, HashMap<String, Object> hashMap);
Map<String, Object> statisticsByStation(String bizOrgCode);
Map<String, Object> todayAlarmEquipment(String bizOrgCode);
Map<String, Object> todayAlarmMessage(String bizOrgCode);
Map<String, Object> todayAlarmUnEliminateEquipment(String bizOrgCode);
Map<String, Object> todayAlarmUnEliminateMessage(String bizOrgCode);
List<Map<String, Object>> monthAlarm(String bizOrgCode);
List<Map<String, Object>> yearsAlarm(String bizOrgCode);
Page<Map<String, Object>> alarmList(Page page, String bizOrgCode);
Page<Map<String, Object>> equipList(Page page, String bizOrgCode);
} }
...@@ -14,4 +14,6 @@ import java.util.Map; ...@@ -14,4 +14,6 @@ import java.util.Map;
*/ */
public interface IVideoImportantEquipmentService extends IService<VideoImportantEquipment> { public interface IVideoImportantEquipmentService extends IService<VideoImportantEquipment> {
List<VideoImportantEquipmentVo> getVideoImportantEquipmentList(Map<String, Object> map); List<VideoImportantEquipmentVo> getVideoImportantEquipmentList(Map<String, Object> map);
List<Map<String, List<VideoImportantEquipmentVo>>> getVideoList(Map<String, Object> map);
} }
...@@ -11,8 +11,11 @@ import org.apache.commons.compress.utils.Lists; ...@@ -11,8 +11,11 @@ import org.apache.commons.compress.utils.Lists;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -62,6 +65,20 @@ public class EquipmentInfoOnPlanServiceImpl implements IEquipmentInfoOnPlanServi ...@@ -62,6 +65,20 @@ public class EquipmentInfoOnPlanServiceImpl implements IEquipmentInfoOnPlanServi
@Override @Override
public List<Map<String, Object>> getOtherEquipInfo() { public List<Map<String, Object>> getOtherEquipInfo() {
List<Map<String, Object>> list = equipmentSpecificIndexMapper.getEquipSpecificIndexByUpdateDateDesc(); List<Map<String, Object>> list = equipmentSpecificIndexMapper.getEquipSpecificIndexByUpdateDateDesc();
list.stream().filter(item -> item.containsKey("createDate") && !ObjectUtils.isEmpty(item.get("createDate"))).forEach(item -> {
// try {
// Date carStateDate = DateUtils.dateParse(item.get("createDate").toString(), "yyyy-MM-dd'T'HH:mm:ss");
// String s = DateUtils.dateFormat(carStateDate, DateUtils.DATE_TIME_PATTERN).replaceAll("T", " ");
// item.put("createDate", s);
// } catch (ParseException e) {
// e.printStackTrace();
// }
String s = item.get("createDate").toString().replaceAll("T", " ");
item.put("createDate", s);
});
return Optional.ofNullable(list).orElse(Lists.newArrayList()); return Optional.ofNullable(list).orElse(Lists.newArrayList());
} }
......
...@@ -45,6 +45,7 @@ import org.springframework.util.StringUtils; ...@@ -45,6 +45,7 @@ import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.math.BigDecimal;
import java.net.Inet4Address; import java.net.Inet4Address;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.NetworkInterface; import java.net.NetworkInterface;
...@@ -1322,4 +1323,67 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste ...@@ -1322,4 +1323,67 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
return fireFightingSystemMapper.getWaterInfo(page, bizOrgCode, systemCode); return fireFightingSystemMapper.getWaterInfo(page, bizOrgCode, systemCode);
} }
@Override
public Map<String, Object> statisticsByStation(String bizOrgCode) {
return fireFightingSystemMapper.statisticsByStation(bizOrgCode);
}
@Override
public Map<String, Object> todayAlarmEquipment(String bizOrgCode) {
Map<String, Object> map = fireFightingSystemMapper.todayAlarmEquipment(bizOrgCode);
BigDecimal dayAbs = new BigDecimal(map.get("dayAbs").toString()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
map.put("dayAbs", dayAbs.toString());
BigDecimal monthAbs = new BigDecimal(map.get("monthAbs").toString()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
map.put("monthAbs", monthAbs.toString());
return map;
}
@Override
public Map<String, Object> todayAlarmMessage(String bizOrgCode) {
Map<String, Object> map = fireFightingSystemMapper.todayAlarmMessage(bizOrgCode);
BigDecimal dayAbs = new BigDecimal(map.get("dayAbs").toString()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
map.put("dayAbs", dayAbs.toString());
BigDecimal monthAbs = new BigDecimal(map.get("monthAbs").toString()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
map.put("monthAbs", monthAbs.toString());
return map;
}
@Override
public Map<String, Object> todayAlarmUnEliminateEquipment(String bizOrgCode) {
Map<String, Object> map = fireFightingSystemMapper.todayAlarmUnEliminateEquipment(bizOrgCode);
BigDecimal dayAbs = new BigDecimal(map.get("dayAbs").toString()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
map.put("dayAbs", dayAbs.toString());
BigDecimal monthAbs = new BigDecimal(map.get("monthAbs").toString()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
map.put("monthAbs", monthAbs.toString());
return map;
}
@Override
public Map<String, Object> todayAlarmUnEliminateMessage(String bizOrgCode) {
Map<String, Object> map = fireFightingSystemMapper.todayAlarmUnEliminateMessage(bizOrgCode);
BigDecimal dayAbs = new BigDecimal(map.get("dayAbs").toString()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
map.put("dayAbs", dayAbs.toString());
BigDecimal monthAbs = new BigDecimal(map.get("monthAbs").toString()).setScale(2, BigDecimal.ROUND_HALF_DOWN);
map.put("monthAbs", monthAbs.toString());
return map;
}
@Override
public List<Map<String, Object>> monthAlarm(String bizOrgCode) {
return fireFightingSystemMapper.monthAlarm(bizOrgCode);
}
@Override
public List<Map<String, Object>> yearsAlarm(String bizOrgCode) {
return fireFightingSystemMapper.yearsAlarm(bizOrgCode);
}
@Override
public Page<Map<String, Object>> alarmList(Page page, String bizOrgCode) {
return fireFightingSystemMapper.alarmList(page, bizOrgCode);
}
@Override
public Page<Map<String, Object>> equipList(Page page, String bizOrgCode) {
return fireFightingSystemMapper.equipList(page, bizOrgCode);
}
} }
...@@ -7,9 +7,14 @@ import com.yeejoin.equipmanage.mapper.VideoImportantEquipmentMapper; ...@@ -7,9 +7,14 @@ import com.yeejoin.equipmanage.mapper.VideoImportantEquipmentMapper;
import com.yeejoin.equipmanage.service.IVideoImportantEquipmentService; import com.yeejoin.equipmanage.service.IVideoImportantEquipmentService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/** /**
* @author ZeHua Li * @author ZeHua Li
...@@ -26,4 +31,22 @@ public class VideoImportantEquipmentServiceImpl extends ServiceImpl<VideoImporta ...@@ -26,4 +31,22 @@ public class VideoImportantEquipmentServiceImpl extends ServiceImpl<VideoImporta
public List<VideoImportantEquipmentVo> getVideoImportantEquipmentList(Map<String, Object> map) { public List<VideoImportantEquipmentVo> getVideoImportantEquipmentList(Map<String, Object> map) {
return videoImportantEquipmentMapper.getVideoImportantEquipmentList(map); return videoImportantEquipmentMapper.getVideoImportantEquipmentList(map);
} }
@Override
public List<Map<String, List<VideoImportantEquipmentVo>>> getVideoList(Map<String, Object> map) {
ArrayList<Map<String, List<VideoImportantEquipmentVo>>> maps = new ArrayList<>();
List<VideoImportantEquipmentVo> videoList = videoImportantEquipmentMapper.getVideoList(map);
List<String> videoAddressGroupList = videoImportantEquipmentMapper.getVideoAddressGroupList(map);
for (String address : videoAddressGroupList) {
if (!ObjectUtils.isEmpty(address)) {
List<VideoImportantEquipmentVo> collect = videoList.stream().filter(item -> item.getAddress().equals(address)).collect(Collectors.toList());
if (collect.size() > 0) {
HashMap<String, List<VideoImportantEquipmentVo>> listMap = new HashMap<>();
listMap.put(address, collect);
maps.add(listMap);
}
}
}
return maps;
}
} }
...@@ -1231,47 +1231,59 @@ ...@@ -1231,47 +1231,59 @@
</select> </select>
<select id="fireFacilitiesList" resultType="java.util.Map"> <select id="fireFacilitiesList" resultType="java.util.Map">
SELECT temp.id,temp.name,IFNULL(temp1.notReturned,0) AS notReturned ,IFNULL(temp2.returned,0) AS returned , SELECT temp.id,temp.name,IFNULL(temp1.notReturned,0) AS notReturned ,(IFNULL(temp2.total,0) - IFNULL(temp1.notReturned,0)) AS returned,
CASE CASE
WHEN (temp1.notReturned > 0 ) THEN WHEN (temp1.notReturned > 0 ) THEN
"异常" "异常"
ELSE "正常" ELSE "正常"
END END
AS `status` AS `status`
FROM FROM
(SELECT ffs.id,ffs.name FROM f_fire_fighting_system ffs (SELECT ffs.id,ffs.name FROM f_fire_fighting_system ffs
WHERE ffs.biz_org_code = #{bizOrgCode}) temp WHERE ffs.biz_org_code = #{bizOrgCode}
LEFT JOIN ) temp
(SELECT esa.system_ids,COUNT(1) AS notReturned
FROM wl_equipment_specific_alarm esa
WHERE esa.type = "BREAKDOWN"
and esa.equipment_specific_index_value = "true"
and esa.create_date BETWEEN #{startTime} and #{endTime}
GROUP BY esa.system_ids)temp1
on
FIND_IN_SET(temp.id,temp1.system_ids)
LEFT JOIN LEFT JOIN
(SELECT esa.system_ids,COUNT(1) AS returned (SELECT esa.system_ids,COUNT(DISTINCT(esa.iot_code)) AS notReturned
FROM wl_equipment_specific_alarm esa WHERE esa.type = "BREAKDOWN" FROM wl_equipment_specific_alarm esa
AND esa.equipment_specific_index_value = "false" WHERE esa.type = "BREAKDOWN"
and esa.create_date BETWEEN #{startTime} and #{endTime} and esa.equipment_specific_index_value = "true" and esa.create_date BETWEEN #{startTime} and #{endTime}
GROUP BY esa.system_ids)temp1
on
FIND_IN_SET(temp.id,temp1.system_ids)
LEFT JOIN
(SELECT esa.system_ids,COUNT(DISTINCT(esa.iot_code)) AS total
FROM wl_equipment_specific_alarm esa
WHERE esa.type = "BREAKDOWN" and esa.create_date BETWEEN #{startTime} and #{endTime}
GROUP BY esa.system_ids)temp2 GROUP BY esa.system_ids)temp2
on on
FIND_IN_SET(temp.id,temp2.system_ids) FIND_IN_SET(temp.id,temp2.system_ids)
</select> </select>
<select id="dailyMaintenance" resultType="java.util.Map"> <select id="dailyMaintenance" resultType="java.util.Map">
select
(SELECT count(1) AS total FROM wl_equipment_specific wes SELECT temp.total,temp.notReturned, temp.alarmEquipNum,(temp.alarmEquipNum - temp.notReturned) AS returned
WHERE wes.biz_org_code = #{bizOrgCode})AS total, FROM(
( select
SELECT COUNT(1) FROM wl_equipment_specific_alarm esa WHERE esa.org_code = #{orgCode} and create_date between #{startTime} and #{endTime} (SELECT
)AS alarmEquipNum, count(1 ) AS total
( FROM
SELECT COUNT(1) FROM wl_equipment_specific_alarm esa WHERE esa.org_code = #{orgCode} and create_date between #{startTime} and #{endTime} AND esa.equipment_specific_index_value = "true" wl_equipment_specific es
)as returned, LEFT JOIN wl_equipment_detail ed ON es.equipment_detail_id = ed.id
( LEFT JOIN wl_equipment e ON e.id = ed.equipment_id
SELECT COUNT(1) FROM wl_equipment_specific_alarm esa WHERE esa.org_code = #{orgCode} and create_date between #{startTime} and #{endTime} AND esa.equipment_specific_index_value = "false"
)as motReturned WHERE
e.is_iot = 1 and es.biz_org_code = #{bizOrgCode}
)AS total,
(
SELECT COUNT(DISTINCT(esa.iot_code)) FROM wl_equipment_specific_alarm esa
WHERE esa.org_code = #{orgCode}
and create_date between #{startTime} and #{endTime}
)AS alarmEquipNum,
(
SELECT COUNT(DISTINCT(esa.iot_code)) FROM wl_equipment_specific_alarm esa
WHERE esa.org_code = #{orgCode} AND esa.equipment_specific_index_value = "true"
and create_date between #{startTime} and #{endTime}
)as notReturned)temp
</select> </select>
<select id="inspectionMessage" resultType="java.util.Map"> <select id="inspectionMessage" resultType="java.util.Map">
SELECT SELECT
......
...@@ -22,4 +22,36 @@ ...@@ -22,4 +22,36 @@
</if> </if>
</where> </where>
</select> </select>
<select id="getVideoList" resultType="com.yeejoin.equipmanage.common.vo.VideoImportantEquipmentVo">
SELECT
v.id AS videoId,
v.`name`,
v.`code`,
v.type_code,
v.type,
v.url,
v.img,
v.address
FROM
wl_video v
<where>
<if test="importantEquipmentId != null">
v.id in (select video_id from wl_video_important_equipment
where important_equipment_id = #{importantEquipmentId})
</if>
</where>
</select>
<select id="getVideoAddressGroupList" resultType="java.lang.String">
SELECT
v.address
FROM
wl_video v
<where>
<if test="importantEquipmentId != null">
v.id in (select video_id from wl_video_important_equipment
where important_equipment_id = #{importantEquipmentId})
</if>
</where>
GROUP BY v.address
</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