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