优化代码新增xml
parent
3e34331f8b
commit
9999ae5511
@ -1,462 +1,495 @@
|
||||
<?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.financial_bigdata.mapper.SysObjectiveQuestionMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion">
|
||||
<id column="objective_id" jdbcType="VARCHAR" property="objectiveId" />
|
||||
<result column="course_id" jdbcType="VARCHAR" property="courseId" />
|
||||
<result column="course_name" jdbcType="VARCHAR" property="courseName" />
|
||||
<result column="chapter_id" jdbcType="VARCHAR" property="chapterId" />
|
||||
<result column="chapter_name" jdbcType="VARCHAR" property="chapterName" />
|
||||
<result column="input_type" jdbcType="VARCHAR" property="inputType" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="score" jdbcType="DECIMAL" property="score" />
|
||||
<result column="content" jdbcType="VARCHAR" property="content" />
|
||||
<result column="question_a" jdbcType="VARCHAR" property="questionA" />
|
||||
<result column="question_b" jdbcType="VARCHAR" property="questionB" />
|
||||
<result column="question_c" jdbcType="VARCHAR" property="questionC" />
|
||||
<result column="question_d" jdbcType="VARCHAR" property="questionD" />
|
||||
<result column="question_e" jdbcType="VARCHAR" property="questionE" />
|
||||
<result column="answer" jdbcType="VARCHAR" property="answer" />
|
||||
<result column="analysis" jdbcType="VARCHAR" property="analysis" />
|
||||
<result column="school_id" jdbcType="VARCHAR" property="schoolId" />
|
||||
</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.financial_bigdata.entity.SysObjectiveQuestion">
|
||||
<id column="objective_id" jdbcType="VARCHAR" property="objectiveId"/>
|
||||
<result column="course_id" jdbcType="VARCHAR" property="courseId"/>
|
||||
<result column="course_name" jdbcType="VARCHAR" property="courseName"/>
|
||||
<result column="chapter_id" jdbcType="VARCHAR" property="chapterId"/>
|
||||
<result column="chapter_name" jdbcType="VARCHAR" property="chapterName"/>
|
||||
<result column="input_type" jdbcType="VARCHAR" property="inputType"/>
|
||||
<result column="type" jdbcType="VARCHAR" property="type"/>
|
||||
<result column="score" jdbcType="DECIMAL" property="score"/>
|
||||
<result column="content" jdbcType="VARCHAR" property="content"/>
|
||||
<result column="question_a" jdbcType="VARCHAR" property="questionA"/>
|
||||
<result column="question_b" jdbcType="VARCHAR" property="questionB"/>
|
||||
<result column="question_c" jdbcType="VARCHAR" property="questionC"/>
|
||||
<result column="question_d" jdbcType="VARCHAR" property="questionD"/>
|
||||
<result column="question_e" jdbcType="VARCHAR" property="questionE"/>
|
||||
<result column="answer" jdbcType="VARCHAR" property="answer"/>
|
||||
<result column="analysis" jdbcType="VARCHAR" property="analysis"/>
|
||||
<result column="school_id" jdbcType="VARCHAR" property="schoolId"/>
|
||||
</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">
|
||||
objective_id, course_id, course_name, chapter_id, chapter_name, input_type, type,
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
objective_id
|
||||
, course_id, course_name, chapter_id, chapter_name, input_type, type,
|
||||
score, content, question_a, question_b, question_c, question_d, question_e, answer,
|
||||
analysis, school_id
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from sys_objective_question
|
||||
<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="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from sys_objective_question
|
||||
where objective_id = #{objectiveId,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from sys_objective_question
|
||||
where objective_id = #{objectiveId,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionExample">
|
||||
delete from sys_objective_question
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion">
|
||||
insert into sys_objective_question (objective_id, course_id, course_name,
|
||||
chapter_id, chapter_name, input_type,
|
||||
type, score, content,
|
||||
question_a, question_b, question_c,
|
||||
question_d, question_e, answer,
|
||||
analysis, school_id)
|
||||
values (#{objectiveId,jdbcType=VARCHAR}, #{courseId,jdbcType=VARCHAR}, #{courseName,jdbcType=VARCHAR},
|
||||
#{chapterId,jdbcType=VARCHAR}, #{chapterName,jdbcType=VARCHAR}, #{inputType,jdbcType=VARCHAR},
|
||||
#{type,jdbcType=VARCHAR}, #{score,jdbcType=DECIMAL}, #{content,jdbcType=VARCHAR},
|
||||
#{questionA,jdbcType=VARCHAR}, #{questionB,jdbcType=VARCHAR}, #{questionC,jdbcType=VARCHAR},
|
||||
#{questionD,jdbcType=VARCHAR}, #{questionE,jdbcType=VARCHAR}, #{answer,jdbcType=VARCHAR},
|
||||
#{analysis,jdbcType=VARCHAR}, #{schoolId,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion">
|
||||
insert into sys_objective_question
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="objectiveId != null">
|
||||
objective_id,
|
||||
</if>
|
||||
<if test="courseId != null">
|
||||
course_id,
|
||||
</if>
|
||||
<if test="courseName != null">
|
||||
course_name,
|
||||
</if>
|
||||
<if test="chapterId != null">
|
||||
chapter_id,
|
||||
</if>
|
||||
<if test="chapterName != null">
|
||||
chapter_name,
|
||||
</if>
|
||||
<if test="inputType != null">
|
||||
input_type,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="score != null">
|
||||
score,
|
||||
</if>
|
||||
<if test="content != null">
|
||||
content,
|
||||
</if>
|
||||
<if test="questionA != null">
|
||||
question_a,
|
||||
</if>
|
||||
<if test="questionB != null">
|
||||
question_b,
|
||||
</if>
|
||||
<if test="questionC != null">
|
||||
question_c,
|
||||
</if>
|
||||
<if test="questionD != null">
|
||||
question_d,
|
||||
</if>
|
||||
<if test="questionE != null">
|
||||
question_e,
|
||||
</if>
|
||||
<if test="answer != null">
|
||||
answer,
|
||||
</if>
|
||||
<if test="analysis != null">
|
||||
analysis,
|
||||
</if>
|
||||
<if test="schoolId != null">
|
||||
school_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="objectiveId != null">
|
||||
#{objectiveId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="courseId != null">
|
||||
#{courseId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="courseName != null">
|
||||
#{courseName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="chapterId != null">
|
||||
#{chapterId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="chapterName != null">
|
||||
#{chapterName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="inputType != null">
|
||||
#{inputType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="score != null">
|
||||
#{score,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="content != null">
|
||||
#{content,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionA != null">
|
||||
#{questionA,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionB != null">
|
||||
#{questionB,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionC != null">
|
||||
#{questionC,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionD != null">
|
||||
#{questionD,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionE != null">
|
||||
#{questionE,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="answer != null">
|
||||
#{answer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="analysis != null">
|
||||
#{analysis,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="schoolId != null">
|
||||
#{schoolId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionExample" resultType="java.lang.Long">
|
||||
select count(*) from sys_objective_question
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update sys_objective_question
|
||||
<set>
|
||||
<if test="record.objectiveId != null">
|
||||
objective_id = #{record.objectiveId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.courseId != null">
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionExample"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
from sys_objective_question
|
||||
<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="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from sys_objective_question
|
||||
where objective_id = #{objectiveId,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete
|
||||
from sys_objective_question
|
||||
where objective_id = #{objectiveId,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionExample">
|
||||
delete from sys_objective_question
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion">
|
||||
insert into sys_objective_question (objective_id, course_id, course_name,
|
||||
chapter_id, chapter_name, input_type,
|
||||
type, score, content,
|
||||
question_a, question_b, question_c,
|
||||
question_d, question_e, answer,
|
||||
analysis, school_id)
|
||||
values (#{objectiveId,jdbcType=VARCHAR}, #{courseId,jdbcType=VARCHAR}, #{courseName,jdbcType=VARCHAR},
|
||||
#{chapterId,jdbcType=VARCHAR}, #{chapterName,jdbcType=VARCHAR}, #{inputType,jdbcType=VARCHAR},
|
||||
#{type,jdbcType=VARCHAR}, #{score,jdbcType=DECIMAL}, #{content,jdbcType=VARCHAR},
|
||||
#{questionA,jdbcType=VARCHAR}, #{questionB,jdbcType=VARCHAR}, #{questionC,jdbcType=VARCHAR},
|
||||
#{questionD,jdbcType=VARCHAR}, #{questionE,jdbcType=VARCHAR}, #{answer,jdbcType=VARCHAR},
|
||||
#{analysis,jdbcType=VARCHAR}, #{schoolId,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion">
|
||||
insert into sys_objective_question
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="objectiveId != null">
|
||||
objective_id,
|
||||
</if>
|
||||
<if test="courseId != null">
|
||||
course_id,
|
||||
</if>
|
||||
<if test="courseName != null">
|
||||
course_name,
|
||||
</if>
|
||||
<if test="chapterId != null">
|
||||
chapter_id,
|
||||
</if>
|
||||
<if test="chapterName != null">
|
||||
chapter_name,
|
||||
</if>
|
||||
<if test="inputType != null">
|
||||
input_type,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="score != null">
|
||||
score,
|
||||
</if>
|
||||
<if test="content != null">
|
||||
content,
|
||||
</if>
|
||||
<if test="questionA != null">
|
||||
question_a,
|
||||
</if>
|
||||
<if test="questionB != null">
|
||||
question_b,
|
||||
</if>
|
||||
<if test="questionC != null">
|
||||
question_c,
|
||||
</if>
|
||||
<if test="questionD != null">
|
||||
question_d,
|
||||
</if>
|
||||
<if test="questionE != null">
|
||||
question_e,
|
||||
</if>
|
||||
<if test="answer != null">
|
||||
answer,
|
||||
</if>
|
||||
<if test="analysis != null">
|
||||
analysis,
|
||||
</if>
|
||||
<if test="schoolId != null">
|
||||
school_id,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="objectiveId != null">
|
||||
#{objectiveId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="courseId != null">
|
||||
#{courseId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="courseName != null">
|
||||
#{courseName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="chapterId != null">
|
||||
#{chapterId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="chapterName != null">
|
||||
#{chapterName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="inputType != null">
|
||||
#{inputType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="score != null">
|
||||
#{score,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="content != null">
|
||||
#{content,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionA != null">
|
||||
#{questionA,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionB != null">
|
||||
#{questionB,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionC != null">
|
||||
#{questionC,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionD != null">
|
||||
#{questionD,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionE != null">
|
||||
#{questionE,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="answer != null">
|
||||
#{answer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="analysis != null">
|
||||
#{analysis,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="schoolId != null">
|
||||
#{schoolId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionExample"
|
||||
resultType="java.lang.Long">
|
||||
select count(*) from sys_objective_question
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update sys_objective_question
|
||||
<set>
|
||||
<if test="record.objectiveId != null">
|
||||
objective_id = #{record.objectiveId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.courseId != null">
|
||||
course_id = #{record.courseId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.courseName != null">
|
||||
course_name = #{record.courseName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.chapterId != null">
|
||||
chapter_id = #{record.chapterId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.chapterName != null">
|
||||
chapter_name = #{record.chapterName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.inputType != null">
|
||||
input_type = #{record.inputType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
type = #{record.type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.score != null">
|
||||
score = #{record.score,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.content != null">
|
||||
content = #{record.content,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.questionA != null">
|
||||
question_a = #{record.questionA,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.questionB != null">
|
||||
question_b = #{record.questionB,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.questionC != null">
|
||||
question_c = #{record.questionC,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.questionD != null">
|
||||
question_d = #{record.questionD,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.questionE != null">
|
||||
question_e = #{record.questionE,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.answer != null">
|
||||
answer = #{record.answer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.analysis != null">
|
||||
analysis = #{record.analysis,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.schoolId != null">
|
||||
school_id = #{record.schoolId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause"/>
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update sys_objective_question
|
||||
set objective_id = #{record.objectiveId,jdbcType=VARCHAR},
|
||||
course_id = #{record.courseId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.courseName != null">
|
||||
course_name = #{record.courseName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.chapterId != null">
|
||||
chapter_id = #{record.chapterId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.chapterName != null">
|
||||
chapter_name = #{record.chapterName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.inputType != null">
|
||||
input_type = #{record.inputType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
type = #{record.type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.score != null">
|
||||
score = #{record.score,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.content != null">
|
||||
content = #{record.content,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.questionA != null">
|
||||
question_a = #{record.questionA,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.questionB != null">
|
||||
question_b = #{record.questionB,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.questionC != null">
|
||||
question_c = #{record.questionC,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.questionD != null">
|
||||
question_d = #{record.questionD,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.questionE != null">
|
||||
question_e = #{record.questionE,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.answer != null">
|
||||
answer = #{record.answer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.analysis != null">
|
||||
analysis = #{record.analysis,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.schoolId != null">
|
||||
school_id = #{record.schoolId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update sys_objective_question
|
||||
set objective_id = #{record.objectiveId,jdbcType=VARCHAR},
|
||||
course_id = #{record.courseId,jdbcType=VARCHAR},
|
||||
course_name = #{record.courseName,jdbcType=VARCHAR},
|
||||
chapter_id = #{record.chapterId,jdbcType=VARCHAR},
|
||||
chapter_name = #{record.chapterName,jdbcType=VARCHAR},
|
||||
input_type = #{record.inputType,jdbcType=VARCHAR},
|
||||
type = #{record.type,jdbcType=VARCHAR},
|
||||
score = #{record.score,jdbcType=DECIMAL},
|
||||
content = #{record.content,jdbcType=VARCHAR},
|
||||
question_a = #{record.questionA,jdbcType=VARCHAR},
|
||||
question_b = #{record.questionB,jdbcType=VARCHAR},
|
||||
question_c = #{record.questionC,jdbcType=VARCHAR},
|
||||
question_d = #{record.questionD,jdbcType=VARCHAR},
|
||||
question_e = #{record.questionE,jdbcType=VARCHAR},
|
||||
answer = #{record.answer,jdbcType=VARCHAR},
|
||||
analysis = #{record.analysis,jdbcType=VARCHAR},
|
||||
school_id = #{record.schoolId,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion">
|
||||
update sys_objective_question
|
||||
<set>
|
||||
<if test="courseId != null">
|
||||
course_id = #{courseId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="courseName != null">
|
||||
course_name = #{courseName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="chapterId != null">
|
||||
chapter_id = #{chapterId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="chapterName != null">
|
||||
chapter_name = #{chapterName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="inputType != null">
|
||||
input_type = #{inputType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="score != null">
|
||||
score = #{score,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="content != null">
|
||||
content = #{content,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionA != null">
|
||||
question_a = #{questionA,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionB != null">
|
||||
question_b = #{questionB,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionC != null">
|
||||
question_c = #{questionC,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionD != null">
|
||||
question_d = #{questionD,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionE != null">
|
||||
question_e = #{questionE,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="answer != null">
|
||||
answer = #{answer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="analysis != null">
|
||||
analysis = #{analysis,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="schoolId != null">
|
||||
school_id = #{schoolId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where objective_id = #{objectiveId,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion">
|
||||
update sys_objective_question
|
||||
set course_id = #{courseId,jdbcType=VARCHAR},
|
||||
course_name = #{courseName,jdbcType=VARCHAR},
|
||||
chapter_id = #{chapterId,jdbcType=VARCHAR},
|
||||
chapter_name = #{chapterName,jdbcType=VARCHAR},
|
||||
input_type = #{inputType,jdbcType=VARCHAR},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
score = #{score,jdbcType=DECIMAL},
|
||||
content = #{content,jdbcType=VARCHAR},
|
||||
question_a = #{questionA,jdbcType=VARCHAR},
|
||||
question_b = #{questionB,jdbcType=VARCHAR},
|
||||
question_c = #{questionC,jdbcType=VARCHAR},
|
||||
question_d = #{questionD,jdbcType=VARCHAR},
|
||||
question_e = #{questionE,jdbcType=VARCHAR},
|
||||
answer = #{answer,jdbcType=VARCHAR},
|
||||
analysis = #{analysis,jdbcType=VARCHAR},
|
||||
school_id = #{schoolId,jdbcType=VARCHAR}
|
||||
where objective_id = #{objectiveId,jdbcType=VARCHAR}
|
||||
</update>
|
||||
school_id = #{record.schoolId,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause"/>
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion">
|
||||
update sys_objective_question
|
||||
<set>
|
||||
<if test="courseId != null">
|
||||
course_id = #{courseId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="courseName != null">
|
||||
course_name = #{courseName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="chapterId != null">
|
||||
chapter_id = #{chapterId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="chapterName != null">
|
||||
chapter_name = #{chapterName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="inputType != null">
|
||||
input_type = #{inputType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="score != null">
|
||||
score = #{score,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="content != null">
|
||||
content = #{content,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionA != null">
|
||||
question_a = #{questionA,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionB != null">
|
||||
question_b = #{questionB,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionC != null">
|
||||
question_c = #{questionC,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionD != null">
|
||||
question_d = #{questionD,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="questionE != null">
|
||||
question_e = #{questionE,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="answer != null">
|
||||
answer = #{answer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="analysis != null">
|
||||
analysis = #{analysis,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="schoolId != null">
|
||||
school_id = #{schoolId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where objective_id = #{objectiveId,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion">
|
||||
update sys_objective_question
|
||||
set course_id = #{courseId,jdbcType=VARCHAR},
|
||||
course_name = #{courseName,jdbcType=VARCHAR},
|
||||
chapter_id = #{chapterId,jdbcType=VARCHAR},
|
||||
chapter_name = #{chapterName,jdbcType=VARCHAR},
|
||||
input_type = #{inputType,jdbcType=VARCHAR},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
score = #{score,jdbcType=DECIMAL},
|
||||
content = #{content,jdbcType=VARCHAR},
|
||||
question_a = #{questionA,jdbcType=VARCHAR},
|
||||
question_b = #{questionB,jdbcType=VARCHAR},
|
||||
question_c = #{questionC,jdbcType=VARCHAR},
|
||||
question_d = #{questionD,jdbcType=VARCHAR},
|
||||
question_e = #{questionE,jdbcType=VARCHAR},
|
||||
answer = #{answer,jdbcType=VARCHAR},
|
||||
analysis = #{analysis,jdbcType=VARCHAR},
|
||||
school_id = #{schoolId,jdbcType=VARCHAR}
|
||||
where objective_id = #{objectiveId,jdbcType=VARCHAR}
|
||||
</update>
|
||||
|
||||
<select id="selectRandomObjective" parameterType="map" resultMap="BaseResultMap">
|
||||
SELECT objective_id,
|
||||
course_id,
|
||||
course_name,
|
||||
chapter_id,
|
||||
chapter_name,
|
||||
input_type,
|
||||
type,
|
||||
score,
|
||||
content,
|
||||
question_a,
|
||||
question_b,
|
||||
question_c,
|
||||
question_d,
|
||||
question_e,
|
||||
answer,
|
||||
school_id
|
||||
FROM sys_objective_question
|
||||
WHERE chapter_id = #{chapterId,jdbcType=VARCHAR}
|
||||
ORDER BY RAND() LIMIT 10
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectRandomObjectiveSingle" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM
|
||||
sys_objective_question
|
||||
WHERE
|
||||
type = 0 AND input_type = 1
|
||||
ORDER BY
|
||||
RAND()
|
||||
LIMIT
|
||||
35
|
||||
</select>
|
||||
|
||||
<select id="selectRandomObjective" parameterType="map" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
objective_id, course_id, course_name, chapter_id, chapter_name, input_type, type,
|
||||
score, content, question_a, question_b, question_c, question_d, question_e, answer, school_id
|
||||
FROM sys_objective_question
|
||||
WHERE chapter_id = #{chapterId,jdbcType=VARCHAR}
|
||||
ORDER BY RAND()
|
||||
LIMIT 10
|
||||
</select>
|
||||
<select id="selectRandomObjectiveMany" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM
|
||||
sys_objective_question
|
||||
WHERE
|
||||
type = 1 AND input_type = 1
|
||||
ORDER BY
|
||||
RAND()
|
||||
LIMIT
|
||||
5
|
||||
</select>
|
||||
|
||||
<select id="selectRandomObjectiveJudge" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM
|
||||
sys_objective_question
|
||||
WHERE
|
||||
type = 2 AND input_type = 1
|
||||
ORDER BY
|
||||
RAND()
|
||||
LIMIT
|
||||
10
|
||||
</select>
|
||||
|
||||
<select id="selectRandomObjectiveSingle" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM
|
||||
sys_objective_question
|
||||
WHERE
|
||||
type = 0 AND input_type = 1
|
||||
ORDER BY
|
||||
RAND()
|
||||
LIMIT
|
||||
35
|
||||
</select>
|
||||
|
||||
<select id="selectRandomObjectiveMany" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM
|
||||
sys_objective_question
|
||||
WHERE
|
||||
type = 1 AND input_type = 1
|
||||
ORDER BY
|
||||
RAND()
|
||||
LIMIT
|
||||
5
|
||||
</select>
|
||||
<select id="getGradeReportObjective" parameterType="java.util.List" resultMap="BaseResultMap">
|
||||
SELECT content, chapter_name,answer,`type`
|
||||
from sys_objective_question
|
||||
WHERE objective_id IN
|
||||
<foreach collection="list" separator="," item="id" open="(" close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectRandomObjectiveJudge" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List" />
|
||||
FROM
|
||||
sys_objective_question
|
||||
WHERE
|
||||
type = 2 AND input_type = 1
|
||||
ORDER BY
|
||||
RAND()
|
||||
LIMIT
|
||||
10
|
||||
</select>
|
||||
|
||||
<select id="selectByList" parameterType="java.util.List" resultType="java.util.Map">
|
||||
SELECT count(*),sum(score)FROM sys_objective_question
|
||||
WHERE objective_id IN
|
||||
<foreach collection="list" separator="," item="id" open="(" close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getGradeReportObjective" parameterType="java.util.List" resultMap="BaseResultMap">
|
||||
SELECT content, chapter_name,answer,`type`
|
||||
from sys_objective_question
|
||||
WHERE objective_id IN
|
||||
<foreach collection="list" separator="," item="id" open="(" close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="selectObjectivityByType" parameterType="java.lang.String" resultMap="BaseResultMap">
|
||||
SELECT objective_id,content,chapter_name,course_name FROM sys_objective_question
|
||||
WHERE school_id IN(#{schoolId},'999999999')
|
||||
AND type = #{type}
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue