新增三方接口

master
xiaoCJ 8 months ago
parent c0a01d45af
commit 346dfaad89

@ -75,11 +75,14 @@ public class CaseController {
sysTopicAndCourse.setTopicType("1"); sysTopicAndCourse.setTopicType("1");
sysTopicAndCourse.setTopicId(uuid); sysTopicAndCourse.setTopicId(uuid);
sysTopicAndCourse.setOneId(sysCaseQuestion.getOneId()); sysTopicAndCourse.setOneId(sysCaseQuestion.getOneId());
sysTopicAndCourse.setOneName(sysCaseQuestion.getOneName());
if (StringUtils.isNotBlank(sysCaseQuestion.getTwoId())) { if (StringUtils.isNotBlank(sysCaseQuestion.getTwoId())) {
sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId()); sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId());
sysTopicAndCourse.setTwoName(sysCaseQuestion.getTwoName());
} }
if (StringUtils.isNotBlank(sysCaseQuestion.getThreeId())) { if (StringUtils.isNotBlank(sysCaseQuestion.getThreeId())) {
sysTopicAndCourse.setThreeId(sysCaseQuestion.getThreeId()); sysTopicAndCourse.setThreeId(sysCaseQuestion.getThreeId());
sysTopicAndCourse.setThreeName(sysCaseQuestion.getThreeName());
} }
topicAndCourseMapper.insert(sysTopicAndCourse); topicAndCourseMapper.insert(sysTopicAndCourse);
return new ResultEntity<>(HttpStatus.OK, "新增成功!"); return new ResultEntity<>(HttpStatus.OK, "新增成功!");
@ -87,7 +90,7 @@ public class CaseController {
@AnonymousAccess @AnonymousAccess
@ApiOperation("案例题页面查询") @ApiOperation("案例题页面查询/无重复")
@PostMapping("selectCaseByConditions") @PostMapping("selectCaseByConditions")
public ResultEntity<PageInfo<SysCaseQuestion>> selectCaseByConditions(@RequestParam Integer index, public ResultEntity<PageInfo<SysCaseQuestion>> selectCaseByConditions(@RequestParam Integer index,
@RequestParam Integer size, @RequestParam Integer size,
@ -99,6 +102,18 @@ public class CaseController {
return new ResultEntity<PageInfo<SysCaseQuestion>>(pageInfo); return new ResultEntity<PageInfo<SysCaseQuestion>>(pageInfo);
} }
@AnonymousAccess
@ApiOperation("案例题页面查询/有重复")
@PostMapping("selectCaseByConditionsByBind")
public ResultEntity<PageInfo<SysCaseQuestion>> selectCaseByConditions(@RequestParam Integer index,
@RequestParam Integer size,
@RequestParam(required = false) String title) {
PageHelper.startPage(index, size);
List<SysCaseQuestion> list = caseQuestionMapper.selectCaseByConditionsByBind(title);
PageInfo pageInfo = new PageInfo<SysCaseQuestion>(list);
return new ResultEntity<PageInfo<SysCaseQuestion>>(pageInfo);
}
@AnonymousAccess @AnonymousAccess
@ApiOperation("案例题详细内容展示") @ApiOperation("案例题详细内容展示")
@PostMapping("selectCaseByConditionsByID") @PostMapping("selectCaseByConditionsByID")

@ -121,9 +121,9 @@ public class CourseConfigController {
@AnonymousAccess @AnonymousAccess
@ApiOperation("课程配置/资源列表展示,无重复") @ApiOperation("课程配置/资源列表展示,无重复")
@PostMapping("selectResourceByIDAndSource") @PostMapping("selectResourceByIDAndSource")
public ResultEntity<PageInfo<SysResourceDto>> selectResource(@ApiParam("课程ID") @RequestParam String oneID, public ResultEntity<PageInfo<SysResourceDto>> selectResource(@ApiParam("课程ID") @RequestParam(required = false) String oneID,
@ApiParam("章ID") @RequestParam String twoID, @ApiParam("章ID") @RequestParam(required = false) String twoID,
@ApiParam("节ID") @RequestParam String threeID, @ApiParam("节ID") @RequestParam(required = false) String threeID,
@RequestParam(required = false) String source, //子系统调用时传 @RequestParam(required = false) String source, //子系统调用时传
@RequestParam Integer index, @RequestParam Integer index,
@RequestParam Integer size) { @RequestParam Integer size) {

@ -159,9 +159,9 @@ public class TopicResourceController {
@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,
@RequestParam(required = false) String type, @RequestParam(required = false) String type,
@ApiParam("题干") @RequestParam(required = false) String content) { @ApiParam("题干") @RequestParam(required = false) String content) {
PageHelper.startPage(index, size); PageHelper.startPage(index, size);

@ -1,16 +1,109 @@
package com.sztzjy.resource_center.controller.api; package com.sztzjy.resource_center.controller.api;
import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sztzjy.resource_center.annotation.AnonymousAccess;
import com.sztzjy.resource_center.entity.*;
import com.sztzjy.resource_center.mapper.SysCaseQuestionMapper;
import com.sztzjy.resource_center.mapper.SysCaseQuestionStepMapper;
import com.sztzjy.resource_center.mapper.SysOneCatalogMapper;
import com.sztzjy.resource_center.mapper.SysTopicAndCourseMapper;
import com.sztzjy.resource_center.util.ResultEntity;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping; import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RestController; import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
@RestController @RestController
@Api(tags = "课程方面API") @Api(tags = "课程方面API")
@RequestMapping("api/sys/CaseApi") @RequestMapping("api/sys/CaseApi")
public class CaseApi { public class CaseApi {
@Autowired
private SysCaseQuestionStepMapper caseQuestionStepMapper;
@Autowired
private SysCaseQuestionMapper caseQuestionMapper;
@Autowired
private SysTopicAndCourseMapper topicAndCourseMapper;
@Autowired
private SysOneCatalogMapper sysOneCatalogMapper;
//案例题新增 SysCaseQuestion //案例题新增 SysCaseQuestion
@AnonymousAccess
@ApiOperation("案例题新增")
@PostMapping("insertCase")
public ResultEntity<HttpStatus> insertCase(@ApiParam("目前二级三级ID可以为空来源和题型要传,上架状态传true") @RequestBody SysCaseQuestion sysCaseQuestion) {
if (("3").equals(sysCaseQuestion.getType())) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "题型错误!");
}
if (StringUtils.isBlank(sysCaseQuestion.getOneId())) { //todo 目前二级三级ID可以为空
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "课程不能为空!");
}
if (StringUtils.isBlank(sysCaseQuestion.getContent()) || StringUtils.isBlank(sysCaseQuestion.getTitle())) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "题目内容不能为空!");
}
if (StringUtils.isBlank(sysCaseQuestion.getSource())) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "题目来源不能为空!");
}
String title = sysCaseQuestion.getTitle();
SysCaseQuestionExample example = new SysCaseQuestionExample();
example.createCriteria().andTitleEqualTo(title);
List<SysCaseQuestion> sysCaseQuestions = caseQuestionMapper.selectByExample(example);
if (!sysCaseQuestions.isEmpty()) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "案例名称不能重复!");
}
String uuid = IdUtil.randomUUID();
sysCaseQuestion.setCaseId(uuid);
sysCaseQuestion.setCreateTime(new Date());
sysCaseQuestion.setUnmountStatus(false);
caseQuestionMapper.insert(sysCaseQuestion);
//新增绑定关系
SysTopicAndCourse sysTopicAndCourse = new SysTopicAndCourse();
sysTopicAndCourse.setId(IdUtil.randomUUID());
sysTopicAndCourse.setTopicType("1");
sysTopicAndCourse.setTopicId(uuid);
SysOneCatalog sysOneCatalogs = getSysOneCatalogs(sysCaseQuestion.getOneId()); //name放在ID传过来
String oneId = sysOneCatalogs.getOneId();
sysTopicAndCourse.setOneId(oneId);
if (StringUtils.isNotBlank(sysCaseQuestion.getTwoId())) {
sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId());
}
if (StringUtils.isNotBlank(sysCaseQuestion.getThreeId())) {
sysTopicAndCourse.setThreeId(sysCaseQuestion.getThreeId());
}
topicAndCourseMapper.insert(sysTopicAndCourse);
return new ResultEntity<>(HttpStatus.OK, "新增成功!");
}
private SysOneCatalog getSysOneCatalogs(String systemOwner) {
SysOneCatalogExample example = new SysOneCatalogExample();
example.createCriteria().andOneNameEqualTo(systemOwner);
List<SysOneCatalog> sysOneCatalogs = sysOneCatalogMapper.selectByExample(example);
return sysOneCatalogs.get(0);
}
//案例题列表查询 schoolId keyword index size systemOwner //案例题列表查询 schoolId keyword index size systemOwner
@AnonymousAccess
@ApiOperation("案例题页面查询")
@PostMapping("selectCaseByConditions")
public ResultEntity<PageInfo<SysCaseQuestion>> selectCaseByConditions(@RequestParam Integer index,
@RequestParam Integer size,
@RequestParam(required = false) String title,
@RequestParam(required = false) String oneId) {
PageHelper.startPage(index, size);
List<SysCaseQuestion> list = caseQuestionMapper.selectCaseByConditions(title, oneId);
PageInfo pageInfo = new PageInfo<SysCaseQuestion>(list);
return new ResultEntity<PageInfo<SysCaseQuestion>>(pageInfo);
}
//案例题详情查询 caseId //案例题详情查询 caseId
//案例题删除 caseId //案例题删除 caseId
//案例题编辑 SysCaseQuestion //案例题编辑 SysCaseQuestion

