xiaoCJ 9 months ago
parent 659ad3f5bb
commit 1675fbe6f4

@ -45,7 +45,7 @@ public class CourseConfigController {
@AnonymousAccess @AnonymousAccess
@ApiOperation("本地上传资源") @ApiOperation("本地上传资源")
@PostMapping("uploadLocal") @PostMapping("uploadLocal")
public ResultEntity<String> uploadLocal(@ApiParam("") @RequestBody SysResourceDto dto) { public ResultEntity<String> uploadLocal(@ModelAttribute SysResourceDto dto) {
if (dto.getFile() == null) { if (dto.getFile() == null) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请上传文件!"); return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请上传文件!");
} }
@ -67,7 +67,7 @@ public class CourseConfigController {
|| extension.equals(".xlsx") || extension.equals(".xls") || extension.equals(".xlsx") || extension.equals(".xls")
|| extension.equals(".doc") || extension.equals(".docx")) { || extension.equals(".doc") || extension.equals(".docx")) {
sysResource.setResourceType("课件"); sysResource.setResourceType("课件");
} else if (extension.equals(".mp4") || extension.equals(".wmv") || extension.equals(".wmv")) { } else if (extension.equals(".mp4") || extension.equals(".wmv") || extension.equals(".avi")) {
sysResource.setResourceType("视频"); sysResource.setResourceType("视频");
} else { } else {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "文件类型不支持!"); return new ResultEntity<>(HttpStatus.BAD_REQUEST, "文件类型不支持!");
@ -76,9 +76,12 @@ public class CourseConfigController {
String uuid = IdUtil.randomUUID(); String uuid = IdUtil.randomUUID();
sysResource.setResourceId(uuid); sysResource.setResourceId(uuid);
sysResource.setPictureUrl(pictureName); sysResource.setPictureUrl(pictureName);
sysResource.setOntTag(dto.getOneId()); sysResource.setOneTag(dto.getOneId());
sysResource.setOneName(dto.getOneName());
sysResource.setTwoTag(dto.getTwoId()); sysResource.setTwoTag(dto.getTwoId());
sysResource.setTwoName(dto.getTwoName());
sysResource.setThreeTag(dto.getThreeId()); sysResource.setThreeTag(dto.getThreeId());
sysResource.setThreeName(dto.getThreeName());
sysResource.setUrl(url); sysResource.setUrl(url);
sysResource.setSource(dto.getSource()); //管理员或者 xx学校 sysResource.setSource(dto.getSource()); //管理员或者 xx学校
sysResource.setResourceName(dto.getResourceName()); sysResource.setResourceName(dto.getResourceName());

@ -84,14 +84,13 @@ public class CourseManageController {
} }
@AnonymousAccess @AnonymousAccess
@ApiOperation("删除课程") @ApiOperation("删除课程")
@PostMapping("deleteOneCatalog") @PostMapping("deleteOneCatalog")
public ResultEntity<String> deleteOneCatalog(@RequestParam String oneId) { public ResultEntity<String> deleteOneCatalog(@RequestParam String oneId) {
sysOneCatalogMapper.deleteByPrimaryKey(oneId); sysOneCatalogMapper.deleteByPrimaryKey(oneId);
//删除课程资源的绑定关系 //删除课程资源的绑定关系
SysResourceAndCourseExample example =new SysResourceAndCourseExample(); SysResourceAndCourseExample example = new SysResourceAndCourseExample();
example.createCriteria().andOneIdEqualTo(oneId); example.createCriteria().andOneIdEqualTo(oneId);
sysResourceAndCourseMapper.deleteByExample(example); sysResourceAndCourseMapper.deleteByExample(example);
return new ResultEntity<>(HttpStatus.OK, "删除成功"); return new ResultEntity<>(HttpStatus.OK, "删除成功");
@ -125,4 +124,5 @@ public class CourseManageController {
PageInfo<SysOneCatalog> pageInfo = new PageInfo(sysOneCatalogs); PageInfo<SysOneCatalog> pageInfo = new PageInfo(sysOneCatalogs);
return new ResultEntity<PageInfo<SysOneCatalog>>(pageInfo); return new ResultEntity<PageInfo<SysOneCatalog>>(pageInfo);
} }
} }

