tz_digital_bank/src/main/resources/mappers/StuProblemInfoMapper.xml

304 lines
11 KiB
XML

<?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.trade.mapper.StuProblemInfoMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.trade.entity.StuProblemInfo">
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="keywords" jdbcType="VARCHAR" property="keywords" />
<result column="question_time" jdbcType="TIMESTAMP" property="questionTime" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="answer_status" jdbcType="INTEGER" property="answerStatus" />
<result column="shcool_id" jdbcType="VARCHAR" property="shcoolId" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.trade.entity.StuProblemInfo">
<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>
</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>
</where>
</sql>
<sql id="Base_Column_List">
id, name, keywords, question_time, user_id, answer_status, shcool_id
</sql>
<sql id="Blob_Column_List">
content
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.trade.entity.StuProblemInfoExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from stu_problem_info
<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.trade.entity.StuProblemInfoExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from stu_problem_info
<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 stu_problem_info
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from stu_problem_info
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.trade.entity.StuProblemInfoExample">
delete from stu_problem_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.trade.entity.StuProblemInfo">
insert into stu_problem_info (id, name, keywords,
question_time, user_id, answer_status,
shcool_id, content)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{keywords,jdbcType=VARCHAR},
#{questionTime,jdbcType=TIMESTAMP}, #{userId,jdbcType=VARCHAR}, #{answerStatus,jdbcType=INTEGER},
#{shcoolId,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.trade.entity.StuProblemInfo">
insert into stu_problem_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="keywords != null">
keywords,
</if>
<if test="questionTime != null">
question_time,
</if>
<if test="userId != null">
user_id,
</if>
<if test="answerStatus != null">
answer_status,
</if>
<if test="shcoolId != null">
shcool_id,
</if>
<if test="content != null">
content,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="keywords != null">
#{keywords,jdbcType=VARCHAR},
</if>
<if test="questionTime != null">
#{questionTime,jdbcType=TIMESTAMP},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="answerStatus != null">
#{answerStatus,jdbcType=INTEGER},
</if>
<if test="shcoolId != null">
#{shcoolId,jdbcType=VARCHAR},
</if>
<if test="content != null">
#{content,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.sztzjy.trade.entity.StuProblemInfoExample" resultType="java.lang.Long">
select count(*) from stu_problem_info
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update stu_problem_info
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.keywords != null">
keywords = #{record.keywords,jdbcType=VARCHAR},
</if>
<if test="record.questionTime != null">
question_time = #{record.questionTime,jdbcType=TIMESTAMP},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=VARCHAR},
</if>
<if test="record.answerStatus != null">
answer_status = #{record.answerStatus,jdbcType=INTEGER},
</if>
<if test="record.shcoolId != null">
shcool_id = #{record.shcoolId,jdbcType=VARCHAR},
</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 stu_problem_info
set id = #{record.id,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
keywords = #{record.keywords,jdbcType=VARCHAR},
question_time = #{record.questionTime,jdbcType=TIMESTAMP},
user_id = #{record.userId,jdbcType=VARCHAR},
answer_status = #{record.answerStatus,jdbcType=INTEGER},
shcool_id = #{record.shcoolId,jdbcType=VARCHAR},
content = #{record.content,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update stu_problem_info
set id = #{record.id,jdbcType=VARCHAR},
name = #{record.name,jdbcType=VARCHAR},
keywords = #{record.keywords,jdbcType=VARCHAR},
question_time = #{record.questionTime,jdbcType=TIMESTAMP},
user_id = #{record.userId,jdbcType=VARCHAR},
answer_status = #{record.answerStatus,jdbcType=INTEGER},
shcool_id = #{record.shcoolId,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.trade.entity.StuProblemInfo">
update stu_problem_info
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="keywords != null">
keywords = #{keywords,jdbcType=VARCHAR},
</if>
<if test="questionTime != null">
question_time = #{questionTime,jdbcType=TIMESTAMP},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="answerStatus != null">
answer_status = #{answerStatus,jdbcType=INTEGER},
</if>
<if test="shcoolId != null">
shcool_id = #{shcoolId,jdbcType=VARCHAR},
</if>
<if test="content != null">
content = #{content,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.sztzjy.trade.entity.StuProblemInfo">
update stu_problem_info
set name = #{name,jdbcType=VARCHAR},
keywords = #{keywords,jdbcType=VARCHAR},
question_time = #{questionTime,jdbcType=TIMESTAMP},
user_id = #{userId,jdbcType=VARCHAR},
answer_status = #{answerStatus,jdbcType=INTEGER},
shcool_id = #{shcoolId,jdbcType=VARCHAR},
content = #{content,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.trade.entity.StuProblemInfo">
update stu_problem_info
set name = #{name,jdbcType=VARCHAR},
keywords = #{keywords,jdbcType=VARCHAR},
question_time = #{questionTime,jdbcType=TIMESTAMP},
user_id = #{userId,jdbcType=VARCHAR},
answer_status = #{answerStatus,jdbcType=INTEGER},
shcool_id = #{shcoolId,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>