Commit 9d624969 authored by tangwei's avatar tangwei

修改装备归属

parent e0d4a558
...@@ -249,4 +249,6 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> { ...@@ -249,4 +249,6 @@ public interface EquipmentSpecificMapper extends BaseMapper<EquipmentSpecific> {
List<FireFightingSystemDto> fireSysIotEquipAlarmCount(Date date, String bizOrgCode); List<FireFightingSystemDto> fireSysIotEquipAlarmCount(Date date, String bizOrgCode);
List<Map> getwater(@Param("id") Long id); List<Map> getwater(@Param("id") Long id);
Map<String, Object> getStationCode(@Param("id")Long id);
} }
...@@ -269,4 +269,6 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> { ...@@ -269,4 +269,6 @@ public interface IEquipmentSpecificSerivce extends IService<EquipmentSpecific> {
List<Map> getwater(Long id); List<Map> getwater(Long id);
Map<String,Object> getStationCode(Long id);
} }
...@@ -2044,4 +2044,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM ...@@ -2044,4 +2044,9 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
public List<Map> getwater(Long id) { public List<Map> getwater(Long id) {
return equipmentSpecificMapper.getwater(id); return equipmentSpecificMapper.getwater(id);
} }
@Override
public Map<String, Object> getStationCode(Long id) {
return equipmentSpecificMapper.getStationCode(id);
}
} }
...@@ -918,8 +918,14 @@ public class MqttReceiveServiceImpl implements MqttReceiveService { ...@@ -918,8 +918,14 @@ public class MqttReceiveServiceImpl implements MqttReceiveService {
equipmentSpecificAlarmLog.setId(null); equipmentSpecificAlarmLog.setId(null);
equipmentSpecificAlarmLog.setCreateDate(new Date()); equipmentSpecificAlarmLog.setCreateDate(new Date());
equipmentSpecificAlarmLog.setEquipmentSpecificAlarmId(equipmentSpecificAlarm.getId()); equipmentSpecificAlarmLog.setEquipmentSpecificAlarmId(equipmentSpecificAlarm.getId());
equipmentSpecificAlarmLog.setStationCode(stationCode);
equipmentSpecificAlarmLog.setStationName(stationName); //调整为按照设备归属(可归属公司或者部门
Map<String,Object> mapd= iEquipmentSpecificSerivce.getStationCode(equipmentSpecificAlarm.getEquipmentSpecificId());
if(mapd!=null){
equipmentSpecificAlarmLog.setStationCode(mapd.get("station_code").toString());
equipmentSpecificAlarmLog.setStationName(mapd.get("station_name").toString());
}
boolean bool = equipmentSpecificAlarmLogService.save(equipmentSpecificAlarmLog); boolean bool = equipmentSpecificAlarmLogService.save(equipmentSpecificAlarmLog);
// 同步告警消息给平台 // 同步告警消息给平台
if (amosSwitch && bool) { if (amosSwitch && bool) {
......
...@@ -2195,4 +2195,22 @@ ...@@ -2195,4 +2195,22 @@
and ei.equipment_specific_id is not null and ei.equipment_specific_id is not null
and ei.equipment_specific_id =#{id} and ei.equipment_specific_id =#{id}
</select> </select>
<select id="getStationCode" resultType="java.util.Map">
SELECT
u.`station_code`,
u.`station_name`
from
(SELECT
s.`code` as station_code ,
b.biz_org_code,
b.biz_org_name as station_name
FROM
`idx_biz_station_info` s,
cb_org_usr b
where s.`code` = b.`code`) u
where LOCATE(u.biz_org_code, (SELECT wl_equipment_specific.biz_org_code FROM wl_equipment_specific WHERE wl_equipment_specific.id=#{id})) > 0
</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