|
|
|
@ -2,23 +2,23 @@
|
|
|
|
|
<!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" />
|
|
|
|
|
<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" />
|
|
|
|
|
<result column="content" jdbcType="LONGVARCHAR" property="content"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
<sql id="Example_Where_Clause">
|
|
|
|
|
<where>
|
|
|
|
@ -38,7 +38,8 @@
|
|
|
|
|
</when>
|
|
|
|
|
<when test="criterion.listValue">
|
|
|
|
|
and ${criterion.condition}
|
|
|
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="("
|
|
|
|
|
separator=",">
|
|
|
|
|
#{listItem}
|
|
|
|
|
</foreach>
|
|
|
|
|
</when>
|
|
|
|
@ -67,7 +68,8 @@
|
|
|
|
|
</when>
|
|
|
|
|
<when test="criterion.listValue">
|
|
|
|
|
and ${criterion.condition}
|
|
|
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
|
|
|
|
<foreach close=")" collection="criterion.value" item="listItem" open="("
|
|
|
|
|
separator=",">
|
|
|
|
|
#{listItem}
|
|
|
|
|
</foreach>
|
|
|
|
|
</when>
|
|
|
|
@ -79,37 +81,40 @@
|
|
|
|
|
</where>
|
|
|
|
|
</sql>
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
|
case_id, title, resource_data, source, type, one_id, one_name, two_id, two_name,
|
|
|
|
|
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 id="selectByExampleWithBLOBs" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample"
|
|
|
|
|
resultMap="ResultMapWithBLOBs">
|
|
|
|
|
select
|
|
|
|
|
<if test="distinct">
|
|
|
|
|
distinct
|
|
|
|
|
</if>
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
,
|
|
|
|
|
<include refid="Blob_Column_List" />
|
|
|
|
|
<include refid="Blob_Column_List"/>
|
|
|
|
|
from sys_case_questions
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
|
<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 id="selectByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample"
|
|
|
|
|
resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
<if test="distinct">
|
|
|
|
|
distinct
|
|
|
|
|
</if>
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
from sys_case_questions
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
|
<include refid="Example_Where_Clause"/>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderByClause != null">
|
|
|
|
|
order by ${orderByClause}
|
|
|
|
@ -117,20 +122,21 @@
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
,
|
|
|
|
|
<include refid="Blob_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
|
|
|
|
|
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" />
|
|
|
|
|
<include refid="Example_Where_Clause"/>
|
|
|
|
|
</if>
|
|
|
|
|
</delete>
|
|
|
|
|
<insert id="insert" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
|
|
|
|
@ -138,14 +144,12 @@
|
|
|
|
|
source, type, one_id,
|
|
|
|
|
one_name, two_id, two_name,
|
|
|
|
|
three_id, three_name, unmount_status,
|
|
|
|
|
create_time, update_time, content
|
|
|
|
|
)
|
|
|
|
|
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}
|
|
|
|
|
)
|
|
|
|
|
#{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
|
|
|
|
@ -244,10 +248,11 @@
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
<select id="countByExample" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestionExample" resultType="java.lang.Long">
|
|
|
|
|
<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" />
|
|
|
|
|
<include refid="Example_Where_Clause"/>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
<update id="updateByExampleSelective" parameterType="map">
|
|
|
|
@ -300,7 +305,7 @@
|
|
|
|
|
</if>
|
|
|
|
|
</set>
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
|
|
<include refid="Update_By_Example_Where_Clause"/>
|
|
|
|
|
</if>
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateByExampleWithBLOBs" parameterType="map">
|
|
|
|
@ -321,7 +326,7 @@
|
|
|
|
|
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
|
|
|
|
content = #{record.content,jdbcType=LONGVARCHAR}
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
|
|
<include refid="Update_By_Example_Where_Clause"/>
|
|
|
|
|
</if>
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateByExample" parameterType="map">
|
|
|
|
@ -341,7 +346,7 @@
|
|
|
|
|
create_time = #{record.createTime,jdbcType=TIMESTAMP},
|
|
|
|
|
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Update_By_Example_Where_Clause" />
|
|
|
|
|
<include refid="Update_By_Example_Where_Clause"/>
|
|
|
|
|
</if>
|
|
|
|
|
</update>
|
|
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.resource_center.entity.SysCaseQuestion">
|
|
|
|
@ -428,7 +433,7 @@
|
|
|
|
|
where case_id = #{caseId,jdbcType=VARCHAR}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<!--条件查询-->
|
|
|
|
|
<!--条件查询 无重复数据-->
|
|
|
|
|
<select id="selectCaseByConditions" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
|
|
select * from sys_case_questions s
|
|
|
|
|
<where>
|
|
|
|
@ -440,5 +445,22 @@
|
|
|
|
|
</if>
|
|
|
|
|
and s.unmount_status is false
|
|
|
|
|
</where>
|
|
|
|
|
order by s.create_time
|
|
|
|
|
</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>
|