|
|
|
@ -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.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" />
|
|
|
|
|
<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>
|
|
|
|
@ -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,19 +81,21 @@
|
|
|
|
|
</where>
|
|
|
|
|
</sql>
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
|
objective_id, course_id, course_name, chapter_id, chapter_name, input_type, type,
|
|
|
|
|
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 id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionExample"
|
|
|
|
|
resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
<if test="distinct">
|
|
|
|
|
distinct
|
|
|
|
|
</if>
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
from sys_objective_question
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
|
<include refid="Example_Where_Clause"/>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderByClause != null">
|
|
|
|
|
order by ${orderByClause}
|
|
|
|
@ -99,18 +103,19 @@
|
|
|
|
|
</select>
|
|
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
<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
|
|
|
|
|
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" />
|
|
|
|
|
<include refid="Example_Where_Clause"/>
|
|
|
|
|
</if>
|
|
|
|
|
</delete>
|
|
|
|
|
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestion">
|
|
|
|
@ -236,10 +241,11 @@
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.SysObjectiveQuestionExample" resultType="java.lang.Long">
|
|
|
|
|
<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" />
|
|
|
|
|
<include refid="Example_Where_Clause"/>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
<update id="updateByExampleSelective" parameterType="map">
|
|
|
|
@ -298,7 +304,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="updateByExample" parameterType="map">
|
|
|
|
@ -321,7 +327,7 @@
|
|
|
|
|
analysis = #{record.analysis,jdbcType=VARCHAR},
|
|
|
|
|
school_id = #{record.schoolId,jdbcType=VARCHAR}
|
|
|
|
|
<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.financial_bigdata.entity.SysObjectiveQuestion">
|
|
|
|
@ -400,19 +406,31 @@
|
|
|
|
|
</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
|
|
|
|
|
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
|
|
|
|
|
ORDER BY RAND() LIMIT 10
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectRandomObjectiveSingle" resultMap="BaseResultMap">
|
|
|
|
|
SELECT
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
FROM
|
|
|
|
|
sys_objective_question
|
|
|
|
|
WHERE
|
|
|
|
@ -425,7 +443,7 @@
|
|
|
|
|
|
|
|
|
|
<select id="selectRandomObjectiveMany" resultMap="BaseResultMap">
|
|
|
|
|
SELECT
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
FROM
|
|
|
|
|
sys_objective_question
|
|
|
|
|
WHERE
|
|
|
|
@ -438,7 +456,7 @@
|
|
|
|
|
|
|
|
|
|
<select id="selectRandomObjectiveJudge" resultMap="BaseResultMap">
|
|
|
|
|
SELECT
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
FROM
|
|
|
|
|
sys_objective_question
|
|
|
|
|
WHERE
|
|
|
|
@ -459,4 +477,19 @@
|
|
|
|
|
</foreach>
|
|
|
|
|
</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="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>
|