配置下发修改
This commit is contained in:
parent
205ee8b56f
commit
098e1331ef
@ -28,7 +28,9 @@ public interface SysImptabmappingMapper extends BaseMapperPlus<SysImptabmapping,
|
|||||||
|
|
||||||
List<Long> getEquipmentId(Long linkId);
|
List<Long> getEquipmentId(Long linkId);
|
||||||
|
|
||||||
List<IotModelVo> getIotModelFieldByEquipmentId(Long equipmentId);
|
List<IotModelVo> getIotModelFieldByDeviceId(@Param("deviceId") Long deviceId);
|
||||||
|
|
||||||
|
List<IotModelVo> getIotModelServiceByDeviceId(@Param("deviceId") Long deviceId);
|
||||||
|
|
||||||
List<IotModelVo> getIotModelServiceByEquipmentId(Long equipmentId);
|
List<IotModelVo> getIotModelServiceByEquipmentId(Long equipmentId);
|
||||||
|
|
||||||
|
@ -142,10 +142,11 @@ public class DataServiceImpl implements DataService {
|
|||||||
List<NewIotModelVo> newIotModelFieldList = new ArrayList<>();
|
List<NewIotModelVo> newIotModelFieldList = new ArrayList<>();
|
||||||
List<NewIotModelVo> newIotModelServiceList = new ArrayList<>();
|
List<NewIotModelVo> newIotModelServiceList = new ArrayList<>();
|
||||||
// 根据设备Id获取对应的物模型属性和动作
|
// 根据设备Id获取对应的物模型属性和动作
|
||||||
List<IotModelVo> iotModelFieldList = sysImptabmappingMapper.getIotModelFieldByEquipmentId(equipmentId);
|
List<IotModelVo> iotModelFieldList = sysImptabmappingMapper.getIotModelFieldByDeviceId(equipmentId);
|
||||||
|
List<IotModelVo> iotModelServiceList = sysImptabmappingMapper.getIotModelServiceByDeviceId(equipmentId);
|
||||||
if (!CollectionUtils.isEmpty(iotModelFieldList)) {
|
if (!CollectionUtils.isEmpty(iotModelFieldList)) {
|
||||||
for (IotModelVo info : iotModelFieldList) {
|
for (IotModelVo info : iotModelFieldList) {
|
||||||
if (info.getServiceType() == null) {
|
|
||||||
NewIotModelVo newIotModelVo = new NewIotModelVo();
|
NewIotModelVo newIotModelVo = new NewIotModelVo();
|
||||||
newIotModelVo.setName(info.getEquipmentAttribute());
|
newIotModelVo.setName(info.getEquipmentAttribute());
|
||||||
newIotModelVo.setHighSpeed(info.getHighSpeed());
|
newIotModelVo.setHighSpeed(info.getHighSpeed());
|
||||||
@ -162,7 +163,10 @@ public class DataServiceImpl implements DataService {
|
|||||||
newIotModelVo.setType("yx");
|
newIotModelVo.setType("yx");
|
||||||
}
|
}
|
||||||
newIotModelFieldList.add(newIotModelVo);
|
newIotModelFieldList.add(newIotModelVo);
|
||||||
} else if (info.getAttributeType() == null) {
|
}
|
||||||
|
}
|
||||||
|
if (!CollectionUtils.isEmpty(iotModelServiceList)){
|
||||||
|
for (IotModelVo info : iotModelServiceList) {
|
||||||
NewIotModelVo newIotModelVo = new NewIotModelVo();
|
NewIotModelVo newIotModelVo = new NewIotModelVo();
|
||||||
newIotModelVo.setName(info.getEquipmentService());
|
newIotModelVo.setName(info.getEquipmentService());
|
||||||
if (info.getParams() == null) {
|
if (info.getParams() == null) {
|
||||||
@ -178,7 +182,6 @@ public class DataServiceImpl implements DataService {
|
|||||||
newIotModelServiceList.add(newIotModelVo);
|
newIotModelServiceList.add(newIotModelVo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
EquipmentVo equipment = new EquipmentVo();
|
EquipmentVo equipment = new EquipmentVo();
|
||||||
equipment.setAddr(iotModelFieldList.get(0).getIotAddr());
|
equipment.setAddr(iotModelFieldList.get(0).getIotAddr());
|
||||||
equipment.setId(equipmentId);
|
equipment.setId(equipmentId);
|
||||||
|
@ -58,14 +58,6 @@
|
|||||||
where sc.id = #{linkId}
|
where sc.id = #{linkId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getIotModelFieldByEquipmentId" resultType="com.das.modules.node.domain.vo.IotModelVo">
|
|
||||||
select simf.attribute_type as attributeType,sims.service_type as serviceType, se.iot_addr as iotAddr,si.equipment_attribute as equipmentAttribute,si.equipment_service as equipmentService, si.params, simf.highspeed as highSpeed from sys_imptabmapping si
|
|
||||||
left join sys_equipment se on si.equipment_id = se.id
|
|
||||||
left join sys_iot_model_field simf on si.equipment_attribute = simf.attribute_code and se.iot_model_id = simf.iot_model_id
|
|
||||||
left join sys_iot_model_service sims on si.equipment_service = sims.service_code and se.iot_model_id = sims.iot_model_id
|
|
||||||
where si.equipment_id = #{equipmentId}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
|
||||||
<select id="getIotModelServiceByEquipmentId" resultType="com.das.modules.node.domain.vo.IotModelVo">
|
<select id="getIotModelServiceByEquipmentId" resultType="com.das.modules.node.domain.vo.IotModelVo">
|
||||||
select sims.service_code as name ,sims.service_type as type ,si.params from sys_imptabmapping si
|
select sims.service_code as name ,sims.service_type as type ,si.params from sys_imptabmapping si
|
||||||
@ -95,5 +87,33 @@
|
|||||||
left join sys_equipment se on si.equipment_id = se.id
|
left join sys_equipment se on si.equipment_id = se.id
|
||||||
where si.link_id = #{linkId}
|
where si.link_id = #{linkId}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getIotModelFieldByDeviceId" resultType="com.das.modules.node.domain.vo.IotModelVo">
|
||||||
|
select
|
||||||
|
field.attribute_type as attributeType,
|
||||||
|
null as serviceType,
|
||||||
|
(select iot_addr from sys_equipment e where e.id=1846101273013739522) as iot_addr,
|
||||||
|
field.attribute_code as equipmentAttribute,
|
||||||
|
null as equipmentService,
|
||||||
|
si.params,
|
||||||
|
field.highspeed
|
||||||
|
from sys_iot_model_field field
|
||||||
|
left join sys_imptabmapping si on (field.attribute_code=si.equipment_attribute)
|
||||||
|
where field.iot_model_id = (select equip.iot_model_id from sys_equipment equip where equip.id = #{deviceId}) and si.equipment_id = #{deviceId}
|
||||||
|
order by field.attribute_type ,field.porder
|
||||||
|
</select>
|
||||||
|
<select id="getIotModelServiceByDeviceId" resultType="com.das.modules.node.domain.vo.IotModelVo">
|
||||||
|
select
|
||||||
|
null as attributeType,
|
||||||
|
service.service_type as serviceType,
|
||||||
|
(select iot_addr from sys_equipment e where e.id=1846101273013739522) as iot_addr,
|
||||||
|
null as equipmentAttribute,
|
||||||
|
service.service_code as equipmentService,
|
||||||
|
si.params,
|
||||||
|
null as highspeed
|
||||||
|
from sys_iot_model_service service
|
||||||
|
left join sys_imptabmapping si on (service.service_code=si.equipment_service)
|
||||||
|
where service.iot_model_id = (select equip.iot_model_id from sys_equipment equip where equip.id = #{deviceId}) and si.equipment_id = #{deviceId}
|
||||||
|
order by service.service_type ,service.porder
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user