@ -3,6 +3,7 @@ package com.sztzjy.resource_center.controller;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sztzjy.resource_center.annotation.AnonymousAccess;
import com.sztzjy.resource_center.entity.SysObjectiveQuestions; import com.sztzjy.resource_center.entity.SysObjectiveQuestions;
import com.sztzjy.resource_center.entity.SysObjectiveQuestionsExample; import com.sztzjy.resource_center.entity.SysObjectiveQuestionsExample;
import com.sztzjy.resource_center.entity.SysTopicAndCourse; import com.sztzjy.resource_center.entity.SysTopicAndCourse;
@ -122,14 +123,15 @@ public class TopicResourceController {
return new ResultEntity<>(HttpStatus.OK, "添加成功!"); return new ResultEntity<>(HttpStatus.OK, "添加成功!");
} }
@AnonymousAccess
@ApiOperation("条件查询") @ApiOperation("条件查询")
@PostMapping("selectTopicByConditions") //todo 关于老师删除的题库如何查询 @PostMapping("selectTopicByConditions") //todo 关于老师删除的题库如何查询
private ResultEntity<PageInfo<SysObjectiveQuestionsDto>> selectTopicByConditions(@RequestParam Integer index, private ResultEntity<PageInfo<SysObjectiveQuestionsDto>> selectTopicByConditions(@RequestParam Integer index,
@RequestParam Integer size, @RequestParam Integer size,
@RequestParam String oneID, @RequestParam(required = false) String oneID,
@RequestParam String twoID, @RequestParam (required = false)String twoID,
@RequestParam String threeID, @RequestParam (required = false)String threeID,
@ApiParam("题干") @RequestParam String content) { @ApiParam("题干") @RequestParam (required = false)String content) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);
List<SysObjectiveQuestionsDto> list = sysObjectiveQuestionMapper.selectTopicByConditions(oneID, twoID, threeID, content); List<SysObjectiveQuestionsDto> list = sysObjectiveQuestionMapper.selectTopicByConditions(oneID, twoID, threeID, content);
PageInfo<SysObjectiveQuestionsDto> pageInfo = new PageInfo(list); PageInfo<SysObjectiveQuestionsDto> pageInfo = new PageInfo(list);

@ -29,14 +29,20 @@ public class SysResource {
private String source; private String source;
@ApiModelProperty("一级目录标签") @ApiModelProperty("一级目录标签")
private String ontTag; private String oneTag;
private String oneName;
@ApiModelProperty("二级目录标签") @ApiModelProperty("二级目录标签")
private String twoTag; private String twoTag;
private String twoName;
@ApiModelProperty("三级目录标签") @ApiModelProperty("三级目录标签")
private String threeTag; private String threeTag;
private String threeName;
@ApiModelProperty("启用状态 1已启用 0未启用") @ApiModelProperty("启用状态 1已启用 0未启用")
private Integer status; private Integer status;
@ -91,12 +97,20 @@ public class SysResource {
this.source = source == null ? null : source.trim(); this.source = source == null ? null : source.trim();
} }
public String getOntTag() { public String getOneTag() {
return ontTag; return oneTag;
}
public void setOneTag(String oneTag) {
this.oneTag = oneTag == null ? null : oneTag.trim();
}
public String getOneName() {
return oneName;
} }
public void setOntTag(String ontTag) { public void setOneName(String oneName) {
this.ontTag = ontTag == null ? null : ontTag.trim(); this.oneName = oneName == null ? null : oneName.trim();
} }
public String getTwoTag() { public String getTwoTag() {
@ -107,6 +121,14 @@ public class SysResource {
this.twoTag = twoTag == null ? null : twoTag.trim(); this.twoTag = twoTag == null ? null : twoTag.trim();
} }
public String getTwoName() {
return twoName;
}
public void setTwoName(String twoName) {
this.twoName = twoName == null ? null : twoName.trim();
}
public String getThreeTag() { public String getThreeTag() {
return threeTag; return threeTag;
} }
@ -115,6 +137,14 @@ public class SysResource {
this.threeTag = threeTag == null ? null : threeTag.trim(); this.threeTag = threeTag == null ? null : threeTag.trim();
} }
public String getThreeName() {
return threeName;
}
public void setThreeName(String threeName) {
this.threeName = threeName == null ? null : threeName.trim();
}
public Integer getStatus() { public Integer getStatus() {
return status; return status;
} }

