Commit 3952d56d authored by KeYong's avatar KeYong

提交消防炮水泵信息查询接口

parent ff00c72f
...@@ -143,4 +143,8 @@ public class EquipmentSpecific extends BaseEntity { ...@@ -143,4 +143,8 @@ public class EquipmentSpecific extends BaseEntity {
@ApiModelProperty(value = "系统名称") @ApiModelProperty(value = "系统名称")
@TableField(exist = false) @TableField(exist = false)
private String systemName; private String systemName;
@ApiModelProperty(value = "设备值说明")
@TableField("value_label")
private String valueLabel;
} }
package com.yeejoin.equipmanage.controller;
import com.yeejoin.equipmanage.common.utils.CommonResponseUtil;
import com.yeejoin.equipmanage.service.IEquipmentInfoOnPlanService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
/**
* @author keyong
* @title: EquipmentInfoOnPlanController
* <pre>
* @description: TODO
* </pre>
* @date 2022/5/12 10:49
*/
@RestController
@Api(tags = "预案界面装备信息展示")
@RequestMapping(value = "/fire/plan")
public class EquipmentInfoOnPlanController {
@Autowired
private IEquipmentInfoOnPlanService equipmentInfoOnPlanService;
@ApiOperation(httpMethod = "GET", value = "消防炮信息", notes = "消防炮信息")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@RequestMapping(value ="/monitor", method = RequestMethod.GET)
public ResponseModel getFireMonitorInfo() {
List<Map<String, Object>> list = equipmentInfoOnPlanService.getFireMonitorInfo();
return ResponseHelper.buildResponse(list);
}
@ApiOperation(httpMethod = "GET", value = "消防泵信息", notes = "消防泵信息")
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value ="/pump")
public ResponseModel getFirePumpInfo() {
List<Map<String, Object>> list = equipmentInfoOnPlanService.getFirePumpInfo();
return CommonResponseUtil.success(list);
}
}
...@@ -10,6 +10,7 @@ import com.yeejoin.equipmanage.common.entity.*; ...@@ -10,6 +10,7 @@ import com.yeejoin.equipmanage.common.entity.*;
import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO; import com.yeejoin.equipmanage.common.entity.dto.EquipmentSpecificDTO;
import com.yeejoin.equipmanage.common.entity.vo.*; import com.yeejoin.equipmanage.common.entity.vo.*;
import com.yeejoin.equipmanage.common.vo.*; import com.yeejoin.equipmanage.common.vo.*;
import liquibase.pro.packaged.M;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -201,4 +202,7 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -201,4 +202,7 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
List<Map<String,String>> getStationInfo(); List<Map<String,String>> getStationInfo();
List<EquiplistSpecificBySystemVO> getListByWarehouseStructureId(Long floorId); List<EquiplistSpecificBySystemVO> getListByWarehouseStructureId(Long floorId);
List<Map<String, Object>> getFireMonitorOrFirePumpInfo(@Param("list") String[] strings);
} }
package com.yeejoin.equipmanage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Map;
/**
* @author keyong
* @title: EquipmentInfoOnPlanService
* <pre>
* @description: TODO
* </pre>
* @date 2022/5/12 11:43
*/
public interface IEquipmentInfoOnPlanService {
/**
* 消防炮信息
* @return
*/
List<Map<String, Object>> getFireMonitorInfo();
/**
* 消防泵信息
* @return
*/
List<Map<String, Object>> getFirePumpInfo();
}
package com.yeejoin.equipmanage.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yeejoin.equipmanage.mapper.EquipmentSpecificMapper;
import com.yeejoin.equipmanage.service.IEquipmentInfoOnPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
* @author keyong
* @title: EquipmentInfoOnPlanServiceImpl
* <pre>
* @description: TODO
* </pre>
* @date 2022/5/12 11:43
*/
@Service("EquipmentInfoOnPlanService")
public class EquipmentInfoOnPlanServiceImpl implements IEquipmentInfoOnPlanService {
@Autowired
EquipmentSpecificMapper equipmentSpecificMapper;
@Value("${equipment.plan.monitor}")
String monitorCodes;
@Value("${equipment.plan.pump}")
String pumpCodes;
@Override
public List<Map<String, Object>> getFireMonitorInfo() {
String[] strings = monitorCodes.split(",");
return equipmentSpecificMapper.getFireMonitorOrFirePumpInfo(strings);
}
@Override
public List<Map<String, Object>> getFirePumpInfo() {
String[] strings = pumpCodes.split(",");
return equipmentSpecificMapper.getFireMonitorOrFirePumpInfo(strings);
}
}
...@@ -1626,6 +1626,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -1626,6 +1626,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
es.setRealtimeIotIndexValue(index.getValue()); es.setRealtimeIotIndexValue(index.getValue());
es.setRealtimeIotIndexId(index.getEquipmentIndexId()); es.setRealtimeIotIndexId(index.getEquipmentIndexId());
es.setRealtimeIotIndexUpdateDate(index.getUpdateDate()); es.setRealtimeIotIndexUpdateDate(index.getUpdateDate());
es.setValueLabel(index.getValueLabel());
equipmentSpecificMapper.updateById(es); equipmentSpecificMapper.updateById(es);
} }
} }
......
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url = jdbc:mysql://172.16.11.201:3306/autosys_business_v3.0.1.3?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai spring.datasource.url = jdbc:mysql://172.16.11.201:3306/dl_business_v3.0.1.3?useUnicode=true&allowMultiQueries=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai
spring.datasource.username=root spring.datasource.username=root
spring.datasource.password=Yeejoin@2020 spring.datasource.password=Yeejoin@2020
spring.datasource.type=com.zaxxer.hikari.HikariDataSource spring.datasource.type=com.zaxxer.hikari.HikariDataSource
...@@ -73,3 +73,7 @@ param.nrvideo.url=http://198.87.103.158:8001; ...@@ -73,3 +73,7 @@ param.nrvideo.url=http://198.87.103.158:8001;
#南瑞视频平台通过视频id获取flv格式视频播放地址 #南瑞视频平台通过视频id获取flv格式视频播放地址
param.nrflvbyvoideoid.url=http://192.168.4.159:10010/api/media/live param.nrflvbyvoideoid.url=http://192.168.4.159:10010/api/media/live
# 预案消防炮、消防泵设备维度类型
equipment.plan.monitor=92030200,92032200
equipment.plan.pump=92010600,92030600,92130400,92140200,92150300
...@@ -2391,4 +2391,29 @@ ...@@ -2391,4 +2391,29 @@
) > 0; ) > 0;
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="keyong" id="1652339928-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="wl_equipment_specific" columnName="value_label"/>
</not>
</preConditions>
<comment>wl_equipment_specific add column value_label</comment>
<sql>
alter table `wl_equipment_specific` add column `value_label` varchar(255) DEFAULT NULL COMMENT '设备值说明' after `realtime_iot_index_value`;
</sql>
</changeSet>
<changeSet author="keyong" id="1652339928-2">
<preConditions onFail="MARK_RAN">
<tableExists tableName="wl_equipment_specific" />
</preConditions>
<comment>wl_equipment_specific同步value_label列数据</comment>
<sql>
UPDATE
wl_equipment_specific wes
SET
wes.value_label = ( SELECT value_label FROM wl_equipment_specific_index wesi
WHERE
wesi.equipment_specific_id = wes.id AND wesi.equipment_index_id = wes.realtime_iot_index_id );
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -1498,4 +1498,28 @@ ...@@ -1498,4 +1498,28 @@
WHERE WHERE
det.amount > 0 and spe.warehouse_structure_id =#{floorId} det.amount > 0 and spe.warehouse_structure_id =#{floorId}
</select> </select>
<select id="getFireMonitorOrFirePumpInfo" resultType="Map">
SELECT
wes.name,
wes.position,
wes.equipment_code equipmentCode,
wes.realtime_iot_index_name realtimeIotIndexName,
wes.realtime_iot_index_key realtimeIotIndexKey,
wes.realtime_iot_index_value realtimeIotIndexValue,
wes.value_label valueLabel,
wes.realtime_iot_es_index_id realtimeIotSpecificIndexId,
wes.realtime_iot_index_update_date realtiemIotIndexUpdateDate,
wes.realtime_iot_index_id realtimeIotIndexId
FROM
wl_equipment_specific wes
<where>
<if test="list != null and list.length > 0">
<foreach collection="list" item="item" index="index" open="(" close=")" separator="OR">
wes.equipment_code LIKE <![CDATA[CONCAT(#{item},'%')]]>
</foreach>
</if>
</where>
ORDER BY realtiemIotIndexUpdateDate DESC
</select>
</mapper> </mapper>
\ No newline at end of file
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