新增三方接口

master
xiaoCJ 8 months ago
parent c0a01d45af
commit 346dfaad89

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

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

@ -159,9 +159,9 @@ public class TopicResourceController {
@PostMapping("selectTopicByConditions") //todo 关于老师删除的题库如何查询
private ResultEntity<PageInfo<SysObjectiveQuestionsDto>> selectTopicByConditions(@RequestParam Integer index,
@RequestParam Integer size,
@RequestParam String oneID,
@RequestParam String twoID,
@RequestParam String threeID,
@RequestParam (required = false)String oneID,
@RequestParam (required = false)String twoID,
@RequestParam (required = false)String threeID,
@RequestParam(required = false) String type,
@ApiParam("题干") @RequestParam(required = false) String content) {
PageHelper.startPage(index, size);

@ -1,16 +1,109 @@
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 org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;
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
@Api(tags = "课程方面API")
@RequestMapping("api/sys/CaseApi")
public class CaseApi {
@Autowired
private SysCaseQuestionStepMapper caseQuestionStepMapper;
@Autowired
private SysCaseQuestionMapper caseQuestionMapper;
@Autowired
private SysTopicAndCourseMapper topicAndCourseMapper;
@Autowired
private SysOneCatalogMapper sysOneCatalogMapper;
//案例题新增 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
@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
//案例题编辑 SysCaseQuestion

@ -37,4 +37,6 @@ public interface SysCaseQuestionMapper {
int updateByPrimaryKey(SysCaseQuestion record);
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"?>
<!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">
<resultMap id="BaseResultMap" type="com.sztzjy.resource_center.entity.SysCaseQuestion">
<id column="case_id" jdbcType="VARCHAR" property="caseId" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="resource_data" jdbcType="VARCHAR" property="resourceData" />
<result column="source" jdbcType="VARCHAR" property="source" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="one_id" jdbcType="VARCHAR" property="oneId" />
<result column="one_name" jdbcType="VARCHAR" property="oneName" />
<result column="two_id" jdbcType="VARCHAR" property="twoId" />
<result column="two_name" jdbcType="VARCHAR" property="twoName" />
<result column="three_id" jdbcType="VARCHAR" property="threeId" />
<result column="three_name" jdbcType="VARCHAR" property="threeName" />
<result column="unmount_status" jdbcType="BIT" property="unmountStatus" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.resource_center.entity.SysCaseQuestion">
<result column="content" jdbcType="LONGVARCHAR" property="content" />
</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.SysCaseQuestion">
<id column="case_id" jdbcType="VARCHAR" property="caseId"/>
<result column="title" jdbcType="VARCHAR" property="title"/>
<result column="resource_data" jdbcType="VARCHAR" property="resourceData"/>
<result column="source" jdbcType="VARCHAR" property="source"/>
<result column="type" jdbcType="VARCHAR" property="type"/>
<result column="one_id" jdbcType="VARCHAR" property="oneId"/>
<result column="one_name" jdbcType="VARCHAR" property="oneName"/>
<result column="two_id" jdbcType="VARCHAR" property="twoId"/>
<result column="two_name" jdbcType="VARCHAR" property="twoName"/>
<result column="three_id" jdbcType="VARCHAR" property="threeId"/>
<result column="three_name" jdbcType="VARCHAR" property="threeName"/>
<result column="unmount_status" jdbcType="BIT" property="unmountStatus"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.resource_center.entity.SysCaseQuestion">
<result column="content" jdbcType="LONGVARCHAR" property="content"/>
</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">
case_id, title, resource_data, source, type, one_id, one_name, two_id, two_name,
</where>
</sql>
<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
</sql>
<sql id="Blob_Column_List">
content
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from sys_case_questions
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from sys_case_questions
<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="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from sys_case_questions
where case_id = #{caseId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from sys_case_questions
where case_id = #{caseId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample">
delete from sys_case_questions
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
insert into sys_case_questions (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, content
)
values (#{caseId,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{resourceData,jdbcType=VARCHAR},
#{source,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{oneId,jdbcType=VARCHAR},
#{oneName,jdbcType=VARCHAR}, #{twoId,jdbcType=VARCHAR}, #{twoName,jdbcType=VARCHAR},
#{threeId,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR}, #{unmountStatus,jdbcType=BIT},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
insert into sys_case_questions
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="caseId != null">
case_id,
</if>
<if test="title != null">
title,
</if>
<if test="resourceData != null">
resource_data,
</if>
<if test="source != null">
source,
</if>
<if test="type != null">
type,
</if>
<if test="oneId != null">
one_id,
</if>
<if test="oneName != null">
one_name,
</if>
<if test="twoId != null">
two_id,
</if>
<if test="twoName != null">
two_name,
</if>
<if test="threeId != null">
three_id,
</if>
<if test="threeName != null">
three_name,
</if>
<if test="unmountStatus != null">
unmount_status,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="content != null">
content,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="caseId != null">
#{caseId,jdbcType=VARCHAR},
</if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="resourceData != null">
#{resourceData,jdbcType=VARCHAR},
</if>
<if test="source != null">
#{source,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="oneId != null">
#{oneId,jdbcType=VARCHAR},
</if>
<if test="oneName != null">
#{oneName,jdbcType=VARCHAR},
</if>
<if test="twoId != null">
#{twoId,jdbcType=VARCHAR},
</if>
<if test="twoName != null">
#{twoName,jdbcType=VARCHAR},
</if>
<if test="threeId != null">
#{threeId,jdbcType=VARCHAR},
</if>
<if test="threeName != null">
#{threeName,jdbcType=VARCHAR},
</if>
<if test="unmountStatus != null">
#{unmountStatus,jdbcType=BIT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="content != null">
#{content,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample" resultType="java.lang.Long">
select count(*) from sys_case_questions
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_case_questions
<set>
<if test="record.caseId != null">
case_id = #{record.caseId,jdbcType=VARCHAR},
</if>
<if test="record.title != null">
</sql>
<sql id="Blob_Column_List">
content
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample"
resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
from sys_case_questions
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample"
resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List"/>
from sys_case_questions
<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="ResultMapWithBLOBs">
select
<include refid="Base_Column_List"/>
,
<include refid="Blob_Column_List"/>
from sys_case_questions
where case_id = #{caseId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete
from sys_case_questions
where case_id = #{caseId,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample">
delete from sys_case_questions
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
insert into sys_case_questions (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, content)
values (#{caseId,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{resourceData,jdbcType=VARCHAR},
#{source,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{oneId,jdbcType=VARCHAR},
#{oneName,jdbcType=VARCHAR}, #{twoId,jdbcType=VARCHAR}, #{twoName,jdbcType=VARCHAR},
#{threeId,jdbcType=VARCHAR}, #{threeName,jdbcType=VARCHAR}, #{unmountStatus,jdbcType=BIT},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
insert into sys_case_questions
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="caseId != null">
case_id,
</if>
<if test="title != null">
title,
</if>
<if test="resourceData != null">
resource_data,
</if>
<if test="source != null">
source,
</if>
<if test="type != null">
type,
</if>
<if test="oneId != null">
one_id,
</if>
<if test="oneName != null">
one_name,
</if>
<if test="twoId != null">
two_id,
</if>
<if test="twoName != null">
two_name,
</if>
<if test="threeId != null">
three_id,
</if>
<if test="threeName != null">
three_name,
</if>
<if test="unmountStatus != null">
unmount_status,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="content != null">
content,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="caseId != null">
#{caseId,jdbcType=VARCHAR},
</if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="resourceData != null">
#{resourceData,jdbcType=VARCHAR},
</if>
<if test="source != null">
#{source,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="oneId != null">
#{oneId,jdbcType=VARCHAR},
</if>
<if test="oneName != null">
#{oneName,jdbcType=VARCHAR},
</if>
<if test="twoId != null">
#{twoId,jdbcType=VARCHAR},
</if>
<if test="twoName != null">
#{twoName,jdbcType=VARCHAR},
</if>
<if test="threeId != null">
#{threeId,jdbcType=VARCHAR},
</if>
<if test="threeName != null">
#{threeName,jdbcType=VARCHAR},
</if>
<if test="unmountStatus != null">
#{unmountStatus,jdbcType=BIT},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="content != null">
#{content,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample"
resultType="java.lang.Long">
select count(*) from sys_case_questions
<if test="_parameter != null">
<include refid="Example_Where_Clause"/>
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update sys_case_questions
<set>
<if test="record.caseId != 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},
</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},
resource_data = #{record.resourceData,jdbcType=VARCHAR},
source = #{record.source,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR},
one_id = #{record.oneId,jdbcType=VARCHAR},
one_name = #{record.oneName,jdbcType=VARCHAR},
two_id = #{record.twoId,jdbcType=VARCHAR},
two_name = #{record.twoName,jdbcType=VARCHAR},
three_id = #{record.threeId,jdbcType=VARCHAR},
three_name = #{record.threeName,jdbcType=VARCHAR},
unmount_status = #{record.unmountStatus,jdbcType=BIT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
content = #{record.content,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_case_questions
set case_id = #{record.caseId,jdbcType=VARCHAR},
title = #{record.title,jdbcType=VARCHAR},
resource_data = #{record.resourceData,jdbcType=VARCHAR},
source = #{record.source,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR},
one_id = #{record.oneId,jdbcType=VARCHAR},
one_name = #{record.oneName,jdbcType=VARCHAR},
two_id = #{record.twoId,jdbcType=VARCHAR},
two_name = #{record.twoName,jdbcType=VARCHAR},
three_id = #{record.threeId,jdbcType=VARCHAR},
three_name = #{record.threeName,jdbcType=VARCHAR},
unmount_status = #{record.unmountStatus,jdbcType=BIT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
update sys_case_questions
<set>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="resourceData != null">
resource_data = #{resourceData,jdbcType=VARCHAR},
</if>
<if test="source != null">
source = #{source,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=VARCHAR},
</if>
<if test="oneId != null">
one_id = #{oneId,jdbcType=VARCHAR},
</if>
<if test="oneName != null">
one_name = #{oneName,jdbcType=VARCHAR},
</if>
<if test="twoId != null">
two_id = #{twoId,jdbcType=VARCHAR},
</if>
<if test="twoName != null">
two_name = #{twoName,jdbcType=VARCHAR},
</if>
<if test="threeId != null">
three_id = #{threeId,jdbcType=VARCHAR},
</if>
<if test="threeName != null">
three_name = #{threeName,jdbcType=VARCHAR},
</if>
<if test="unmountStatus != null">
unmount_status = #{unmountStatus,jdbcType=BIT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="content != null">
content = #{content,jdbcType=LONGVARCHAR},
</if>
</set>
where case_id = #{caseId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
update sys_case_questions
set title = #{title,jdbcType=VARCHAR},
resource_data = #{resourceData,jdbcType=VARCHAR},
source = #{source,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
one_id = #{oneId,jdbcType=VARCHAR},
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},
content = #{content,jdbcType=LONGVARCHAR}
where case_id = #{caseId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
update sys_case_questions
set title = #{title,jdbcType=VARCHAR},
resource_data = #{resourceData,jdbcType=VARCHAR},
source = #{source,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
one_id = #{oneId,jdbcType=VARCHAR},
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>
content = #{record.content,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByExample" parameterType="map">
update sys_case_questions
set case_id = #{record.caseId,jdbcType=VARCHAR},
title = #{record.title,jdbcType=VARCHAR},
resource_data = #{record.resourceData,jdbcType=VARCHAR},
source = #{record.source,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR},
one_id = #{record.oneId,jdbcType=VARCHAR},
one_name = #{record.oneName,jdbcType=VARCHAR},
two_id = #{record.twoId,jdbcType=VARCHAR},
two_name = #{record.twoName,jdbcType=VARCHAR},
three_id = #{record.threeId,jdbcType=VARCHAR},
three_name = #{record.threeName,jdbcType=VARCHAR},
unmount_status = #{record.unmountStatus,jdbcType=BIT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause"/>
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
update sys_case_questions
<set>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="resourceData != null">
resource_data = #{resourceData,jdbcType=VARCHAR},
</if>
<if test="source != null">
source = #{source,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=VARCHAR},
</if>
<if test="oneId != null">
one_id = #{oneId,jdbcType=VARCHAR},
</if>
<if test="oneName != null">
one_name = #{oneName,jdbcType=VARCHAR},
</if>
<if test="twoId != null">
two_id = #{twoId,jdbcType=VARCHAR},
</if>
<if test="twoName != null">
two_name = #{twoName,jdbcType=VARCHAR},
</if>
<if test="threeId != null">
three_id = #{threeId,jdbcType=VARCHAR},
</if>
<if test="threeName != null">
three_name = #{threeName,jdbcType=VARCHAR},
</if>
<if test="unmountStatus != null">
unmount_status = #{unmountStatus,jdbcType=BIT},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="content != null">
content = #{content,jdbcType=LONGVARCHAR},
</if>
</set>
where case_id = #{caseId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
update sys_case_questions
set title = #{title,jdbcType=VARCHAR},
resource_data = #{resourceData,jdbcType=VARCHAR},
source = #{source,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
one_id = #{oneId,jdbcType=VARCHAR},
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},
content = #{content,jdbcType=LONGVARCHAR}
where case_id = #{caseId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
update sys_case_questions
set title = #{title,jdbcType=VARCHAR},
resource_data = #{resourceData,jdbcType=VARCHAR},
source = #{source,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
one_id = #{oneId,jdbcType=VARCHAR},
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 * from sys_case_questions s
<where>
<if test="oneId != null and oneId != ''">
s.one_id = #{oneId}
</if>
<if test="title != null and title != ''">
and s.title = #{title}
</if>
and s.unmount_status is false
</where>
order by s.create_time
</select>
<!--条件查询-->
<select id="selectCaseByConditions" parameterType="java.lang.String" resultMap="BaseResultMap">
select * from sys_case_questions s
<where>
<if test="oneId != null and oneId != ''">
s.one_id = #{oneId}
</if>
<if test="title != null and title != ''">
and s.title = #{title}
</if>
and s.unmount_status is false
</where>
</select>
<!--条件查询加绑定关系,有重复数据-->
<select id="selectCaseByConditionsByBind" parameterType="java.lang.String" resultMap="BaseResultMap">
select st.*,s.title,s.content,s.resource_data,s.source,s.type,s.unmount_status,s.create_time
from sys_case_questions s
join sys_topic_and_course st
on s.case_id = st.topic_id
<where>
<if test="title != null and title != ''">
and s.title = #{title}
</if>
and s.unmount_status is false
</where>
order by s.create_time
</select>
</mapper>

@ -403,15 +403,15 @@
left JOIN sys_topic_and_course st
on sb.objective_id = st.topic_id
<where>
<!-- <if test="oneID != null and oneID != ''">-->
<!-- st.one_id = #{oneID}-->
<!-- </if>-->
<!-- <if test="twoID != null and twoID != ''">-->
<!-- and st.two_id = #{twoID}-->
<!-- </if>-->
<!-- <if test="threeID != null and threeID != '' ">-->
<!-- and st.three_id = #{threeID}-->
<!-- </if>-->
<if test="oneID != null and oneID != ''">
st.one_id = #{oneID}
</if>
<if test="twoID != null and twoID != ''">
and st.two_id = #{twoID}
</if>
<if test="threeID != null and threeID != '' ">
and st.three_id = #{threeID}
</if>
<if test="type != null and type != '' ">
and sb.type = #{type}
</if>

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

Loading…
Cancel
Save