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<String> batchBindCase(@ApiParam("传全部参数") @RequestBody List<SysTopicAndCourse> 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<SysCaseQuestion> list = caseQuestionMapper.selectCaseByConditions(keyword, oneId, schoolId,null,null); + List<SysCaseQuestion> 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<SysCaseQuestionStepWithBLOBs> selectCaseStepListBatchByIdListAndSort(@RequestParam String threeId) { - return caseQuestionStepMapper.selectCaseStepListBatchByIdListAndSort(threeId); + return caseQuestionStepMapper.selectCaseStepListBatchByIdListAndSort(threeId); } @@ -398,6 +398,9 @@ public class CaseApi { public List<SysCaseQuestionStepWithBLOBs> selectAllStepBySystemOwner(@RequestParam String systemOwner) { SysOneCatalog sysOneCatalogs = getSysOneCatalogs(systemOwner); List<String> 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<SysResourceDto> 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 @@ <!-- <table tableName="sys_three_catalog" domainObjectName="SysThreeCatalog" />--> <!-- <table tableName="sys_topic_and_course" domainObjectName="SysTopicAndCourse" />--> <!-- <table tableName="admin_case" domainObjectName="AdminCase" />--> - <table tableName="admin_data" domainObjectName="AdminData" /> +<!-- <table tableName="admin_data" domainObjectName="AdminData" />--> <!-- <table tableName="admin_collect_case" domainObjectName="AdminCollectCase" />--> <!-- <table tableName="admin_collect_data" domainObjectName="AdminCollectData" />--> <!-- <table tableName="admin_data_label" domainObjectName="AdminDataLabel" />--> <!-- <table tableName="admin_file" domainObjectName="AdminFile" />--> -<!-- <table tableName="sys_knowledge_and_course" domainObjectName="SysKnowledgeAndCourse" />--> + <table tableName="sys_knowledge_and_course" domainObjectName="SysKnowledgeAndCourse" /> <!-- <table tableName="sys_knowledge_summary" domainObjectName="SysKnowledgeSummary" />--> <!-- <table tableName="sys_two_catalog" domainObjectName="SysTwoCatalog" />--> </context> 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 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.sztzjy.resource_center.mapper.SysResourceMapper"> - <resultMap id="BaseResultMap" type="com.sztzjy.resource_center.entity.SysResource"> - <id column="resource_id" jdbcType="VARCHAR" property="resourceId" /> - <result column="resource_name" jdbcType="VARCHAR" property="resourceName" /> - <result column="url" jdbcType="VARCHAR" property="url" /> - <result column="picture_url" jdbcType="VARCHAR" property="pictureUrl" /> - <result column="resource_type" jdbcType="VARCHAR" property="resourceType" /> - <result column="source" jdbcType="VARCHAR" property="source" /> - <result column="one_tag" jdbcType="VARCHAR" property="oneTag" /> - <result column="one_name" jdbcType="VARCHAR" property="oneName" /> - <result column="two_tag" jdbcType="VARCHAR" property="twoTag" /> - <result column="two_name" jdbcType="VARCHAR" property="twoName" /> - <result column="three_tag" jdbcType="VARCHAR" property="threeTag" /> - <result column="three_name" jdbcType="VARCHAR" property="threeName" /> - <result column="count" jdbcType="INTEGER" property="count" /> - <result column="status" jdbcType="INTEGER" property="status" /> - <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> - </resultMap> - <sql id="Example_Where_Clause"> - <where> - <foreach collection="oredCriteria" item="criteria" separator="or"> - <if test="criteria.valid"> - <trim prefix="(" prefixOverrides="and" suffix=")"> - <foreach collection="criteria.criteria" item="criterion"> - <choose> - <when test="criterion.noValue"> - and ${criterion.condition} - </when> - <when test="criterion.singleValue"> - and ${criterion.condition} #{criterion.value} - </when> - <when test="criterion.betweenValue"> - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - </when> - <when test="criterion.listValue"> - and ${criterion.condition} - <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> - #{listItem} - </foreach> - </when> - </choose> + <resultMap id="BaseResultMap" type="com.sztzjy.resource_center.entity.SysResource"> + <id column="resource_id" jdbcType="VARCHAR" property="resourceId"/> + <result column="resource_name" jdbcType="VARCHAR" property="resourceName"/> + <result column="url" jdbcType="VARCHAR" property="url"/> + <result column="picture_url" jdbcType="VARCHAR" property="pictureUrl"/> + <result column="resource_type" jdbcType="VARCHAR" property="resourceType"/> + <result column="source" jdbcType="VARCHAR" property="source"/> + <result column="one_tag" jdbcType="VARCHAR" property="oneTag"/> + <result column="one_name" jdbcType="VARCHAR" property="oneName"/> + <result column="two_tag" jdbcType="VARCHAR" property="twoTag"/> + <result column="two_name" jdbcType="VARCHAR" property="twoName"/> + <result column="three_tag" jdbcType="VARCHAR" property="threeTag"/> + <result column="three_name" jdbcType="VARCHAR" property="threeName"/> + <result column="count" jdbcType="INTEGER" property="count"/> + <result column="status" jdbcType="INTEGER" property="status"/> + <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> + </resultMap> + <sql id="Example_Where_Clause"> + <where> + <foreach collection="oredCriteria" item="criteria" separator="or"> + <if test="criteria.valid"> + <trim prefix="(" prefixOverrides="and" suffix=")"> + <foreach collection="criteria.criteria" item="criterion"> + <choose> + <when test="criterion.noValue"> + and ${criterion.condition} + </when> + <when test="criterion.singleValue"> + and ${criterion.condition} #{criterion.value} + </when> + <when test="criterion.betweenValue"> + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + </when> + <when test="criterion.listValue"> + and ${criterion.condition} + <foreach close=")" collection="criterion.value" item="listItem" open="(" + separator=","> + #{listItem} + </foreach> + </when> + </choose> + </foreach> + </trim> + </if> </foreach> - </trim> - </if> - </foreach> - </where> - </sql> - <sql id="Update_By_Example_Where_Clause"> - <where> - <foreach collection="example.oredCriteria" item="criteria" separator="or"> - <if test="criteria.valid"> - <trim prefix="(" prefixOverrides="and" suffix=")"> - <foreach collection="criteria.criteria" item="criterion"> - <choose> - <when test="criterion.noValue"> - and ${criterion.condition} - </when> - <when test="criterion.singleValue"> - and ${criterion.condition} #{criterion.value} - </when> - <when test="criterion.betweenValue"> - and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} - </when> - <when test="criterion.listValue"> - and ${criterion.condition} - <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> - #{listItem} - </foreach> - </when> - </choose> + </where> + </sql> + <sql id="Update_By_Example_Where_Clause"> + <where> + <foreach collection="example.oredCriteria" item="criteria" separator="or"> + <if test="criteria.valid"> + <trim prefix="(" prefixOverrides="and" suffix=")"> + <foreach collection="criteria.criteria" item="criterion"> + <choose> + <when test="criterion.noValue"> + and ${criterion.condition} + </when> + <when test="criterion.singleValue"> + and ${criterion.condition} #{criterion.value} + </when> + <when test="criterion.betweenValue"> + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + </when> + <when test="criterion.listValue"> + and ${criterion.condition} + <foreach close=")" collection="criterion.value" item="listItem" open="(" + separator=","> + #{listItem} + </foreach> + </when> + </choose> + </foreach> + </trim> + </if> </foreach> - </trim> - </if> - </foreach> - </where> - </sql> - <sql id="Base_Column_List"> - resource_id, resource_name, url, picture_url, resource_type, source, one_tag, one_name, + </where> + </sql> + <sql id="Base_Column_List"> + 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 - </sql> - <select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysResourceExample" resultMap="BaseResultMap"> - select - <if test="distinct"> - distinct - </if> - <include refid="Base_Column_List" /> - from sys_resource - <if test="_parameter != null"> - <include refid="Example_Where_Clause" /> - </if> - <if test="orderByClause != null"> - order by ${orderByClause} - </if> - </select> - <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> - select - <include refid="Base_Column_List" /> - from sys_resource - where resource_id = #{resourceId,jdbcType=VARCHAR} - </select> - <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> - delete from sys_resource - where resource_id = #{resourceId,jdbcType=VARCHAR} - </delete> - <delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.SysResourceExample"> - delete from sys_resource - <if test="_parameter != null"> - <include refid="Example_Where_Clause" /> - </if> - </delete> - <insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysResource"> - 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> - <insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysResource"> - insert into sys_resource - <trim prefix="(" suffix=")" suffixOverrides=","> - <if test="resourceId != null"> - resource_id, - </if> - <if test="resourceName != null"> - resource_name, - </if> - <if test="url != null"> - url, - </if> - <if test="pictureUrl != null"> - picture_url, - </if> - <if test="resourceType != null"> - resource_type, - </if> - <if test="source != null"> - source, - </if> - <if test="oneTag != null"> - one_tag, - </if> - <if test="oneName != null"> - one_name, - </if> - <if test="twoTag != null"> - two_tag, - </if> - <if test="twoName != null"> - two_name, - </if> - <if test="threeTag != null"> - three_tag, - </if> - <if test="threeName != null"> - three_name, - </if> - <if test="count != null"> - count, - </if> - <if test="status != null"> - status, - </if> - <if test="createTime != null"> - create_time, - </if> - </trim> - <trim prefix="values (" suffix=")" suffixOverrides=","> - <if test="resourceId != null"> - #{resourceId,jdbcType=VARCHAR}, - </if> - <if test="resourceName != null"> - #{resourceName,jdbcType=VARCHAR}, - </if> - <if test="url != null"> - #{url,jdbcType=VARCHAR}, - </if> - <if test="pictureUrl != null"> - #{pictureUrl,jdbcType=VARCHAR}, - </if> - <if test="resourceType != null"> - #{resourceType,jdbcType=VARCHAR}, - </if> - <if test="source != null"> - #{source,jdbcType=VARCHAR}, - </if> - <if test="oneTag != null"> - #{oneTag,jdbcType=VARCHAR}, - </if> - <if test="oneName != null"> - #{oneName,jdbcType=VARCHAR}, - </if> - <if test="twoTag != null"> - #{twoTag,jdbcType=VARCHAR}, - </if> - <if test="twoName != null"> - #{twoName,jdbcType=VARCHAR}, - </if> - <if test="threeTag != null"> - #{threeTag,jdbcType=VARCHAR}, - </if> - <if test="threeName != null"> - #{threeName,jdbcType=VARCHAR}, - </if> - <if test="count != null"> - #{count,jdbcType=INTEGER}, - </if> - <if test="status != null"> - #{status,jdbcType=INTEGER}, - </if> - <if test="createTime != null"> - #{createTime,jdbcType=TIMESTAMP}, - </if> - </trim> - </insert> - <select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysResourceExample" resultType="java.lang.Long"> - select count(*) from sys_resource - <if test="_parameter != null"> - <include refid="Example_Where_Clause" /> - </if> - </select> - <update id="updateByExampleSelective" parameterType="map"> - update sys_resource - <set> - <if test="record.resourceId != null"> - resource_id = #{record.resourceId,jdbcType=VARCHAR}, - </if> - <if test="record.resourceName != null"> + </sql> + <select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysResourceExample" + resultMap="BaseResultMap"> + select + <if test="distinct"> + distinct + </if> + <include refid="Base_Column_List"/> + from sys_resource + <if test="_parameter != null"> + <include refid="Example_Where_Clause"/> + </if> + <if test="orderByClause != null"> + order by ${orderByClause} + </if> + </select> + <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> + select + <include refid="Base_Column_List"/> + from sys_resource + where resource_id = #{resourceId,jdbcType=VARCHAR} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.String"> + delete + from sys_resource + where resource_id = #{resourceId,jdbcType=VARCHAR} + </delete> + <delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.SysResourceExample"> + delete from sys_resource + <if test="_parameter != null"> + <include refid="Example_Where_Clause"/> + </if> + </delete> + <insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysResource"> + 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> + <insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysResource"> + insert into sys_resource + <trim prefix="(" suffix=")" suffixOverrides=","> + <if test="resourceId != null"> + resource_id, + </if> + <if test="resourceName != null"> + resource_name, + </if> + <if test="url != null"> + url, + </if> + <if test="pictureUrl != null"> + picture_url, + </if> + <if test="resourceType != null"> + resource_type, + </if> + <if test="source != null"> + source, + </if> + <if test="oneTag != null"> + one_tag, + </if> + <if test="oneName != null"> + one_name, + </if> + <if test="twoTag != null"> + two_tag, + </if> + <if test="twoName != null"> + two_name, + </if> + <if test="threeTag != null"> + three_tag, + </if> + <if test="threeName != null"> + three_name, + </if> + <if test="count != null"> + count, + </if> + <if test="status != null"> + status, + </if> + <if test="createTime != null"> + create_time, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides=","> + <if test="resourceId != null"> + #{resourceId,jdbcType=VARCHAR}, + </if> + <if test="resourceName != null"> + #{resourceName,jdbcType=VARCHAR}, + </if> + <if test="url != null"> + #{url,jdbcType=VARCHAR}, + </if> + <if test="pictureUrl != null"> + #{pictureUrl,jdbcType=VARCHAR}, + </if> + <if test="resourceType != null"> + #{resourceType,jdbcType=VARCHAR}, + </if> + <if test="source != null"> + #{source,jdbcType=VARCHAR}, + </if> + <if test="oneTag != null"> + #{oneTag,jdbcType=VARCHAR}, + </if> + <if test="oneName != null"> + #{oneName,jdbcType=VARCHAR}, + </if> + <if test="twoTag != null"> + #{twoTag,jdbcType=VARCHAR}, + </if> + <if test="twoName != null"> + #{twoName,jdbcType=VARCHAR}, + </if> + <if test="threeTag != null"> + #{threeTag,jdbcType=VARCHAR}, + </if> + <if test="threeName != null"> + #{threeName,jdbcType=VARCHAR}, + </if> + <if test="count != null"> + #{count,jdbcType=INTEGER}, + </if> + <if test="status != null"> + #{status,jdbcType=INTEGER}, + </if> + <if test="createTime != null"> + #{createTime,jdbcType=TIMESTAMP}, + </if> + </trim> + </insert> + <select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysResourceExample" + resultType="java.lang.Long"> + select count(*) from sys_resource + <if test="_parameter != null"> + <include refid="Example_Where_Clause"/> + </if> + </select> + <update id="updateByExampleSelective" parameterType="map"> + update sys_resource + <set> + <if test="record.resourceId != null"> + resource_id = #{record.resourceId,jdbcType=VARCHAR}, + </if> + <if test="record.resourceName != null"> + resource_name = #{record.resourceName,jdbcType=VARCHAR}, + </if> + <if test="record.url != null"> + url = #{record.url,jdbcType=VARCHAR}, + </if> + <if test="record.pictureUrl != null"> + picture_url = #{record.pictureUrl,jdbcType=VARCHAR}, + </if> + <if test="record.resourceType != null"> + resource_type = #{record.resourceType,jdbcType=VARCHAR}, + </if> + <if test="record.source != null"> + source = #{record.source,jdbcType=VARCHAR}, + </if> + <if test="record.oneTag != null"> + one_tag = #{record.oneTag,jdbcType=VARCHAR}, + </if> + <if test="record.oneName != null"> + one_name = #{record.oneName,jdbcType=VARCHAR}, + </if> + <if test="record.twoTag != null"> + two_tag = #{record.twoTag,jdbcType=VARCHAR}, + </if> + <if test="record.twoName != null"> + two_name = #{record.twoName,jdbcType=VARCHAR}, + </if> + <if test="record.threeTag != null"> + three_tag = #{record.threeTag,jdbcType=VARCHAR}, + </if> + <if test="record.threeName != null"> + three_name = #{record.threeName,jdbcType=VARCHAR}, + </if> + <if test="record.count != null"> + count = #{record.count,jdbcType=INTEGER}, + </if> + <if test="record.status != null"> + status = #{record.status,jdbcType=INTEGER}, + </if> + <if test="record.createTime != null"> + create_time = #{record.createTime,jdbcType=TIMESTAMP}, + </if> + </set> + <if test="_parameter != null"> + <include refid="Update_By_Example_Where_Clause"/> + </if> + </update> + <update id="updateByExample" parameterType="map"> + update sys_resource + set resource_id = #{record.resourceId,jdbcType=VARCHAR}, resource_name = #{record.resourceName,jdbcType=VARCHAR}, - </if> - <if test="record.url != null"> url = #{record.url,jdbcType=VARCHAR}, - </if> - <if test="record.pictureUrl != null"> picture_url = #{record.pictureUrl,jdbcType=VARCHAR}, - </if> - <if test="record.resourceType != null"> resource_type = #{record.resourceType,jdbcType=VARCHAR}, - </if> - <if test="record.source != null"> source = #{record.source,jdbcType=VARCHAR}, - </if> - <if test="record.oneTag != null"> one_tag = #{record.oneTag,jdbcType=VARCHAR}, - </if> - <if test="record.oneName != null"> one_name = #{record.oneName,jdbcType=VARCHAR}, - </if> - <if test="record.twoTag != null"> two_tag = #{record.twoTag,jdbcType=VARCHAR}, - </if> - <if test="record.twoName != null"> two_name = #{record.twoName,jdbcType=VARCHAR}, - </if> - <if test="record.threeTag != null"> three_tag = #{record.threeTag,jdbcType=VARCHAR}, - </if> - <if test="record.threeName != null"> three_name = #{record.threeName,jdbcType=VARCHAR}, - </if> - <if test="record.count != null"> count = #{record.count,jdbcType=INTEGER}, - </if> - <if test="record.status != null"> status = #{record.status,jdbcType=INTEGER}, - </if> - <if test="record.createTime != null"> - create_time = #{record.createTime,jdbcType=TIMESTAMP}, - </if> - </set> - <if test="_parameter != null"> - <include refid="Update_By_Example_Where_Clause" /> - </if> - </update> - <update id="updateByExample" parameterType="map"> - 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} - <if test="_parameter != null"> - <include refid="Update_By_Example_Where_Clause" /> - </if> - </update> - <update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.SysResource"> - update sys_resource - <set> - <if test="resourceName != null"> - resource_name = #{resourceName,jdbcType=VARCHAR}, - </if> - <if test="url != null"> - url = #{url,jdbcType=VARCHAR}, - </if> - <if test="pictureUrl != null"> - picture_url = #{pictureUrl,jdbcType=VARCHAR}, - </if> - <if test="resourceType != null"> - resource_type = #{resourceType,jdbcType=VARCHAR}, - </if> - <if test="source != null"> - source = #{source,jdbcType=VARCHAR}, - </if> - <if test="oneTag != null"> - one_tag = #{oneTag,jdbcType=VARCHAR}, - </if> - <if test="oneName != null"> - one_name = #{oneName,jdbcType=VARCHAR}, - </if> - <if test="twoTag != null"> - two_tag = #{twoTag,jdbcType=VARCHAR}, - </if> - <if test="twoName != null"> - two_name = #{twoName,jdbcType=VARCHAR}, - </if> - <if test="threeTag != null"> - three_tag = #{threeTag,jdbcType=VARCHAR}, - </if> - <if test="threeName != null"> - three_name = #{threeName,jdbcType=VARCHAR}, - </if> - <if test="count != null"> - count = #{count,jdbcType=INTEGER}, - </if> - <if test="status != null"> - status = #{status,jdbcType=INTEGER}, - </if> - <if test="createTime != null"> - create_time = #{createTime,jdbcType=TIMESTAMP}, - </if> - </set> - where resource_id = #{resourceId,jdbcType=VARCHAR} - </update> - <update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.SysResource"> - 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} - </update> + create_time = #{record.createTime,jdbcType=TIMESTAMP} + <if test="_parameter != null"> + <include refid="Update_By_Example_Where_Clause"/> + </if> + </update> + <update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.SysResource"> + update sys_resource + <set> + <if test="resourceName != null"> + resource_name = #{resourceName,jdbcType=VARCHAR}, + </if> + <if test="url != null"> + url = #{url,jdbcType=VARCHAR}, + </if> + <if test="pictureUrl != null"> + picture_url = #{pictureUrl,jdbcType=VARCHAR}, + </if> + <if test="resourceType != null"> + resource_type = #{resourceType,jdbcType=VARCHAR}, + </if> + <if test="source != null"> + source = #{source,jdbcType=VARCHAR}, + </if> + <if test="oneTag != null"> + one_tag = #{oneTag,jdbcType=VARCHAR}, + </if> + <if test="oneName != null"> + one_name = #{oneName,jdbcType=VARCHAR}, + </if> + <if test="twoTag != null"> + two_tag = #{twoTag,jdbcType=VARCHAR}, + </if> + <if test="twoName != null"> + two_name = #{twoName,jdbcType=VARCHAR}, + </if> + <if test="threeTag != null"> + three_tag = #{threeTag,jdbcType=VARCHAR}, + </if> + <if test="threeName != null"> + three_name = #{threeName,jdbcType=VARCHAR}, + </if> + <if test="count != null"> + count = #{count,jdbcType=INTEGER}, + </if> + <if test="status != null"> + status = #{status,jdbcType=INTEGER}, + </if> + <if test="createTime != null"> + create_time = #{createTime,jdbcType=TIMESTAMP}, + </if> + </set> + where resource_id = #{resourceId,jdbcType=VARCHAR} + </update> + <update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.SysResource"> + 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} + </update> + + <resultMap id="DtoMap" type="com.sztzjy.resource_center.entity.SysResource"> + <id column="resource_id" jdbcType="VARCHAR" property="resourceId"/> + <result column="resource_name" jdbcType="VARCHAR" property="resourceName"/> + <result column="url" jdbcType="VARCHAR" property="url"/> + <result column="picture_url" jdbcType="VARCHAR" property="pictureUrl"/> + <result column="resource_type" jdbcType="VARCHAR" property="resourceType"/> + <result column="source" jdbcType="VARCHAR" property="source"/> + <result column="one_id" jdbcType="VARCHAR" property="oneTag"/> + <result column="one_name" jdbcType="VARCHAR" property="oneName"/> + <result column="two_id" jdbcType="VARCHAR" property="twoTag"/> + <result column="two_name" jdbcType="VARCHAR" property="twoName"/> + <result column="three_id" jdbcType="VARCHAR" property="threeTag"/> + <result column="three_name" jdbcType="VARCHAR" property="threeName"/> + <result column="status" jdbcType="INTEGER" property="status"/> + <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> + </resultMap> - <resultMap id="DtoMap" type="com.sztzjy.resource_center.entity.SysResource"> - <id column="resource_id" jdbcType="VARCHAR" property="resourceId" /> - <result column="resource_name" jdbcType="VARCHAR" property="resourceName" /> - <result column="url" jdbcType="VARCHAR" property="url" /> - <result column="picture_url" jdbcType="VARCHAR" property="pictureUrl" /> - <result column="resource_type" jdbcType="VARCHAR" property="resourceType" /> - <result column="source" jdbcType="VARCHAR" property="source" /> - <result column="one_id" jdbcType="VARCHAR" property="oneTag" /> - <result column="one_name" jdbcType="VARCHAR" property="oneName" /> - <result column="two_id" jdbcType="VARCHAR" property="twoTag" /> - <result column="two_name" jdbcType="VARCHAR" property="twoName" /> - <result column="three_id" jdbcType="VARCHAR" property="threeTag" /> - <result column="three_name" jdbcType="VARCHAR" property="threeName" /> - <result column="status" jdbcType="INTEGER" property="status" /> - <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> - </resultMap> + <!--重复--> + <select id="selectResourceByRepeat" parameterType="java.lang.String" resultMap="DtoMap"> + SELECT + sc.one_id,sc.two_id,sc.three_id,sc.one_name,sc.two_name,sc.three_name,sr.resource_name,sr.resource_id,sr.url,sr.picture_url,sr.resource_type,sr.source,sr.status,sr.create_time + FROM sys_resource sr + left JOIN + sys_resource_and_course sc + on sr.resource_id =sc.resource_id + <where> + <if test="oneId != null and oneId != ''"> + sc.one_id = #{oneId} + </if> + <if test="twoId != null and twoId != ''"> + and sc.two_id = #{twoId} + </if> + <if test="threeId != null and threeId != ''"> + and sc.three_id = #{threeId} + </if> + <if test="resourceName != null and resourceName != ''"> + and sr.resource_name LIKE CONCAT('%', #{resourceName}, '%') + </if> + </where> + order by sr.create_time + </select> - <!--重复--> - <select id="selectResourceByRepeat" parameterType="java.lang.String" resultMap="DtoMap"> - SELECT sc.one_id,sc.two_id,sc.three_id,sc.one_name,sc.two_name,sc.three_name,sr.resource_name,sr.resource_id,sr.url,sr.picture_url,sr.resource_type,sr.source,sr.status,sr.create_time - FROM sys_resource sr - left JOIN - sys_resource_and_course sc - on sr.resource_id =sc.resource_id - <where> - <if test="oneId != null and oneId != ''"> - sc.one_id = #{oneId} - </if> - <if test="twoId != null and twoId != ''"> - and sc.two_id = #{twoId} - </if> - <if test="threeId != null and threeId != ''"> - and sc.three_id = #{threeId} - </if> - <if test="resourceName != null and resourceName != ''"> - and sr.resource_name LIKE CONCAT('%', #{resourceName}, '%') - </if> - </where> - order by sr.create_time - </select> + <!--不重复--> + <select id="selectResource" parameterType="java.lang.String" resultMap="DtoMap"> + SELECT DISTINCT + sc.one_id,sc.two_id,sc.three_id,sc.one_name,sc.two_name,sc.three_name,sr.resource_name,sr.resource_id,sr.url,sr.picture_url,sr.resource_type,sr.source,sr.status,sr.create_time + FROM sys_resource sr + left JOIN + sys_resource_and_course sc + on sr.resource_id =sc.resource_id + <where> + <if test="oneId != null and oneId != ''"> + sc.one_id = #{oneId} + </if> + <if test="twoId != null and twoId != ''"> + and sc.two_id = #{twoId} + </if> + <if test="threeId != null and threeId != ''"> + and sc.three_id = #{threeId} + </if> + <if test="source != null and source != ''"> + and sr.source in (#{source},'管理员') + </if> + and sr.source ='管理员' + <if test="name != null and name != ''"> + and sr.resource_name LIKE CONCAT('%', #{name}, '%') + </if> + </where> + order by sr.create_time + </select> - <!--不重复--> - <select id="selectResource" parameterType="java.lang.String" resultMap="DtoMap"> - SELECT DISTINCT sc.one_id,sc.two_id,sc.three_id,sc.one_name,sc.two_name,sc.three_name,sr.resource_name,sr.resource_id,sr.url,sr.picture_url,sr.resource_type,sr.source,sr.status,sr.create_time - FROM sys_resource sr - left JOIN - sys_resource_and_course sc - on sr.resource_id =sc.resource_id - <where> - <if test="oneId != null and oneId != ''"> - sc.one_id = #{oneId} - </if> - <if test="twoId != null and twoId != ''"> - and sc.two_id = #{twoId} - </if> - <if test="threeId != null and threeId != ''"> - and sc.three_id = #{threeId} - </if> - <if test="source != null and source != ''"> - and sr.source in (#{source},'管理员') - </if> - <if test="name != null and name != ''"> - and sr.resource_name LIKE CONCAT('%', #{name}, '%') - </if> - </where> - order by sr.create_time - </select> + <select id="getCountByType" resultType="map"> + SELECT resource_type, count(*) as count + FROM sys_resource + WHERE resource_id IN + <foreach close=")" collection="list" index="index" item="item" open="(" separator=","> + #{item} + </foreach> + AND source in (#{schoolId},'管理员') + GROUP BY resource_type + </select> - <select id="getCountByType" resultType="map"> - SELECT resource_type, count(*) as count - FROM sys_resource - WHERE resource_id IN - <foreach close=")" collection="list" index="index" item="item" open="(" separator=","> - #{item} - </foreach> - AND source in (#{schoolId},'管理员') - GROUP BY resource_type - </select> - </mapper> \ No newline at end of file