From 6e97c6c3f96a921a51173ae4f67bbce24b4ceeec Mon Sep 17 00:00:00 2001 From: xiaoCJ <406612557@qq.com> Date: Tue, 22 Oct 2024 17:01:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B5=84=E6=BA=90=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/CaseController.java | 1 - .../controller/api/CaseApi.java | 7 +- .../controller/api/ResourceApi.java | 5 +- src/main/resources/generatorConfig.xml | 4 +- .../resources/mapper/SysResourceMapper.xml | 859 +++++++++--------- 5 files changed, 443 insertions(+), 433 deletions(-) diff --git a/src/main/java/com/sztzjy/resource_center/controller/CaseController.java b/src/main/java/com/sztzjy/resource_center/controller/CaseController.java index 368a554..59afb25 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/CaseController.java +++ b/src/main/java/com/sztzjy/resource_center/controller/CaseController.java @@ -254,7 +254,6 @@ public class CaseController { } @AnonymousAccess - @ApiOperation("批量绑定案例题") @PostMapping("batchBindCase") public ResultEntity batchBindCase(@ApiParam("传全部参数") @RequestBody List sysTopicAndCourse) { try { diff --git a/src/main/java/com/sztzjy/resource_center/controller/api/CaseApi.java b/src/main/java/com/sztzjy/resource_center/controller/api/CaseApi.java index 8e31e6e..07d670e 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/api/CaseApi.java +++ b/src/main/java/com/sztzjy/resource_center/controller/api/CaseApi.java @@ -113,7 +113,7 @@ public class CaseApi { @RequestParam(required = false) String schoolId) { SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); String oneId = sysOneCatalogs.getOneId(); - List list = caseQuestionMapper.selectCaseByConditions(keyword, oneId, schoolId,null,null); + List list = caseQuestionMapper.selectCaseByConditions(keyword, oneId, schoolId, null, null); PageInfo pageInfo1 = PageUtil.pageHelper(list, index, size); return pageInfo1; } @@ -318,7 +318,7 @@ public class CaseApi { @ApiOperation("查询案例题步骤并排序") @AnonymousAccess public List selectCaseStepListBatchByIdListAndSort(@RequestParam String threeId) { - return caseQuestionStepMapper.selectCaseStepListBatchByIdListAndSort(threeId); + return caseQuestionStepMapper.selectCaseStepListBatchByIdListAndSort(threeId); } @@ -398,6 +398,9 @@ public class CaseApi { public List selectAllStepBySystemOwner(@RequestParam String systemOwner) { SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); List ids = topicAndCourseMapper.getCaseIdsBySourceIsAdmin(sysOneCatalogs.getOneId()); + if (ids == null || ids.isEmpty()) { + return new ArrayList<>(); //直接返回null学生端会报错 + } return caseQuestionStepMapper.getCaseStepByIds(ids); } diff --git a/src/main/java/com/sztzjy/resource_center/controller/api/ResourceApi.java b/src/main/java/com/sztzjy/resource_center/controller/api/ResourceApi.java index 90e3b32..26aeb31 100644 --- a/src/main/java/com/sztzjy/resource_center/controller/api/ResourceApi.java +++ b/src/main/java/com/sztzjy/resource_center/controller/api/ResourceApi.java @@ -141,10 +141,11 @@ public class ResourceApi { @AnonymousAccess @ApiOperation("根据章节查看资源文件列表") @PostMapping("selectResourceByChapterId") + //cf0954f2-3e6d-472b-b5eb-1a986f40f329 三级 //69fbffb4-2f1a-4faf-aa26-c4621a4851ba 一级 public List selectResourceByChapterId(@RequestParam String oneId, //这里传的是一级的名称 - @RequestParam String threeId) { + @RequestParam(required = false) String threeId) { SysOneCatalog sysOneCatalogs = getSysOneCatalogs(oneId); - return sysResourceMapper.selectResource(sysOneCatalogs.getOneId(), null, null, threeId, null); + return sysResourceMapper.selectResource(sysOneCatalogs.getOneId(), null, threeId, null, null); } diff --git a/src/main/resources/generatorConfig.xml b/src/main/resources/generatorConfig.xml index 718d157..c5899f7 100644 --- a/src/main/resources/generatorConfig.xml +++ b/src/main/resources/generatorConfig.xml @@ -53,12 +53,12 @@ - + - +
diff --git a/src/main/resources/mapper/SysResourceMapper.xml b/src/main/resources/mapper/SysResourceMapper.xml index 1f81437..dae73b6 100644 --- a/src/main/resources/mapper/SysResourceMapper.xml +++ b/src/main/resources/mapper/SysResourceMapper.xml @@ -1,450 +1,457 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - - - - - - - - and ${criterion.condition} - - - and ${criterion.condition} #{criterion.value} - - - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - - - and ${criterion.condition} - - #{listItem} - - - + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + - - - - - - - resource_id, resource_name, url, picture_url, resource_type, source, one_tag, one_name, + + + + resource_id + , resource_name, url, picture_url, resource_type, source, one_tag, one_name, two_tag, two_name, three_tag, three_name, count, status, create_time - - - - - delete from sys_resource - where resource_id = #{resourceId,jdbcType=VARCHAR} - - - delete from sys_resource - - - - - - insert into sys_resource (resource_id, resource_name, url, - picture_url, resource_type, source, - one_tag, one_name, two_tag, - two_name, three_tag, three_name, - count, status, create_time - ) - values (#{resourceId,jdbcType=VARCHAR}, #{resourceName,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, - #{pictureUrl,jdbcType=VARCHAR}, #{resourceType,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, - #{oneTag,jdbcType=VARCHAR}, #{oneName,jdbcType=VARCHAR}, #{twoTag,jdbcType=VARCHAR}, - #{twoName,jdbcType=VARCHAR}, #{threeTag,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR}, - #{count,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP} - ) - - - insert into sys_resource - - - resource_id, - - - resource_name, - - - url, - - - picture_url, - - - resource_type, - - - source, - - - one_tag, - - - one_name, - - - two_tag, - - - two_name, - - - three_tag, - - - three_name, - - - count, - - - status, - - - create_time, - - - - - #{resourceId,jdbcType=VARCHAR}, - - - #{resourceName,jdbcType=VARCHAR}, - - - #{url,jdbcType=VARCHAR}, - - - #{pictureUrl,jdbcType=VARCHAR}, - - - #{resourceType,jdbcType=VARCHAR}, - - - #{source,jdbcType=VARCHAR}, - - - #{oneTag,jdbcType=VARCHAR}, - - - #{oneName,jdbcType=VARCHAR}, - - - #{twoTag,jdbcType=VARCHAR}, - - - #{twoName,jdbcType=VARCHAR}, - - - #{threeTag,jdbcType=VARCHAR}, - - - #{threeName,jdbcType=VARCHAR}, - - - #{count,jdbcType=INTEGER}, - - - #{status,jdbcType=INTEGER}, - - - #{createTime,jdbcType=TIMESTAMP}, - - - - - - update sys_resource - - - resource_id = #{record.resourceId,jdbcType=VARCHAR}, - - + + + + + delete + from sys_resource + where resource_id = #{resourceId,jdbcType=VARCHAR} + + + delete from sys_resource + + + + + + insert into sys_resource (resource_id, resource_name, url, + picture_url, resource_type, source, + one_tag, one_name, two_tag, + two_name, three_tag, three_name, + count, status, create_time) + values (#{resourceId,jdbcType=VARCHAR}, #{resourceName,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, + #{pictureUrl,jdbcType=VARCHAR}, #{resourceType,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, + #{oneTag,jdbcType=VARCHAR}, #{oneName,jdbcType=VARCHAR}, #{twoTag,jdbcType=VARCHAR}, + #{twoName,jdbcType=VARCHAR}, #{threeTag,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR}, + #{count,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}) + + + insert into sys_resource + + + resource_id, + + + resource_name, + + + url, + + + picture_url, + + + resource_type, + + + source, + + + one_tag, + + + one_name, + + + two_tag, + + + two_name, + + + three_tag, + + + three_name, + + + count, + + + status, + + + create_time, + + + + + #{resourceId,jdbcType=VARCHAR}, + + + #{resourceName,jdbcType=VARCHAR}, + + + #{url,jdbcType=VARCHAR}, + + + #{pictureUrl,jdbcType=VARCHAR}, + + + #{resourceType,jdbcType=VARCHAR}, + + + #{source,jdbcType=VARCHAR}, + + + #{oneTag,jdbcType=VARCHAR}, + + + #{oneName,jdbcType=VARCHAR}, + + + #{twoTag,jdbcType=VARCHAR}, + + + #{twoName,jdbcType=VARCHAR}, + + + #{threeTag,jdbcType=VARCHAR}, + + + #{threeName,jdbcType=VARCHAR}, + + + #{count,jdbcType=INTEGER}, + + + #{status,jdbcType=INTEGER}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + + + + update sys_resource + + + resource_id = #{record.resourceId,jdbcType=VARCHAR}, + + + resource_name = #{record.resourceName,jdbcType=VARCHAR}, + + + url = #{record.url,jdbcType=VARCHAR}, + + + picture_url = #{record.pictureUrl,jdbcType=VARCHAR}, + + + resource_type = #{record.resourceType,jdbcType=VARCHAR}, + + + source = #{record.source,jdbcType=VARCHAR}, + + + one_tag = #{record.oneTag,jdbcType=VARCHAR}, + + + one_name = #{record.oneName,jdbcType=VARCHAR}, + + + two_tag = #{record.twoTag,jdbcType=VARCHAR}, + + + two_name = #{record.twoName,jdbcType=VARCHAR}, + + + three_tag = #{record.threeTag,jdbcType=VARCHAR}, + + + three_name = #{record.threeName,jdbcType=VARCHAR}, + + + count = #{record.count,jdbcType=INTEGER}, + + + status = #{record.status,jdbcType=INTEGER}, + + + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + + + + + + + + update sys_resource + set resource_id = #{record.resourceId,jdbcType=VARCHAR}, resource_name = #{record.resourceName,jdbcType=VARCHAR}, - - url = #{record.url,jdbcType=VARCHAR}, - - picture_url = #{record.pictureUrl,jdbcType=VARCHAR}, - - resource_type = #{record.resourceType,jdbcType=VARCHAR}, - - source = #{record.source,jdbcType=VARCHAR}, - - one_tag = #{record.oneTag,jdbcType=VARCHAR}, - - one_name = #{record.oneName,jdbcType=VARCHAR}, - - two_tag = #{record.twoTag,jdbcType=VARCHAR}, - - two_name = #{record.twoName,jdbcType=VARCHAR}, - - three_tag = #{record.threeTag,jdbcType=VARCHAR}, - - three_name = #{record.threeName,jdbcType=VARCHAR}, - - count = #{record.count,jdbcType=INTEGER}, - - status = #{record.status,jdbcType=INTEGER}, - - - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - - - - - - - - update sys_resource - set resource_id = #{record.resourceId,jdbcType=VARCHAR}, - resource_name = #{record.resourceName,jdbcType=VARCHAR}, - url = #{record.url,jdbcType=VARCHAR}, - picture_url = #{record.pictureUrl,jdbcType=VARCHAR}, - resource_type = #{record.resourceType,jdbcType=VARCHAR}, - source = #{record.source,jdbcType=VARCHAR}, - one_tag = #{record.oneTag,jdbcType=VARCHAR}, - one_name = #{record.oneName,jdbcType=VARCHAR}, - two_tag = #{record.twoTag,jdbcType=VARCHAR}, - two_name = #{record.twoName,jdbcType=VARCHAR}, - three_tag = #{record.threeTag,jdbcType=VARCHAR}, - three_name = #{record.threeName,jdbcType=VARCHAR}, - count = #{record.count,jdbcType=INTEGER}, - status = #{record.status,jdbcType=INTEGER}, - create_time = #{record.createTime,jdbcType=TIMESTAMP} - - - - - - update sys_resource - - - resource_name = #{resourceName,jdbcType=VARCHAR}, - - - url = #{url,jdbcType=VARCHAR}, - - - picture_url = #{pictureUrl,jdbcType=VARCHAR}, - - - resource_type = #{resourceType,jdbcType=VARCHAR}, - - - source = #{source,jdbcType=VARCHAR}, - - - one_tag = #{oneTag,jdbcType=VARCHAR}, - - - one_name = #{oneName,jdbcType=VARCHAR}, - - - two_tag = #{twoTag,jdbcType=VARCHAR}, - - - two_name = #{twoName,jdbcType=VARCHAR}, - - - three_tag = #{threeTag,jdbcType=VARCHAR}, - - - three_name = #{threeName,jdbcType=VARCHAR}, - - - count = #{count,jdbcType=INTEGER}, - - - status = #{status,jdbcType=INTEGER}, - - - create_time = #{createTime,jdbcType=TIMESTAMP}, - - - where resource_id = #{resourceId,jdbcType=VARCHAR} - - - update sys_resource - set resource_name = #{resourceName,jdbcType=VARCHAR}, - url = #{url,jdbcType=VARCHAR}, - picture_url = #{pictureUrl,jdbcType=VARCHAR}, - resource_type = #{resourceType,jdbcType=VARCHAR}, - source = #{source,jdbcType=VARCHAR}, - one_tag = #{oneTag,jdbcType=VARCHAR}, - one_name = #{oneName,jdbcType=VARCHAR}, - two_tag = #{twoTag,jdbcType=VARCHAR}, - two_name = #{twoName,jdbcType=VARCHAR}, - three_tag = #{threeTag,jdbcType=VARCHAR}, - three_name = #{threeName,jdbcType=VARCHAR}, - count = #{count,jdbcType=INTEGER}, - status = #{status,jdbcType=INTEGER}, - create_time = #{createTime,jdbcType=TIMESTAMP} - where resource_id = #{resourceId,jdbcType=VARCHAR} - + create_time = #{record.createTime,jdbcType=TIMESTAMP} + + + + + + update sys_resource + + + resource_name = #{resourceName,jdbcType=VARCHAR}, + + + url = #{url,jdbcType=VARCHAR}, + + + picture_url = #{pictureUrl,jdbcType=VARCHAR}, + + + resource_type = #{resourceType,jdbcType=VARCHAR}, + + + source = #{source,jdbcType=VARCHAR}, + + + one_tag = #{oneTag,jdbcType=VARCHAR}, + + + one_name = #{oneName,jdbcType=VARCHAR}, + + + two_tag = #{twoTag,jdbcType=VARCHAR}, + + + two_name = #{twoName,jdbcType=VARCHAR}, + + + three_tag = #{threeTag,jdbcType=VARCHAR}, + + + three_name = #{threeName,jdbcType=VARCHAR}, + + + count = #{count,jdbcType=INTEGER}, + + + status = #{status,jdbcType=INTEGER}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + where resource_id = #{resourceId,jdbcType=VARCHAR} + + + update sys_resource + set resource_name = #{resourceName,jdbcType=VARCHAR}, + url = #{url,jdbcType=VARCHAR}, + picture_url = #{pictureUrl,jdbcType=VARCHAR}, + resource_type = #{resourceType,jdbcType=VARCHAR}, + source = #{source,jdbcType=VARCHAR}, + one_tag = #{oneTag,jdbcType=VARCHAR}, + one_name = #{oneName,jdbcType=VARCHAR}, + two_tag = #{twoTag,jdbcType=VARCHAR}, + two_name = #{twoName,jdbcType=VARCHAR}, + three_tag = #{threeTag,jdbcType=VARCHAR}, + three_name = #{threeName,jdbcType=VARCHAR}, + count = #{count,jdbcType=INTEGER}, + status = #{status,jdbcType=INTEGER}, + create_time = #{createTime,jdbcType=TIMESTAMP} + where resource_id = #{resourceId,jdbcType=VARCHAR} + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + - - + + - - + - - \ No newline at end of file