From 779aabe0abf5d1f4dceb56dd2dfab3319e9c5a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A5=BF=E5=A4=A7=E9=94=90?= <1070211640@qq.com> Date: Wed, 17 Apr 2024 14:53:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=8E=A5=E5=8F=A3=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E5=88=86=E9=A1=B5=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/ComputingResourceController.java | 5 ++++- .../ruoyi/platform/mapper/ComputingResourceDao.java | 2 +- .../platform/service/impl/DatasetServiceImpl.java | 2 +- .../platform/service/impl/ModelsServiceImpl.java | 4 +--- .../ComputingResourceDaoMapper.xml | 12 ++++++------ .../mapper/managementPlatform/ImageDaoMapper.xml | 4 ++-- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/resources/ComputingResourceController.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/resources/ComputingResourceController.java index 0e869970..aac53576 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/resources/ComputingResourceController.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/controller/resources/ComputingResourceController.java @@ -36,7 +36,10 @@ public class ComputingResourceController extends BaseController { */ @GetMapping @ApiOperation("分页查询") - public GenericsAjaxResult> queryByPage(ComputingResource computingResource, int page, int size) { + public GenericsAjaxResult> queryByPage(ComputingResource computingResource, @RequestParam("page") int page, + @RequestParam("size") int size, + @RequestParam(value = "resource_type") String resourceType ) { + computingResource.setComputingResource(resourceType); PageRequest pageRequest = PageRequest.of(page,size); return genericsSuccess(this.computingResourceService.queryByPage(computingResource, pageRequest)); } diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/ComputingResourceDao.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/ComputingResourceDao.java index 59211da5..b9a5de6d 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/ComputingResourceDao.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/mapper/ComputingResourceDao.java @@ -71,7 +71,7 @@ public interface ComputingResourceDao { * @param computingResource 实例对象 * @return 影响行数 */ - int update(ComputingResource computingResource); + int update(@Param("computingResource") ComputingResource computingResource); /** * 通过主键删除数据 diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DatasetServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DatasetServiceImpl.java index b7f19eee..58487bd8 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DatasetServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DatasetServiceImpl.java @@ -268,7 +268,7 @@ public class DatasetServiceImpl implements DatasetService { // 获取所有相同模型ID的记录 List versions = datasetVersionDao.queryByDatasetId(datasetId); if (versions.isEmpty()) { - throw new Exception("未找到相关数据集版本记录"); + return new ArrayList<>(); // 如果没有找到任何版本记录,返回空列表 } // 使用Stream API提取version字段,并去重 return versions.stream() diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java index 7461a1ff..653e9b76 100644 --- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java +++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java @@ -317,10 +317,8 @@ public class ModelsServiceImpl implements ModelsService { List versions = modelsVersionDao.queryByModelsId(modelId); if (versions.isEmpty()) { - throw new Exception("未找到相关模型版本记录"); + return new ArrayList<>(); // 如果没有找到任何版本记录,返回空列表 } -// // 将结果按照版本分类 -// return versions.stream().collect(Collectors.groupingBy(ModelsVersion::getVersion)); // 使用Stream API提取version字段,并去重 return versions.stream() diff --git a/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ComputingResourceDaoMapper.xml b/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ComputingResourceDaoMapper.xml index 68493fa0..885da316 100644 --- a/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ComputingResourceDaoMapper.xml +++ b/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ComputingResourceDaoMapper.xml @@ -73,7 +73,7 @@ and computing_resource = #{computingResource.computingResource} - and standard = #{computingResource.standard} + and standard = #{computingResource.computingResource} and description = #{computingResource.description} @@ -96,17 +96,17 @@ - - insert into computing_resource(computing_resourcestandarddescriptioncreate_bycreate_timeupdate_byupdate_timestate) - values (#{computingResource}#{standard}#{description}#{createBy}#{createTime}#{updateBy}#{updateTime}#{state}) + insert into computing_resource (computing_resource, standard, description, create_by, create_time, update_by, update_time, state) + values (#{computingResource.computingResource}, #{computingResource.standard}, #{computingResource.description}, #{computingResource.createBy}, #{computingResource.createTime}, #{computingResource.updateBy}, #{computingResource.updateTime}, #{computingResource.state}) + - insert into computing_resource(computing_resourcestandarddescriptioncreate_bycreate_timeupdate_byupdate_timestate) + insert into computing_resource(computing_resource,standard,description,create_by,create_time,update_by,update_time,state) values - (#{entity.computingResource}#{entity.standard}#{entity.description}#{entity.createBy}#{entity.createTime}#{entity.updateBy}#{entity.updateTime}#{entity.state}) + (#{entity.computingResource},#{entity.standard},#{entity.description},#{entity.createBy},#{entity.createTime},#{entity.updateBy},#{entity.updateTime},#{entity.state}) diff --git a/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ImageDaoMapper.xml b/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ImageDaoMapper.xml index d24545dc..4c9b4bd0 100644 --- a/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ImageDaoMapper.xml +++ b/ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ImageDaoMapper.xml @@ -34,7 +34,7 @@ and img.id = #{image.id} - and img.name like "%"#{image.name}"%" + and img.name like concat('%', #{image.name}, '%') and img.description = #{image.description} @@ -86,7 +86,7 @@ and id = #{image.id} - and name like "%"#{image.name}"%" + and name like concat('%', #{image.name}, '%') and description = #{image.description}