新增题库管理页面接口,题库表新增逻辑删除字段

master
xiaoCJ 9 months ago
parent a923682de9
commit f9fd31c7cf

@ -1,8 +1,11 @@
package com.sztzjy.resource_center.controller; 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.PageInfo;
import com.sztzjy.resource_center.annotation.AnonymousAccess; import com.sztzjy.resource_center.annotation.AnonymousAccess;
import com.sztzjy.resource_center.entity.SysCaseQuestion; import com.sztzjy.resource_center.entity.SysCaseQuestion;
import com.sztzjy.resource_center.entity.SysCaseQuestionExample;
import com.sztzjy.resource_center.entity.SysTopicAndCourse; import com.sztzjy.resource_center.entity.SysTopicAndCourse;
import com.sztzjy.resource_center.mapper.SysCaseQuestionMapper; import com.sztzjy.resource_center.mapper.SysCaseQuestionMapper;
import com.sztzjy.resource_center.mapper.SysCaseQuestionStepMapper; import com.sztzjy.resource_center.mapper.SysCaseQuestionStepMapper;
@ -14,12 +17,10 @@ import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @Author xcj * @Author xcj
@ -43,33 +44,78 @@ public class CaseController {
@PostMapping("insertCase") @PostMapping("insertCase")
public ResultEntity<HttpStatus> insertCase(@ApiParam("目前二级三级ID可以为空来源和题型要传,上架状态传true") @RequestBody SysCaseQuestion sysCaseQuestion) { public ResultEntity<HttpStatus> insertCase(@ApiParam("目前二级三级ID可以为空来源和题型要传,上架状态传true") @RequestBody SysCaseQuestion sysCaseQuestion) {
if (!("1").equals(sysCaseQuestion.getType())) { if (!("1").equals(sysCaseQuestion.getType())) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST,"题型错误!"); return new ResultEntity<>(HttpStatus.BAD_REQUEST, "题型错误!");
} }
if (StringUtils.isBlank(sysCaseQuestion.getOneId())) { //todo 目前二级三级ID可以为空 if (StringUtils.isBlank(sysCaseQuestion.getOneId())) { //todo 目前二级三级ID可以为空
return new ResultEntity<>(HttpStatus.BAD_REQUEST,"课程不能为空!"); return new ResultEntity<>(HttpStatus.BAD_REQUEST, "课程不能为空!");
} }
if (StringUtils.isBlank(sysCaseQuestion.getContent())||StringUtils.isBlank(sysCaseQuestion.getTitle())) { if (StringUtils.isBlank(sysCaseQuestion.getContent()) || StringUtils.isBlank(sysCaseQuestion.getTitle())) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST,"题目内容不能为空!"); return new ResultEntity<>(HttpStatus.BAD_REQUEST, "题目内容不能为空!");
} }
if (StringUtils.isBlank(sysCaseQuestion.getSource())) { if (StringUtils.isBlank(sysCaseQuestion.getSource())) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST,"题目来源不能为空!"); 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(); String uuid = IdUtil.randomUUID();
sysCaseQuestion.setCaseId(uuid); sysCaseQuestion.setCaseId(uuid);
sysCaseQuestion.setCreateTime(new Date()); sysCaseQuestion.setCreateTime(new Date());
caseQuestionMapper.insert(sysCaseQuestion); caseQuestionMapper.insert(sysCaseQuestion);
//新增绑定关系 //新增绑定关系
SysTopicAndCourse sysTopicAndCourse =new SysTopicAndCourse(); SysTopicAndCourse sysTopicAndCourse = new SysTopicAndCourse();
sysTopicAndCourse.setTopicType("1"); sysTopicAndCourse.setTopicType("1");
sysTopicAndCourse.setTopicId(uuid); sysTopicAndCourse.setTopicId(uuid);
sysTopicAndCourse.setOneId(sysCaseQuestion.getOneId()); sysTopicAndCourse.setOneId(sysCaseQuestion.getOneId());
if (StringUtils.isNotBlank(sysCaseQuestion.getTwoId())){ if (StringUtils.isNotBlank(sysCaseQuestion.getTwoId())) {
sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId()); sysTopicAndCourse.setTwoId(sysCaseQuestion.getTwoId());
} }
if (StringUtils.isNotBlank(sysCaseQuestion.getThree())){ if (StringUtils.isNotBlank(sysCaseQuestion.getThree())) {
sysTopicAndCourse.setThreeId(sysCaseQuestion.getThree()); sysTopicAndCourse.setThreeId(sysCaseQuestion.getThree());
} }
topicAndCourseMapper.insert(sysTopicAndCourse); topicAndCourseMapper.insert(sysTopicAndCourse);
return new ResultEntity<>(HttpStatus.OK,"新增成功!"); return new ResultEntity<>(HttpStatus.OK, "新增成功!");
}
@AnonymousAccess
@ApiOperation("案例题查询")
@PostMapping("selectCaseByConditions")
public ResultEntity<PageInfo<SysCaseQuestion>> selectCaseByConditions(@RequestParam Integer index,
@RequestParam Integer size,
@RequestParam String title,
@RequestParam 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);
}
//案例库自动同步课程配置新增的和老师新增的案例,老师新增的案例正在使用时只能查看,如果老师删除了这个案例,这个案例可以编辑删除。
@AnonymousAccess
@ApiOperation("案例题编辑")
@PostMapping("updateCase")
public ResultEntity<HttpStatus> updateCase() {
return null;
}
//删除案例时如果案例正在被使用则不能删除提示该案例正在被xx课程xx章节使用不能删除。
@AnonymousAccess
@ApiOperation("案例题删除")
@PostMapping("deleteCase")
public ResultEntity<HttpStatus> deleteCase() {
return null;
}
@AnonymousAccess
@ApiOperation("案例题添加步骤")
@PostMapping("insertCaseStepByCaseId")
public ResultEntity<HttpStatus> insertCaseStepByCaseId() {
return null;
} }
} }

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

