This commit is contained in:
高云鹏 2024-12-18 10:44:06 +08:00
commit 5b667c1e72
5 changed files with 14 additions and 7 deletions

View File

@ -251,8 +251,12 @@ public class SysIotModelController {
/** 物模型属性修改 */ /** 物模型属性修改 */
@PostMapping("/attribute/getAllSubsystem") @PostMapping("/attribute/getAllSubsystem")
public R<List<String>> getAllSubsystem() { public R<List<String>> getAllSubsystem(@RequestBody SysIotModelFieldDto sysIotModelFieldDto) {
List<String> allSubsystem = sysIotModelService.getAllSubsystem(); Long iotModelId = sysIotModelFieldDto.getIotModelId();
if (iotModelId == null){
throw new ServiceException("参数物模型id不存在");
}
List<String> allSubsystem = sysIotModelService.getAllSubsystem(iotModelId);
return R.success(allSubsystem); return R.success(allSubsystem);
} }
} }

View File

@ -33,6 +33,6 @@ public interface SysIotModelFieldMapper extends BaseMapperPlus<SysIotModelField,
*/ */
List<SysIotModelFieldVo> selectModelFieldListByModelId(@Param("modelId") Long modelId); List<SysIotModelFieldVo> selectModelFieldListByModelId(@Param("modelId") Long modelId);
List<String> getAllSubsystem(); List<String> getAllSubsystem(@Param("modelId") Long iotModelId);
} }

View File

@ -47,6 +47,6 @@ public interface SysIotModelService {
List<SysIotModelVo> getSysIotModelByType(Integer objectType); List<SysIotModelVo> getSysIotModelByType(Integer objectType);
List<String> getAllSubsystem(); List<String> getAllSubsystem(Long iotModelId);
} }

View File

@ -146,10 +146,13 @@ public class SysIotModelServiceImpl implements SysIotModelService {
@Override @Override
public PageDataInfo<SysIotModelFieldVo> querySysIotModelField(SysIotModelFieldDto sysIotModelFieldDto) { public PageDataInfo<SysIotModelFieldVo> querySysIotModelField(SysIotModelFieldDto sysIotModelFieldDto) {
PageQuery pageQuery = new PageQuery(); PageQuery pageQuery = new PageQuery();
pageQuery.setPageNum(sysIotModelFieldDto.getPageNum()); pageQuery.setPageNum(sysIotModelFieldDto.getPageNum());
pageQuery.setPageSize(sysIotModelFieldDto.getPageSize()); pageQuery.setPageSize(sysIotModelFieldDto.getPageSize());
log.info("查询物模型属性参数:{}",sysIotModelFieldDto);
IPage<SysIotModelFieldVo> iPage = sysIotModelFieldMapper.querySysIotModelFieldList(pageQuery.build(), sysIotModelFieldDto); IPage<SysIotModelFieldVo> iPage = sysIotModelFieldMapper.querySysIotModelFieldList(pageQuery.build(), sysIotModelFieldDto);
log.info("查询物模型属性返回总数{}:{}",iPage.getTotal(),iPage.getRecords());
return PageDataInfo.build(iPage.getRecords(), iPage.getTotal()); return PageDataInfo.build(iPage.getRecords(), iPage.getTotal());
} }
@ -545,8 +548,8 @@ public class SysIotModelServiceImpl implements SysIotModelService {
} }
@Override @Override
public List<String> getAllSubsystem() { public List<String> getAllSubsystem(Long iotModelId) {
return sysIotModelFieldMapper.getAllSubsystem(); return sysIotModelFieldMapper.getAllSubsystem(iotModelId);
} }
public void createTdStableOrColumn(SysIotModelField sysIotModelField) { public void createTdStableOrColumn(SysIotModelField sysIotModelField) {

View File

@ -65,6 +65,6 @@
select * from sys_iot_model_field where iot_model_id = #{modelId} order by porder select * from sys_iot_model_field where iot_model_id = #{modelId} order by porder
</select> </select>
<select id="getAllSubsystem" resultType="java.lang.String"> <select id="getAllSubsystem" resultType="java.lang.String">
select distinct simf.subsystem from sys_iot_model_field simf select distinct simf.subsystem from sys_iot_model_field simf where simf.iot_model_id = #{modelId}
</select> </select>
</mapper> </mapper>