@ -525,73 +525,143 @@ public class SysResourceExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOntTagIsNull() { public Criteria andOneTagIsNull() {
addCriterion("ont_tag is null"); addCriterion("one_tag is null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOntTagIsNotNull() { public Criteria andOneTagIsNotNull() {
addCriterion("ont_tag is not null"); addCriterion("one_tag is not null");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOntTagEqualTo(String value) { public Criteria andOneTagEqualTo(String value) {
addCriterion("ont_tag =", value, "ontTag"); addCriterion("one_tag =", value, "oneTag");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOntTagNotEqualTo(String value) { public Criteria andOneTagNotEqualTo(String value) {
addCriterion("ont_tag <>", value, "ontTag"); addCriterion("one_tag <>", value, "oneTag");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOntTagGreaterThan(String value) { public Criteria andOneTagGreaterThan(String value) {
addCriterion("ont_tag >", value, "ontTag"); addCriterion("one_tag >", value, "oneTag");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOntTagGreaterThanOrEqualTo(String value) { public Criteria andOneTagGreaterThanOrEqualTo(String value) {
addCriterion("ont_tag >=", value, "ontTag"); addCriterion("one_tag >=", value, "oneTag");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOntTagLessThan(String value) { public Criteria andOneTagLessThan(String value) {
addCriterion("ont_tag <", value, "ontTag"); addCriterion("one_tag <", value, "oneTag");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOntTagLessThanOrEqualTo(String value) { public Criteria andOneTagLessThanOrEqualTo(String value) {
addCriterion("ont_tag <=", value, "ontTag"); addCriterion("one_tag <=", value, "oneTag");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOntTagLike(String value) { public Criteria andOneTagLike(String value) {
addCriterion("ont_tag like", value, "ontTag"); addCriterion("one_tag like", value, "oneTag");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOntTagNotLike(String value) { public Criteria andOneTagNotLike(String value) {
addCriterion("ont_tag not like", value, "ontTag"); addCriterion("one_tag not like", value, "oneTag");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOntTagIn(List<String> values) { public Criteria andOneTagIn(List<String> values) {
addCriterion("ont_tag in", values, "ontTag"); addCriterion("one_tag in", values, "oneTag");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOntTagNotIn(List<String> values) { public Criteria andOneTagNotIn(List<String> values) {
addCriterion("ont_tag not in", values, "ontTag"); addCriterion("one_tag not in", values, "oneTag");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOntTagBetween(String value1, String value2) { public Criteria andOneTagBetween(String value1, String value2) {
addCriterion("ont_tag between", value1, value2, "ontTag"); addCriterion("one_tag between", value1, value2, "oneTag");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOntTagNotBetween(String value1, String value2) { public Criteria andOneTagNotBetween(String value1, String value2) {
addCriterion("ont_tag not between", value1, value2, "ontTag"); addCriterion("one_tag not between", value1, value2, "oneTag");
return (Criteria) this;
}
public Criteria andOneNameIsNull() {
addCriterion("one_name is null");
return (Criteria) this;
}
public Criteria andOneNameIsNotNull() {
addCriterion("one_name is not null");
return (Criteria) this;
}
public Criteria andOneNameEqualTo(String value) {
addCriterion("one_name =", value, "oneName");
return (Criteria) this;
}
public Criteria andOneNameNotEqualTo(String value) {
addCriterion("one_name <>", value, "oneName");
return (Criteria) this;
}
public Criteria andOneNameGreaterThan(String value) {
addCriterion("one_name >", value, "oneName");
return (Criteria) this;
}
public Criteria andOneNameGreaterThanOrEqualTo(String value) {
addCriterion("one_name >=", value, "oneName");
return (Criteria) this;
}
public Criteria andOneNameLessThan(String value) {
addCriterion("one_name <", value, "oneName");
return (Criteria) this;
}
public Criteria andOneNameLessThanOrEqualTo(String value) {
addCriterion("one_name <=", value, "oneName");
return (Criteria) this;
}
public Criteria andOneNameLike(String value) {
addCriterion("one_name like", value, "oneName");
return (Criteria) this;
}
public Criteria andOneNameNotLike(String value) {
addCriterion("one_name not like", value, "oneName");
return (Criteria) this;
}
public Criteria andOneNameIn(List<String> values) {
addCriterion("one_name in", values, "oneName");
return (Criteria) this;
}
public Criteria andOneNameNotIn(List<String> values) {
addCriterion("one_name not in", values, "oneName");
return (Criteria) this;
}
public Criteria andOneNameBetween(String value1, String value2) {
addCriterion("one_name between", value1, value2, "oneName");
return (Criteria) this;
}
public Criteria andOneNameNotBetween(String value1, String value2) {
addCriterion("one_name not between", value1, value2, "oneName");
return (Criteria) this; return (Criteria) this;
} }
@ -665,6 +735,76 @@ public class SysResourceExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTwoNameIsNull() {
addCriterion("two_name is null");
return (Criteria) this;
}
public Criteria andTwoNameIsNotNull() {
addCriterion("two_name is not null");
return (Criteria) this;
}
public Criteria andTwoNameEqualTo(String value) {
addCriterion("two_name =", value, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameNotEqualTo(String value) {
addCriterion("two_name <>", value, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameGreaterThan(String value) {
addCriterion("two_name >", value, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameGreaterThanOrEqualTo(String value) {
addCriterion("two_name >=", value, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameLessThan(String value) {
addCriterion("two_name <", value, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameLessThanOrEqualTo(String value) {
addCriterion("two_name <=", value, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameLike(String value) {
addCriterion("two_name like", value, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameNotLike(String value) {
addCriterion("two_name not like", value, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameIn(List<String> values) {
addCriterion("two_name in", values, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameNotIn(List<String> values) {
addCriterion("two_name not in", values, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameBetween(String value1, String value2) {
addCriterion("two_name between", value1, value2, "twoName");
return (Criteria) this;
}
public Criteria andTwoNameNotBetween(String value1, String value2) {
addCriterion("two_name not between", value1, value2, "twoName");
return (Criteria) this;
}
public Criteria andThreeTagIsNull() { public Criteria andThreeTagIsNull() {
addCriterion("three_tag is null"); addCriterion("three_tag is null");
return (Criteria) this; return (Criteria) this;
@ -735,6 +875,76 @@ public class SysResourceExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andThreeNameIsNull() {
addCriterion("three_name is null");
return (Criteria) this;
}
public Criteria andThreeNameIsNotNull() {
addCriterion("three_name is not null");
return (Criteria) this;
}
public Criteria andThreeNameEqualTo(String value) {
addCriterion("three_name =", value, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameNotEqualTo(String value) {
addCriterion("three_name <>", value, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameGreaterThan(String value) {
addCriterion("three_name >", value, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameGreaterThanOrEqualTo(String value) {
addCriterion("three_name >=", value, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameLessThan(String value) {
addCriterion("three_name <", value, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameLessThanOrEqualTo(String value) {
addCriterion("three_name <=", value, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameLike(String value) {
addCriterion("three_name like", value, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameNotLike(String value) {
addCriterion("three_name not like", value, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameIn(List<String> values) {
addCriterion("three_name in", values, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameNotIn(List<String> values) {
addCriterion("three_name not in", values, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameBetween(String value1, String value2) {
addCriterion("three_name between", value1, value2, "threeName");
return (Criteria) this;
}
public Criteria andThreeNameNotBetween(String value1, String value2) {
addCriterion("three_name not between", value1, value2, "threeName");
return (Criteria) this;
}
public Criteria andStatusIsNull() { public Criteria andStatusIsNull() {
addCriterion("status is null"); addCriterion("status is null");
return (Criteria) this; return (Criteria) this;

@ -57,7 +57,6 @@ public class SysResourceDto {
@ApiModelProperty("资源文件") @ApiModelProperty("资源文件")
private MultipartFile file; private MultipartFile file;
@ApiModelProperty("封面图片") @ApiModelProperty("封面图片")
private MultipartFile pictureUrl; private MultipartFile pictureUrl;
} }

@ -4,7 +4,6 @@ import com.sztzjy.resource_center.entity.SysResource;
import com.sztzjy.resource_center.entity.SysResourceExample; import com.sztzjy.resource_center.entity.SysResourceExample;
import java.util.List; import java.util.List;
import com.sztzjy.resource_center.entity.dto.SysResourceDto;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
@ -31,8 +30,9 @@ public interface SysResourceMapper {
int updateByPrimaryKey(SysResource record); int updateByPrimaryKey(SysResource record);
List<SysResource> selectResource(@Param("oneId") String oneId, List<SysResource> selectResource(@Param("oneId") String oneId,
@Param("twoId") String twoId, @Param("twoId") String twoId,
@Param("threeId") String threeId, @Param("threeId") String threeId,
@Param("resourceName") String resourceName); @Param("resourceName") String resourceName);
} }

@ -45,14 +45,14 @@
<!-- <table tableName="sys_model" domainObjectName="SysModel" />--> <!-- <table tableName="sys_model" domainObjectName="SysModel" />-->
<!-- <table tableName="sys_model_question" domainObjectName="SysModelQuestion" />--> <!-- <table tableName="sys_model_question" domainObjectName="SysModelQuestion" />-->
<!-- <table tableName="sys_objective_question" domainObjectName="SysObjectiveQuestions" />--> <!-- <table tableName="sys_objective_question" domainObjectName="SysObjectiveQuestions" />-->
<table tableName="sys_one_catalog" domainObjectName="SysOneCatalog" /> <!-- <table tableName="sys_one_catalog" domainObjectName="SysOneCatalog" />-->
<!-- <table tableName="sys_resource" domainObjectName="SysResource" />--> <table tableName="sys_resource" domainObjectName="SysResource" />
<!-- <table tableName="sys_resource_and_course" domainObjectName="SysResourceAndCourse" />--> <!-- <table tableName="sys_resource_and_course" domainObjectName="SysResourceAndCourse" />-->
<!-- <table tableName="sys_resource_data" domainObjectName="SysResourceData" />--> <!-- <table tableName="sys_resource_data" domainObjectName="SysResourceData" />-->
<!-- <table tableName="sys_school" domainObjectName="SysSchool" />--> <!-- <table tableName="sys_school" domainObjectName="SysSchool" />-->
<table tableName="sys_three_catalog" domainObjectName="SysThreeCatalog" /> <!-- <table tableName="sys_three_catalog" domainObjectName="SysThreeCatalog" />-->
<!-- <table tableName="sys_topic_and_course" domainObjectName="SysTopicAndCourse" />--> <!-- <table tableName="sys_topic_and_course" domainObjectName="SysTopicAndCourse" />-->
<table tableName="sys_two_catalog" domainObjectName="SysTwoCatalog" /> <!-- <table tableName="sys_two_catalog" domainObjectName="SysTwoCatalog" />-->
</context> </context>

@ -396,19 +396,19 @@
JOIN sys_topic_and_course st JOIN sys_topic_and_course st
on sb.objective_id = st.topic_id on sb.objective_id = st.topic_id
<where> <where>
<if test="oneID != null and oneID != "> <if test="oneID != null and oneID != ''">
one_id = #{oneID} sb.one_id = #{oneID}
</if> </if>
<if test="twoID != null and twoID != "> <if test="twoID != null and twoID != ''">
and two_id = #{twoID} and sb.two_id = #{twoID}
</if> </if>
<if test="threeId != null and threeId != "> <if test="threeID != null and threeID != '' ">
and three_id = #{threeId} and sb.three_id = #{threeID}
</if> </if>
<if test="content != null and content != ''"> <if test="content != null and content != ''">
and content = #{content} and sb.content = #{content}
</if> </if>
</where>> </where>
order by create_time order by sb.create_time
</select> </select>
</mapper> </mapper>

@ -8,9 +8,12 @@
<result column="picture_url" jdbcType="VARCHAR" property="pictureUrl" /> <result column="picture_url" jdbcType="VARCHAR" property="pictureUrl" />
<result column="resource_type" jdbcType="VARCHAR" property="resourceType" /> <result column="resource_type" jdbcType="VARCHAR" property="resourceType" />
<result column="source" jdbcType="VARCHAR" property="source" /> <result column="source" jdbcType="VARCHAR" property="source" />
<result column="ont_tag" jdbcType="VARCHAR" property="ontTag" /> <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_tag" jdbcType="VARCHAR" property="twoTag" />
<result column="two_name" jdbcType="VARCHAR" property="twoName" />
<result column="three_tag" jdbcType="VARCHAR" property="threeTag" /> <result column="three_tag" jdbcType="VARCHAR" property="threeTag" />
<result column="three_name" jdbcType="VARCHAR" property="threeName" />
<result column="status" jdbcType="INTEGER" property="status" /> <result column="status" jdbcType="INTEGER" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap> </resultMap>
@ -73,8 +76,8 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
resource_id, resource_name, url, picture_url, resource_type, source, ont_tag, two_tag, resource_id, resource_name, url, picture_url, resource_type, source, one_tag, one_name,
three_tag, status, create_time two_tag, two_name, three_tag, three_name, status, create_time
</sql> </sql>
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysResourceExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysResourceExample" resultMap="BaseResultMap">
select select
@ -109,11 +112,13 @@
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysResource"> <insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysResource">
insert into sys_resource (resource_id, resource_name, url, insert into sys_resource (resource_id, resource_name, url,
picture_url, resource_type, source, picture_url, resource_type, source,
ont_tag, two_tag, three_tag, one_tag, one_name, two_tag,
two_name, three_tag, three_name,
status, create_time) status, create_time)
values (#{resourceId,jdbcType=VARCHAR}, #{resourceName,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, values (#{resourceId,jdbcType=VARCHAR}, #{resourceName,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR},
#{pictureUrl,jdbcType=VARCHAR}, #{resourceType,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR}, #{pictureUrl,jdbcType=VARCHAR}, #{resourceType,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR},
#{ontTag,jdbcType=VARCHAR}, #{twoTag,jdbcType=VARCHAR}, #{threeTag,jdbcType=VARCHAR}, #{oneTag,jdbcType=VARCHAR}, #{oneName,jdbcType=VARCHAR}, #{twoTag,jdbcType=VARCHAR},
#{twoName,jdbcType=VARCHAR}, #{threeTag,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR},
#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}) #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysResource"> <insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysResource">
@ -137,15 +142,24 @@
<if test="source != null"> <if test="source != null">
source, source,
</if> </if>
<if test="ontTag != null"> <if test="oneTag != null">
ont_tag, one_tag,
</if>
<if test="oneName != null">
one_name,
</if> </if>
<if test="twoTag != null"> <if test="twoTag != null">
two_tag, two_tag,
</if> </if>
<if test="twoName != null">
two_name,
</if>
<if test="threeTag != null"> <if test="threeTag != null">
three_tag, three_tag,
</if> </if>
<if test="threeName != null">
three_name,
</if>
<if test="status != null"> <if test="status != null">
status, status,
</if> </if>
@ -172,15 +186,24 @@
<if test="source != null"> <if test="source != null">
#{source,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR},
</if> </if>
<if test="ontTag != null"> <if test="oneTag != null">
#{ontTag,jdbcType=VARCHAR}, #{oneTag,jdbcType=VARCHAR},
</if>
<if test="oneName != null">
#{oneName,jdbcType=VARCHAR},
</if> </if>
<if test="twoTag != null"> <if test="twoTag != null">
#{twoTag,jdbcType=VARCHAR}, #{twoTag,jdbcType=VARCHAR},
</if> </if>
<if test="twoName != null">
#{twoName,jdbcType=VARCHAR},
</if>
<if test="threeTag != null"> <if test="threeTag != null">
#{threeTag,jdbcType=VARCHAR}, #{threeTag,jdbcType=VARCHAR},
</if> </if>
<if test="threeName != null">
#{threeName,jdbcType=VARCHAR},
</if>
<if test="status != null"> <if test="status != null">
#{status,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
</if> </if>
@ -216,15 +239,24 @@
<if test="record.source != null"> <if test="record.source != null">
source = #{record.source,jdbcType=VARCHAR}, source = #{record.source,jdbcType=VARCHAR},
</if> </if>
<if test="record.ontTag != null"> <if test="record.oneTag != null">
ont_tag = #{record.ontTag,jdbcType=VARCHAR}, one_tag = #{record.oneTag,jdbcType=VARCHAR},
</if>
<if test="record.oneName != null">
one_name = #{record.oneName,jdbcType=VARCHAR},
</if> </if>
<if test="record.twoTag != null"> <if test="record.twoTag != null">
two_tag = #{record.twoTag,jdbcType=VARCHAR}, two_tag = #{record.twoTag,jdbcType=VARCHAR},
</if> </if>
<if test="record.twoName != null">
two_name = #{record.twoName,jdbcType=VARCHAR},
</if>
<if test="record.threeTag != null"> <if test="record.threeTag != null">
three_tag = #{record.threeTag,jdbcType=VARCHAR}, three_tag = #{record.threeTag,jdbcType=VARCHAR},
</if> </if>
<if test="record.threeName != null">
three_name = #{record.threeName,jdbcType=VARCHAR},
</if>
<if test="record.status != null"> <if test="record.status != null">
status = #{record.status,jdbcType=INTEGER}, status = #{record.status,jdbcType=INTEGER},
</if> </if>
@ -244,9 +276,12 @@
picture_url = #{record.pictureUrl,jdbcType=VARCHAR}, picture_url = #{record.pictureUrl,jdbcType=VARCHAR},
resource_type = #{record.resourceType,jdbcType=VARCHAR}, resource_type = #{record.resourceType,jdbcType=VARCHAR},
source = #{record.source,jdbcType=VARCHAR}, source = #{record.source,jdbcType=VARCHAR},
ont_tag = #{record.ontTag,jdbcType=VARCHAR}, one_tag = #{record.oneTag,jdbcType=VARCHAR},
one_name = #{record.oneName,jdbcType=VARCHAR},
two_tag = #{record.twoTag,jdbcType=VARCHAR}, two_tag = #{record.twoTag,jdbcType=VARCHAR},
two_name = #{record.twoName,jdbcType=VARCHAR},
three_tag = #{record.threeTag,jdbcType=VARCHAR}, three_tag = #{record.threeTag,jdbcType=VARCHAR},
three_name = #{record.threeName,jdbcType=VARCHAR},
status = #{record.status,jdbcType=INTEGER}, status = #{record.status,jdbcType=INTEGER},
create_time = #{record.createTime,jdbcType=TIMESTAMP} create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if test="_parameter != null"> <if test="_parameter != null">
@ -271,15 +306,24 @@
<if test="source != null"> <if test="source != null">
source = #{source,jdbcType=VARCHAR}, source = #{source,jdbcType=VARCHAR},
</if> </if>
<if test="ontTag != null"> <if test="oneTag != null">
ont_tag = #{ontTag,jdbcType=VARCHAR}, one_tag = #{oneTag,jdbcType=VARCHAR},
</if>
<if test="oneName != null">
one_name = #{oneName,jdbcType=VARCHAR},
</if> </if>
<if test="twoTag != null"> <if test="twoTag != null">
two_tag = #{twoTag,jdbcType=VARCHAR}, two_tag = #{twoTag,jdbcType=VARCHAR},
</if> </if>
<if test="twoName != null">
two_name = #{twoName,jdbcType=VARCHAR},
</if>
<if test="threeTag != null"> <if test="threeTag != null">
three_tag = #{threeTag,jdbcType=VARCHAR}, three_tag = #{threeTag,jdbcType=VARCHAR},
</if> </if>
<if test="threeName != null">
three_name = #{threeName,jdbcType=VARCHAR},
</if>
<if test="status != null"> <if test="status != null">
status = #{status,jdbcType=INTEGER}, status = #{status,jdbcType=INTEGER},
</if> </if>
@ -296,38 +340,21 @@
picture_url = #{pictureUrl,jdbcType=VARCHAR}, picture_url = #{pictureUrl,jdbcType=VARCHAR},
resource_type = #{resourceType,jdbcType=VARCHAR}, resource_type = #{resourceType,jdbcType=VARCHAR},
source = #{source,jdbcType=VARCHAR}, source = #{source,jdbcType=VARCHAR},
ont_tag = #{ontTag,jdbcType=VARCHAR}, one_tag = #{oneTag,jdbcType=VARCHAR},
one_name = #{oneName,jdbcType=VARCHAR},
two_tag = #{twoTag,jdbcType=VARCHAR}, two_tag = #{twoTag,jdbcType=VARCHAR},
two_name = #{twoName,jdbcType=VARCHAR},
three_tag = #{threeTag,jdbcType=VARCHAR}, three_tag = #{threeTag,jdbcType=VARCHAR},
three_name = #{threeName,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER}, status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP} create_time = #{createTime,jdbcType=TIMESTAMP}
where resource_id = #{resourceId,jdbcType=VARCHAR} where resource_id = #{resourceId,jdbcType=VARCHAR}
</update> </update>
<!-- <select id="selectResource" parameterType="java.lang.String" resultMap="SelectResourceMap">-->
<!-- SELECT sr.resource_id,sr.resource_name,sr.resource_type,sra.one_name,sra.two_name,sra.three_name-->
<!-- FROM sys_resource sr-->
<!-- JOIN sys_resource_and_course sra ON sr.resource_id = sra.resource_id-->
<!-- <where>-->
<!-- <if test="oneId != null and oneId != ''">-->
<!-- sra.one_id = #{oneId}-->
<!-- </if>-->
<!-- <if test="twoId != null and twoId != ''">-->
<!-- and sra.two_id = #{twoId}-->
<!-- </if>-->
<!-- <if test="threeId != null and threeId != ''">-->
<!-- and sra.three_id = #{threeId}-->
<!-- </if>-->
<!-- <if test="resourceName != null and resourceName != ''">-->
<!-- and sr.resource_name = #{resourceName}-->
<!-- </if>-->
<!-- </where>-->
<!-- order by sr.create_time-->
<!-- </select>-->
<select id="selectResource" parameterType="java.lang.String" resultMap="BaseResultMap"> <select id="selectResource" parameterType="java.lang.String" resultMap="BaseResultMap">
SELECT * SELECT *
FROM sys_resource FROM sys_resource
join
<where> <where>
<if test="oneId != null and oneId != ''"> <if test="oneId != null and oneId != ''">
ont_tag = #{oneId} ont_tag = #{oneId}

Loading…
Cancel
Save