@ -40,11 +40,11 @@
<property name="enableSubPackages" value="true"/> <property name="enableSubPackages" value="true"/>
</javaClientGenerator> </javaClientGenerator>
<!-- 需要生成的表 --> <!-- 需要生成的表 -->
<!-- <table tableName="sys_case_question" domainObjectName="SysCaseQuestion" />--> <table tableName="sys_case_questions" domainObjectName="SysCaseQuestion" />
<!-- <table tableName="sys_case_question_step" domainObjectName="SysCaseQuestionStep" />--> <table tableName="sys_case_question_steps" domainObjectName="SysCaseQuestionStep" />
<!-- <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" />-->

@ -1,377 +1,396 @@
<?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="two_id" jdbcType="VARCHAR" property="twoId" /> <result column="two_id" jdbcType="VARCHAR" property="twoId"/>
<result column="three" jdbcType="VARCHAR" property="three" /> <result column="three" jdbcType="VARCHAR" property="three"/>
<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, two_id, three, unmount_status,
<sql id="Base_Column_List">
case_id, title, resource_data, source, type, one_id, two_id, three, unmount_status,
create_time, update_time 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>
two_id, three, unmount_status, <insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
create_time, update_time, content insert into sys_case_questions (case_id, title, resource_data,
) source, type, one_id,
values (#{caseId,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{resourceData,jdbcType=VARCHAR}, two_id, three, unmount_status,
#{source,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{oneId,jdbcType=VARCHAR}, create_time, update_time, content)
#{twoId,jdbcType=VARCHAR}, #{three,jdbcType=VARCHAR}, #{unmountStatus,jdbcType=BIT}, values (#{caseId,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{resourceData,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARCHAR} #{source,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{oneId,jdbcType=VARCHAR},
) #{twoId,jdbcType=VARCHAR}, #{three,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="twoId != null"> </if>
two_id, <if test="twoId != null">
</if> two_id,
<if test="three != null"> </if>
three, <if test="three != null">
</if> three,
<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="twoId != null"> </if>
#{twoId,jdbcType=VARCHAR}, <if test="twoId != null">
</if> #{twoId,jdbcType=VARCHAR},
<if test="three != null"> </if>
#{three,jdbcType=VARCHAR}, <if test="three != null">
</if> #{three,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.twoId != null">
two_id = #{record.twoId,jdbcType=VARCHAR},
</if>
<if test="record.three != null">
three = #{record.three,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.twoId != null">
two_id = #{record.twoId,jdbcType=VARCHAR}, two_id = #{record.twoId,jdbcType=VARCHAR},
</if>
<if test="record.three != null">
three = #{record.three,jdbcType=VARCHAR}, three = #{record.three,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}, two_id = #{record.twoId,jdbcType=VARCHAR},
source = #{record.source,jdbcType=VARCHAR}, three = #{record.three,jdbcType=VARCHAR},
type = #{record.type,jdbcType=VARCHAR}, unmount_status = #{record.unmountStatus,jdbcType=BIT},
one_id = #{record.oneId,jdbcType=VARCHAR}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
two_id = #{record.twoId,jdbcType=VARCHAR}, update_time = #{record.updateTime,jdbcType=TIMESTAMP}
three = #{record.three,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">
two_id = #{record.twoId,jdbcType=VARCHAR}, type = #{type,jdbcType=VARCHAR},
three = #{record.three,jdbcType=VARCHAR}, </if>
unmount_status = #{record.unmountStatus,jdbcType=BIT}, <if test="oneId != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP}, one_id = #{oneId,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="three != null">
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion"> three = #{three,jdbcType=VARCHAR},
update sys_case_questions </if>
<set> <if test="unmountStatus != null">
<if test="title != null"> unmount_status = #{unmountStatus,jdbcType=BIT},
title = #{title,jdbcType=VARCHAR}, </if>
</if> <if test="createTime != null">
<if test="resourceData != null"> create_time = #{createTime,jdbcType=TIMESTAMP},
resource_data = #{resourceData,jdbcType=VARCHAR}, </if>
</if> <if test="updateTime != null">
<if test="source != null"> update_time = #{updateTime,jdbcType=TIMESTAMP},
source = #{source,jdbcType=VARCHAR}, </if>
</if> <if test="content != null">
<if test="type != null"> content = #{content,jdbcType=LONGVARCHAR},
type = #{type,jdbcType=VARCHAR}, </if>
</if> </set>
<if test="oneId != null"> where case_id = #{caseId,jdbcType=VARCHAR}
one_id = #{oneId,jdbcType=VARCHAR}, </update>
</if> <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
<if test="twoId != null"> update sys_case_questions
two_id = #{twoId,jdbcType=VARCHAR}, set title = #{title,jdbcType=VARCHAR},
</if> resource_data = #{resourceData,jdbcType=VARCHAR},
<if test="three != null"> source = #{source,jdbcType=VARCHAR},
three = #{three,jdbcType=VARCHAR}, type = #{type,jdbcType=VARCHAR},
</if> one_id = #{oneId,jdbcType=VARCHAR},
<if test="unmountStatus != null"> two_id = #{twoId,jdbcType=VARCHAR},
unmount_status = #{unmountStatus,jdbcType=BIT}, three = #{three,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"> two_id = #{twoId,jdbcType=VARCHAR},
update sys_case_questions three = #{three,jdbcType=VARCHAR},
set title = #{title,jdbcType=VARCHAR}, unmount_status = #{unmountStatus,jdbcType=BIT},
resource_data = #{resourceData,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=TIMESTAMP},
source = #{source,jdbcType=VARCHAR}, update_time = #{updateTime,jdbcType=TIMESTAMP}
type = #{type,jdbcType=VARCHAR}, where case_id = #{caseId,jdbcType=VARCHAR}
one_id = #{oneId,jdbcType=VARCHAR}, </update>
two_id = #{twoId,jdbcType=VARCHAR},
three = #{three,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_question 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}, </where>
source = #{source,jdbcType=VARCHAR}, </select>
type = #{type,jdbcType=VARCHAR},
one_id = #{oneId,jdbcType=VARCHAR},
two_id = #{twoId,jdbcType=VARCHAR},
three = #{three,jdbcType=VARCHAR},
unmount_status = #{unmountStatus,jdbcType=BIT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where case_id = #{caseId,jdbcType=VARCHAR}
</update>
</mapper> </mapper>
Loading…
Cancel
Save