@ -37,4 +37,6 @@ public interface SysCaseQuestionMapper {
int updateByPrimaryKey(SysCaseQuestion record); int updateByPrimaryKey(SysCaseQuestion record);
List<SysCaseQuestion> selectCaseByConditions(@Param("title")String title, @Param("oneId")String oneId); List<SysCaseQuestion> selectCaseByConditions(@Param("title")String title, @Param("oneId")String oneId);
List<SysCaseQuestion> selectCaseByConditionsByBind(@Param("title")String title);
} }

@ -1,444 +1,466 @@
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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.SysCaseQuestionMapper"> <mapper namespace="com.sztzjy.resource_center.mapper.SysCaseQuestionMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.resource_center.entity.SysCaseQuestion"> <resultMap id="BaseResultMap" type="com.sztzjy.resource_center.entity.SysCaseQuestion">
<id column="case_id" jdbcType="VARCHAR" property="caseId" /> <id column="case_id" jdbcType="VARCHAR" property="caseId"/>
<result column="title" jdbcType="VARCHAR" property="title" /> <result column="title" jdbcType="VARCHAR" property="title"/>
<result column="resource_data" jdbcType="VARCHAR" property="resourceData" /> <result column="resource_data" jdbcType="VARCHAR" property="resourceData"/>
<result column="source" jdbcType="VARCHAR" property="source" /> <result column="source" jdbcType="VARCHAR" property="source"/>
<result column="type" jdbcType="VARCHAR" property="type" /> <result column="type" jdbcType="VARCHAR" property="type"/>
<result column="one_id" jdbcType="VARCHAR" property="oneId" /> <result column="one_id" jdbcType="VARCHAR" property="oneId"/>
<result column="one_name" jdbcType="VARCHAR" property="oneName" /> <result column="one_name" jdbcType="VARCHAR" property="oneName"/>
<result column="two_id" jdbcType="VARCHAR" property="twoId" /> <result column="two_id" jdbcType="VARCHAR" property="twoId"/>
<result column="two_name" jdbcType="VARCHAR" property="twoName" /> <result column="two_name" jdbcType="VARCHAR" property="twoName"/>
<result column="three_id" jdbcType="VARCHAR" property="threeId" /> <result column="three_id" jdbcType="VARCHAR" property="threeId"/>
<result column="three_name" jdbcType="VARCHAR" property="threeName" /> <result column="three_name" jdbcType="VARCHAR" property="threeName"/>
<result column="unmount_status" jdbcType="BIT" property="unmountStatus" /> <result column="unmount_status" jdbcType="BIT" property="unmountStatus"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.resource_center.entity.SysCaseQuestion"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.resource_center.entity.SysCaseQuestion">
<result column="content" jdbcType="LONGVARCHAR" property="content" /> <result column="content" jdbcType="LONGVARCHAR" property="content"/>
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
<foreach collection="oredCriteria" item="criteria" separator="or"> <foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid"> <if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")"> <trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion"> <foreach collection="criteria.criteria" item="criterion">
<choose> <choose>
<when test="criterion.noValue"> <when test="criterion.noValue">
and ${criterion.condition} and ${criterion.condition}
</when> </when>
<when test="criterion.singleValue"> <when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value} and ${criterion.condition} #{criterion.value}
</when> </when>
<when test="criterion.betweenValue"> <when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when> </when>
<when test="criterion.listValue"> <when test="criterion.listValue">
and ${criterion.condition} and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> <foreach close=")" collection="criterion.value" item="listItem" open="("
#{listItem} separator=",">
</foreach> #{listItem}
</when> </foreach>
</choose> </when>
</choose>
</foreach>
</trim>
</if>
</foreach> </foreach>
</trim> </where>
</if> </sql>
</foreach> <sql id="Update_By_Example_Where_Clause">
</where> <where>
</sql> <foreach collection="example.oredCriteria" item="criteria" separator="or">
<sql id="Update_By_Example_Where_Clause"> <if test="criteria.valid">
<where> <trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="example.oredCriteria" item="criteria" separator="or"> <foreach collection="criteria.criteria" item="criterion">
<if test="criteria.valid"> <choose>
<trim prefix="(" prefixOverrides="and" suffix=")"> <when test="criterion.noValue">
<foreach collection="criteria.criteria" item="criterion"> and ${criterion.condition}
<choose> </when>
<when test="criterion.noValue"> <when test="criterion.singleValue">
and ${criterion.condition} and ${criterion.condition} #{criterion.value}
</when> </when>
<when test="criterion.singleValue"> <when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when> </when>
<when test="criterion.betweenValue"> <when test="criterion.listValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} and ${criterion.condition}
</when> <foreach close=")" collection="criterion.value" item="listItem" open="("
<when test="criterion.listValue"> separator=",">
and ${criterion.condition} #{listItem}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> </foreach>
#{listItem} </when>
</foreach> </choose>
</when> </foreach>
</choose> </trim>
</if>
</foreach> </foreach>
</trim> </where>
</if> </sql>
</foreach> <sql id="Base_Column_List">
</where> case_id
</sql> , title, resource_data, source, type, one_id, one_name, two_id, two_name,
<sql id="Base_Column_List">
case_id, title, resource_data, source, type, one_id, one_name, two_id, two_name,
three_id, three_name, unmount_status, create_time, update_time three_id, three_name, unmount_status, create_time, update_time
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
content content
</sql> </sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample" resultMap="ResultMapWithBLOBs"> <select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample"
select resultMap="ResultMapWithBLOBs">
<if test="distinct"> select
distinct <if test="distinct">
</if> distinct
<include refid="Base_Column_List" /> </if>
, <include refid="Base_Column_List"/>
<include refid="Blob_Column_List" /> ,
from sys_case_questions <include refid="Blob_Column_List"/>
<if test="_parameter != null"> from sys_case_questions
<include refid="Example_Where_Clause" /> <if test="_parameter != null">
</if> <include refid="Example_Where_Clause"/>
<if test="orderByClause != null"> </if>
order by ${orderByClause} <if test="orderByClause != null">
</if> order by ${orderByClause}
</select> </if>
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample" resultMap="BaseResultMap"> </select>
select <select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample"
<if test="distinct"> resultMap="BaseResultMap">
distinct select
</if> <if test="distinct">
<include refid="Base_Column_List" /> distinct
from sys_case_questions </if>
<if test="_parameter != null"> <include refid="Base_Column_List"/>
<include refid="Example_Where_Clause" /> from sys_case_questions
</if> <if test="_parameter != null">
<if test="orderByClause != null"> <include refid="Example_Where_Clause"/>
order by ${orderByClause} </if>
</if> <if test="orderByClause != null">
</select> order by ${orderByClause}
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs"> </if>
select </select>
<include refid="Base_Column_List" /> <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
, select
<include refid="Blob_Column_List" /> <include refid="Base_Column_List"/>
from sys_case_questions ,
where case_id = #{caseId,jdbcType=VARCHAR} <include refid="Blob_Column_List"/>
</select> from sys_case_questions
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> where case_id = #{caseId,jdbcType=VARCHAR}
delete from sys_case_questions </select>
where case_id = #{caseId,jdbcType=VARCHAR} <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
</delete> delete
<delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample"> from sys_case_questions
delete from sys_case_questions where case_id = #{caseId,jdbcType=VARCHAR}
<if test="_parameter != null"> </delete>
<include refid="Example_Where_Clause" /> <delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample">
</if> delete from sys_case_questions
</delete> <if test="_parameter != null">
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion"> <include refid="Example_Where_Clause"/>
insert into sys_case_questions (case_id, title, resource_data, </if>
source, type, one_id, </delete>
one_name, two_id, two_name, <insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
three_id, three_name, unmount_status, insert into sys_case_questions (case_id, title, resource_data,
create_time, update_time, content source, type, one_id,
) one_name, two_id, two_name,
values (#{caseId,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{resourceData,jdbcType=VARCHAR}, three_id, three_name, unmount_status,
#{source,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{oneId,jdbcType=VARCHAR}, create_time, update_time, content)
#{oneName,jdbcType=VARCHAR}, #{twoId,jdbcType=VARCHAR}, #{twoName,jdbcType=VARCHAR}, values (#{caseId,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{resourceData,jdbcType=VARCHAR},
#{threeId,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR}, #{unmountStatus,jdbcType=BIT}, #{source,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{oneId,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARCHAR} #{oneName,jdbcType=VARCHAR}, #{twoId,jdbcType=VARCHAR}, #{twoName,jdbcType=VARCHAR},
) #{threeId,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR}, #{unmountStatus,jdbcType=BIT},
</insert> #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARCHAR})
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion"> </insert>
insert into sys_case_questions <insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
<trim prefix="(" suffix=")" suffixOverrides=","> insert into sys_case_questions
<if test="caseId != null"> <trim prefix="(" suffix=")" suffixOverrides=",">
case_id, <if test="caseId != null">
</if> case_id,
<if test="title != null"> </if>
title, <if test="title != null">
</if> title,
<if test="resourceData != null"> </if>
resource_data, <if test="resourceData != null">
</if> resource_data,
<if test="source != null"> </if>
source, <if test="source != null">
</if> source,
<if test="type != null"> </if>
type, <if test="type != null">
</if> type,
<if test="oneId != null"> </if>
one_id, <if test="oneId != null">
</if> one_id,
<if test="oneName != null"> </if>
one_name, <if test="oneName != null">
</if> one_name,
<if test="twoId != null"> </if>
two_id, <if test="twoId != null">
</if> two_id,
<if test="twoName != null"> </if>
two_name, <if test="twoName != null">
</if> two_name,
<if test="threeId != null"> </if>
three_id, <if test="threeId != null">
</if> three_id,
<if test="threeName != null"> </if>
three_name, <if test="threeName != null">
</if> three_name,
<if test="unmountStatus != null"> </if>
unmount_status, <if test="unmountStatus != null">
</if> unmount_status,
<if test="createTime != null"> </if>
create_time, <if test="createTime != null">
</if> create_time,
<if test="updateTime != null"> </if>
update_time, <if test="updateTime != null">
</if> update_time,
<if test="content != null"> </if>
content, <if test="content != null">
</if> content,
</trim> </if>
<trim prefix="values (" suffix=")" suffixOverrides=","> </trim>
<if test="caseId != null"> <trim prefix="values (" suffix=")" suffixOverrides=",">
#{caseId,jdbcType=VARCHAR}, <if test="caseId != null">
</if> #{caseId,jdbcType=VARCHAR},
<if test="title != null"> </if>
#{title,jdbcType=VARCHAR}, <if test="title != null">
</if> #{title,jdbcType=VARCHAR},
<if test="resourceData != null"> </if>
#{resourceData,jdbcType=VARCHAR}, <if test="resourceData != null">
</if> #{resourceData,jdbcType=VARCHAR},
<if test="source != null"> </if>
#{source,jdbcType=VARCHAR}, <if test="source != null">
</if> #{source,jdbcType=VARCHAR},
<if test="type != null"> </if>
#{type,jdbcType=VARCHAR}, <if test="type != null">
</if> #{type,jdbcType=VARCHAR},
<if test="oneId != null"> </if>
#{oneId,jdbcType=VARCHAR}, <if test="oneId != null">
</if> #{oneId,jdbcType=VARCHAR},
<if test="oneName != null"> </if>
#{oneName,jdbcType=VARCHAR}, <if test="oneName != null">
</if> #{oneName,jdbcType=VARCHAR},
<if test="twoId != null"> </if>
#{twoId,jdbcType=VARCHAR}, <if test="twoId != null">
</if> #{twoId,jdbcType=VARCHAR},
<if test="twoName != null"> </if>
#{twoName,jdbcType=VARCHAR}, <if test="twoName != null">
</if> #{twoName,jdbcType=VARCHAR},
<if test="threeId != null"> </if>
#{threeId,jdbcType=VARCHAR}, <if test="threeId != null">
</if> #{threeId,jdbcType=VARCHAR},
<if test="threeName != null"> </if>
#{threeName,jdbcType=VARCHAR}, <if test="threeName != null">
</if> #{threeName,jdbcType=VARCHAR},
<if test="unmountStatus != null"> </if>
#{unmountStatus,jdbcType=BIT}, <if test="unmountStatus != null">
</if> #{unmountStatus,jdbcType=BIT},
<if test="createTime != null"> </if>
#{createTime,jdbcType=TIMESTAMP}, <if test="createTime != null">
</if> #{createTime,jdbcType=TIMESTAMP},
<if test="updateTime != null"> </if>
#{updateTime,jdbcType=TIMESTAMP}, <if test="updateTime != null">
</if> #{updateTime,jdbcType=TIMESTAMP},
<if test="content != null"> </if>
#{content,jdbcType=LONGVARCHAR}, <if test="content != null">
</if> #{content,jdbcType=LONGVARCHAR},
</trim> </if>
</insert> </trim>
<select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample" resultType="java.lang.Long"> </insert>
select count(*) from sys_case_questions <select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample"
<if test="_parameter != null"> resultType="java.lang.Long">
<include refid="Example_Where_Clause" /> select count(*) from sys_case_questions
</if> <if test="_parameter != null">
</select> <include refid="Example_Where_Clause"/>
<update id="updateByExampleSelective" parameterType="map"> </if>
update sys_case_questions </select>
<set> <update id="updateByExampleSelective" parameterType="map">
<if test="record.caseId != null"> update sys_case_questions
case_id = #{record.caseId,jdbcType=VARCHAR}, <set>
</if> <if test="record.caseId != null">
<if test="record.title != null"> case_id = #{record.caseId,jdbcType=VARCHAR},
</if>
<if test="record.title != null">
title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.resourceData != null">
resource_data = #{record.resourceData,jdbcType=VARCHAR},
</if>
<if test="record.source != null">
source = #{record.source,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.oneId != null">
one_id = #{record.oneId,jdbcType=VARCHAR},
</if>
<if test="record.oneName != null">
one_name = #{record.oneName,jdbcType=VARCHAR},
</if>
<if test="record.twoId != null">
two_id = #{record.twoId,jdbcType=VARCHAR},
</if>
<if test="record.twoName != null">
two_name = #{record.twoName,jdbcType=VARCHAR},
</if>
<if test="record.threeId != null">
three_id = #{record.threeId,jdbcType=VARCHAR},
</if>
<if test="record.threeName != null">
three_name = #{record.threeName,jdbcType=VARCHAR},
</if>
<if test="record.unmountStatus != null">
unmount_status = #{record.unmountStatus,jdbcType=BIT},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.content != null">
content = #{record.content,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update sys_case_questions
set case_id = #{record.caseId,jdbcType=VARCHAR},
title = #{record.title,jdbcType=VARCHAR}, title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.resourceData != null">
resource_data = #{record.resourceData,jdbcType=VARCHAR}, resource_data = #{record.resourceData,jdbcType=VARCHAR},
</if>
<if test="record.source != null">
source = #{record.source,jdbcType=VARCHAR}, source = #{record.source,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=VARCHAR}, type = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.oneId != null">
one_id = #{record.oneId,jdbcType=VARCHAR}, one_id = #{record.oneId,jdbcType=VARCHAR},
</if>
<if test="record.oneName != null">
one_name = #{record.oneName,jdbcType=VARCHAR}, one_name = #{record.oneName,jdbcType=VARCHAR},
</if>
<if test="record.twoId != null">
two_id = #{record.twoId,jdbcType=VARCHAR}, two_id = #{record.twoId,jdbcType=VARCHAR},
</if>
<if test="record.twoName != null">
two_name = #{record.twoName,jdbcType=VARCHAR}, two_name = #{record.twoName,jdbcType=VARCHAR},
</if>
<if test="record.threeId != null">
three_id = #{record.threeId,jdbcType=VARCHAR}, three_id = #{record.threeId,jdbcType=VARCHAR},
</if>
<if test="record.threeName != null">
three_name = #{record.threeName,jdbcType=VARCHAR}, three_name = #{record.threeName,jdbcType=VARCHAR},
</if>
<if test="record.unmountStatus != null">
unmount_status = #{record.unmountStatus,jdbcType=BIT}, unmount_status = #{record.unmountStatus,jdbcType=BIT},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if> content = #{record.content,jdbcType=LONGVARCHAR}
<if test="record.content != null"> <if test="_parameter != null">
content = #{record.content,jdbcType=LONGVARCHAR}, <include refid="Update_By_Example_Where_Clause"/>
</if> </if>
</set> </update>
<if test="_parameter != null"> <update id="updateByExample" parameterType="map">
<include refid="Update_By_Example_Where_Clause" /> update sys_case_questions
</if> set case_id = #{record.caseId,jdbcType=VARCHAR},
</update> title = #{record.title,jdbcType=VARCHAR},
<update id="updateByExampleWithBLOBs" parameterType="map"> resource_data = #{record.resourceData,jdbcType=VARCHAR},
update sys_case_questions source = #{record.source,jdbcType=VARCHAR},
set case_id = #{record.caseId,jdbcType=VARCHAR}, type = #{record.type,jdbcType=VARCHAR},
title = #{record.title,jdbcType=VARCHAR}, one_id = #{record.oneId,jdbcType=VARCHAR},
resource_data = #{record.resourceData,jdbcType=VARCHAR}, one_name = #{record.oneName,jdbcType=VARCHAR},
source = #{record.source,jdbcType=VARCHAR}, two_id = #{record.twoId,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR}, two_name = #{record.twoName,jdbcType=VARCHAR},
one_id = #{record.oneId,jdbcType=VARCHAR}, three_id = #{record.threeId,jdbcType=VARCHAR},
one_name = #{record.oneName,jdbcType=VARCHAR}, three_name = #{record.threeName,jdbcType=VARCHAR},
two_id = #{record.twoId,jdbcType=VARCHAR}, unmount_status = #{record.unmountStatus,jdbcType=BIT},
two_name = #{record.twoName,jdbcType=VARCHAR}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
three_id = #{record.threeId,jdbcType=VARCHAR}, update_time = #{record.updateTime,jdbcType=TIMESTAMP}
three_name = #{record.threeName,jdbcType=VARCHAR}, <if test="_parameter != null">
unmount_status = #{record.unmountStatus,jdbcType=BIT}, <include refid="Update_By_Example_Where_Clause"/>
create_time = #{record.createTime,jdbcType=TIMESTAMP}, </if>
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, </update>
content = #{record.content,jdbcType=LONGVARCHAR} <update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
<if test="_parameter != null"> update sys_case_questions
<include refid="Update_By_Example_Where_Clause" /> <set>
</if> <if test="title != null">
</update> title = #{title,jdbcType=VARCHAR},
<update id="updateByExample" parameterType="map"> </if>
update sys_case_questions <if test="resourceData != null">
set case_id = #{record.caseId,jdbcType=VARCHAR}, resource_data = #{resourceData,jdbcType=VARCHAR},
title = #{record.title,jdbcType=VARCHAR}, </if>
resource_data = #{record.resourceData,jdbcType=VARCHAR}, <if test="source != null">
source = #{record.source,jdbcType=VARCHAR}, source = #{source,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR}, </if>
one_id = #{record.oneId,jdbcType=VARCHAR}, <if test="type != null">
one_name = #{record.oneName,jdbcType=VARCHAR}, type = #{type,jdbcType=VARCHAR},
two_id = #{record.twoId,jdbcType=VARCHAR}, </if>
two_name = #{record.twoName,jdbcType=VARCHAR}, <if test="oneId != null">
three_id = #{record.threeId,jdbcType=VARCHAR}, one_id = #{oneId,jdbcType=VARCHAR},
three_name = #{record.threeName,jdbcType=VARCHAR}, </if>
unmount_status = #{record.unmountStatus,jdbcType=BIT}, <if test="oneName != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP}, one_name = #{oneName,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP} </if>
<if test="_parameter != null"> <if test="twoId != null">
<include refid="Update_By_Example_Where_Clause" /> two_id = #{twoId,jdbcType=VARCHAR},
</if> </if>
</update> <if test="twoName != null">
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion"> two_name = #{twoName,jdbcType=VARCHAR},
update sys_case_questions </if>
<set> <if test="threeId != null">
<if test="title != null"> three_id = #{threeId,jdbcType=VARCHAR},
title = #{title,jdbcType=VARCHAR}, </if>
</if> <if test="threeName != null">
<if test="resourceData != null"> three_name = #{threeName,jdbcType=VARCHAR},
resource_data = #{resourceData,jdbcType=VARCHAR}, </if>
</if> <if test="unmountStatus != null">
<if test="source != null"> unmount_status = #{unmountStatus,jdbcType=BIT},
source = #{source,jdbcType=VARCHAR}, </if>
</if> <if test="createTime != null">
<if test="type != null"> create_time = #{createTime,jdbcType=TIMESTAMP},
type = #{type,jdbcType=VARCHAR}, </if>
</if> <if test="updateTime != null">
<if test="oneId != null"> update_time = #{updateTime,jdbcType=TIMESTAMP},
one_id = #{oneId,jdbcType=VARCHAR}, </if>
</if> <if test="content != null">
<if test="oneName != null"> content = #{content,jdbcType=LONGVARCHAR},
one_name = #{oneName,jdbcType=VARCHAR}, </if>
</if> </set>
<if test="twoId != null"> where case_id = #{caseId,jdbcType=VARCHAR}
two_id = #{twoId,jdbcType=VARCHAR}, </update>
</if> <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
<if test="twoName != null"> update sys_case_questions
two_name = #{twoName,jdbcType=VARCHAR}, set title = #{title,jdbcType=VARCHAR},
</if> resource_data = #{resourceData,jdbcType=VARCHAR},
<if test="threeId != null"> source = #{source,jdbcType=VARCHAR},
three_id = #{threeId,jdbcType=VARCHAR}, type = #{type,jdbcType=VARCHAR},
</if> one_id = #{oneId,jdbcType=VARCHAR},
<if test="threeName != null"> one_name = #{oneName,jdbcType=VARCHAR},
three_name = #{threeName,jdbcType=VARCHAR}, two_id = #{twoId,jdbcType=VARCHAR},
</if> two_name = #{twoName,jdbcType=VARCHAR},
<if test="unmountStatus != null"> three_id = #{threeId,jdbcType=VARCHAR},
unmount_status = #{unmountStatus,jdbcType=BIT}, three_name = #{threeName,jdbcType=VARCHAR},
</if> unmount_status = #{unmountStatus,jdbcType=BIT},
<if test="createTime != null"> create_time = #{createTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
</if> content = #{content,jdbcType=LONGVARCHAR}
<if test="updateTime != null"> where case_id = #{caseId,jdbcType=VARCHAR}
update_time = #{updateTime,jdbcType=TIMESTAMP}, </update>
</if> <update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
<if test="content != null"> update sys_case_questions
content = #{content,jdbcType=LONGVARCHAR}, set title = #{title,jdbcType=VARCHAR},
</if> resource_data = #{resourceData,jdbcType=VARCHAR},
</set> source = #{source,jdbcType=VARCHAR},
where case_id = #{caseId,jdbcType=VARCHAR} type = #{type,jdbcType=VARCHAR},
</update> one_id = #{oneId,jdbcType=VARCHAR},
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion"> one_name = #{oneName,jdbcType=VARCHAR},
update sys_case_questions two_id = #{twoId,jdbcType=VARCHAR},
set title = #{title,jdbcType=VARCHAR}, two_name = #{twoName,jdbcType=VARCHAR},
resource_data = #{resourceData,jdbcType=VARCHAR}, three_id = #{threeId,jdbcType=VARCHAR},
source = #{source,jdbcType=VARCHAR}, three_name = #{threeName,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR}, unmount_status = #{unmountStatus,jdbcType=BIT},
one_id = #{oneId,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=TIMESTAMP},
one_name = #{oneName,jdbcType=VARCHAR}, update_time = #{updateTime,jdbcType=TIMESTAMP}
two_id = #{twoId,jdbcType=VARCHAR}, where case_id = #{caseId,jdbcType=VARCHAR}
two_name = #{twoName,jdbcType=VARCHAR}, </update>
three_id = #{threeId,jdbcType=VARCHAR},
three_name = #{threeName,jdbcType=VARCHAR}, <!--条件查询 无重复数据-->
unmount_status = #{unmountStatus,jdbcType=BIT}, <select id="selectCaseByConditions" parameterType="java.lang.String" resultMap="BaseResultMap">
create_time = #{createTime,jdbcType=TIMESTAMP}, select * from sys_case_questions s
update_time = #{updateTime,jdbcType=TIMESTAMP}, <where>
content = #{content,jdbcType=LONGVARCHAR} <if test="oneId != null and oneId != ''">
where case_id = #{caseId,jdbcType=VARCHAR} s.one_id = #{oneId}
</update> </if>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion"> <if test="title != null and title != ''">
update sys_case_questions and s.title = #{title}
set title = #{title,jdbcType=VARCHAR}, </if>
resource_data = #{resourceData,jdbcType=VARCHAR}, and s.unmount_status is false
source = #{source,jdbcType=VARCHAR}, </where>
type = #{type,jdbcType=VARCHAR}, order by s.create_time
one_id = #{oneId,jdbcType=VARCHAR}, </select>
one_name = #{oneName,jdbcType=VARCHAR},
two_id = #{twoId,jdbcType=VARCHAR},
two_name = #{twoName,jdbcType=VARCHAR},
three_id = #{threeId,jdbcType=VARCHAR},
three_name = #{threeName,jdbcType=VARCHAR},
unmount_status = #{unmountStatus,jdbcType=BIT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where case_id = #{caseId,jdbcType=VARCHAR}
</update>
<!--条件查询--> <!--条件查询加绑定关系,有重复数据-->
<select id="selectCaseByConditions" parameterType="java.lang.String" resultMap="BaseResultMap"> <select id="selectCaseByConditionsByBind" parameterType="java.lang.String" resultMap="BaseResultMap">
select * from sys_case_questions s select st.*,s.title,s.content,s.resource_data,s.source,s.type,s.unmount_status,s.create_time
<where> from sys_case_questions s
<if test="oneId != null and oneId != ''"> join sys_topic_and_course st
s.one_id = #{oneId} on s.case_id = st.topic_id
</if> <where>
<if test="title != null and title != ''"> <if test="title != null and title != ''">
and s.title = #{title} and s.title = #{title}
</if> </if>
and s.unmount_status is false and s.unmount_status is false
</where> </where>
</select> order by s.create_time
</select>
</mapper> </mapper>

@ -403,15 +403,15 @@
left JOIN sys_topic_and_course st left 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 != ''">
<!-- st.one_id = #{oneID}--> st.one_id = #{oneID}
<!-- </if>--> </if>
<!-- <if test="twoID != null and twoID != ''">--> <if test="twoID != null and twoID != ''">
<!-- and st.two_id = #{twoID}--> and st.two_id = #{twoID}
<!-- </if>--> </if>
<!-- <if test="threeID != null and threeID != '' ">--> <if test="threeID != null and threeID != '' ">
<!-- and st.three_id = #{threeID}--> and st.three_id = #{threeID}
<!-- </if>--> </if>
<if test="type != null and type != '' "> <if test="type != null and type != '' ">
and sb.type = #{type} and sb.type = #{type}
</if> </if>

@ -406,9 +406,15 @@
sys_resource_and_course sc sys_resource_and_course sc
on sr.resource_id =sc.resource_id on sr.resource_id =sc.resource_id
<where> <where>
sc.one_id = #{oneId} <if test="oneId != null and oneId != ''">
and sc.two_id = #{twoId} sc.one_id = #{oneId}
and sc.three_id = #{threeId} </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>
</where> </where>
order by sr.create_time order by sr.create_time
</select> </select>

Loading…
Cancel
Save