| @@ -36,7 +36,10 @@ public class ComputingResourceController extends BaseController { | |||||
| */ | */ | ||||
| @GetMapping | @GetMapping | ||||
| @ApiOperation("分页查询") | @ApiOperation("分页查询") | ||||
| public GenericsAjaxResult<Page<ComputingResource>> queryByPage(ComputingResource computingResource, int page, int size) { | |||||
| public GenericsAjaxResult<Page<ComputingResource>> 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); | PageRequest pageRequest = PageRequest.of(page,size); | ||||
| return genericsSuccess(this.computingResourceService.queryByPage(computingResource, pageRequest)); | return genericsSuccess(this.computingResourceService.queryByPage(computingResource, pageRequest)); | ||||
| } | } | ||||
| @@ -71,7 +71,7 @@ public interface ComputingResourceDao { | |||||
| * @param computingResource 实例对象 | * @param computingResource 实例对象 | ||||
| * @return 影响行数 | * @return 影响行数 | ||||
| */ | */ | ||||
| int update(ComputingResource computingResource); | |||||
| int update(@Param("computingResource") ComputingResource computingResource); | |||||
| /** | /** | ||||
| * 通过主键删除数据 | * 通过主键删除数据 | ||||
| @@ -268,7 +268,7 @@ public class DatasetServiceImpl implements DatasetService { | |||||
| // 获取所有相同模型ID的记录 | // 获取所有相同模型ID的记录 | ||||
| List<DatasetVersion> versions = datasetVersionDao.queryByDatasetId(datasetId); | List<DatasetVersion> versions = datasetVersionDao.queryByDatasetId(datasetId); | ||||
| if (versions.isEmpty()) { | if (versions.isEmpty()) { | ||||
| throw new Exception("未找到相关数据集版本记录"); | |||||
| return new ArrayList<>(); // 如果没有找到任何版本记录,返回空列表 | |||||
| } | } | ||||
| // 使用Stream API提取version字段,并去重 | // 使用Stream API提取version字段,并去重 | ||||
| return versions.stream() | return versions.stream() | ||||
| @@ -317,10 +317,8 @@ public class ModelsServiceImpl implements ModelsService { | |||||
| List<ModelsVersion> versions = modelsVersionDao.queryByModelsId(modelId); | List<ModelsVersion> versions = modelsVersionDao.queryByModelsId(modelId); | ||||
| if (versions.isEmpty()) { | if (versions.isEmpty()) { | ||||
| throw new Exception("未找到相关模型版本记录"); | |||||
| return new ArrayList<>(); // 如果没有找到任何版本记录,返回空列表 | |||||
| } | } | ||||
| // // 将结果按照版本分类 | |||||
| // return versions.stream().collect(Collectors.groupingBy(ModelsVersion::getVersion)); | |||||
| // 使用Stream API提取version字段,并去重 | // 使用Stream API提取version字段,并去重 | ||||
| return versions.stream() | return versions.stream() | ||||
| @@ -73,7 +73,7 @@ | |||||
| and computing_resource = #{computingResource.computingResource} | and computing_resource = #{computingResource.computingResource} | ||||
| </if> | </if> | ||||
| <if test="computingResource.standard != null and computingResource.standard != ''"> | <if test="computingResource.standard != null and computingResource.standard != ''"> | ||||
| and standard = #{computingResource.standard} | |||||
| and standard = #{computingResource.computingResource} | |||||
| </if> | </if> | ||||
| <if test="computingResource.description != null and computingResource.description != ''"> | <if test="computingResource.description != null and computingResource.description != ''"> | ||||
| and description = #{computingResource.description} | and description = #{computingResource.description} | ||||
| @@ -96,17 +96,17 @@ | |||||
| </where> | </where> | ||||
| </select> | </select> | ||||
| <!--新增所有列--> | |||||
| <insert id="insert" keyProperty="id" useGeneratedKeys="true"> | <insert id="insert" keyProperty="id" useGeneratedKeys="true"> | ||||
| 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> | </insert> | ||||
| <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> | ||||
| 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 | values | ||||
| <foreach collection="entities" item="entity" separator=","> | <foreach collection="entities" item="entity" separator=","> | ||||
| (#{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}) | |||||
| </foreach> | </foreach> | ||||
| </insert> | </insert> | ||||
| @@ -34,7 +34,7 @@ | |||||
| and img.id = #{image.id} | and img.id = #{image.id} | ||||
| </if> | </if> | ||||
| <if test="image.name != null and image.name != ''"> | <if test="image.name != null and image.name != ''"> | ||||
| and img.name like "%"#{image.name}"%" | |||||
| and img.name like concat('%', #{image.name}, '%') | |||||
| </if> | </if> | ||||
| <if test="image.description != null and image.description != ''"> | <if test="image.description != null and image.description != ''"> | ||||
| and img.description = #{image.description} | and img.description = #{image.description} | ||||
| @@ -86,7 +86,7 @@ | |||||
| and id = #{image.id} | and id = #{image.id} | ||||
| </if> | </if> | ||||
| <if test="image.name != null and image.name != ''"> | <if test="image.name != null and image.name != ''"> | ||||
| and name like "%"#{image.name}"%" | |||||
| and name like concat('%', #{image.name}, '%') | |||||
| </if> | </if> | ||||
| <if test="image.description != null and image.description != ''"> | <if test="image.description != null and image.description != ''"> | ||||
| and description = #{image.description} | and description = #{image.description} | ||||