|
|
|
@ -2,26 +2,29 @@
|
|
|
|
|
<!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.StuTrainingMapper">
|
|
|
|
|
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.StuTraining">
|
|
|
|
|
<id column="training_id" jdbcType="VARCHAR" property="trainingId" />
|
|
|
|
|
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
|
|
|
|
<result column="chapter_id" jdbcType="VARCHAR" property="chapterId" />
|
|
|
|
|
<result column="progress" jdbcType="DECIMAL" property="progress" />
|
|
|
|
|
<result column="case_stu_score" jdbcType="DECIMAL" property="caseStuScore" />
|
|
|
|
|
<result column="knowledge_summary_score" jdbcType="DECIMAL" property="knowledgeSummaryScore" />
|
|
|
|
|
<result column="resource_learning_score" jdbcType="DECIMAL" property="resourceLearningScore" />
|
|
|
|
|
<result column="learning_eval_score" jdbcType="DECIMAL" property="learningEvalScore" />
|
|
|
|
|
<result column="exp_training_score" jdbcType="DECIMAL" property="expTrainingScore" />
|
|
|
|
|
<result column="knowledge_summary_complete_status" jdbcType="INTEGER" property="knowledgeSummaryCompleteStatus" />
|
|
|
|
|
<result column="resource_learning_complete_status" jdbcType="INTEGER" property="resourceLearningCompleteStatus" />
|
|
|
|
|
<result column="learning_eval_complete_status" jdbcType="INTEGER" property="learningEvalCompleteStatus" />
|
|
|
|
|
<result column="exp_training_complete_status" jdbcType="INTEGER" property="expTrainingCompleteStatus" />
|
|
|
|
|
<result column="report_id" jdbcType="VARCHAR" property="reportId" />
|
|
|
|
|
<id column="training_id" jdbcType="VARCHAR" property="trainingId"/>
|
|
|
|
|
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
|
|
|
|
|
<result column="chapter_id" jdbcType="VARCHAR" property="chapterId"/>
|
|
|
|
|
<result column="progress" jdbcType="DECIMAL" property="progress"/>
|
|
|
|
|
<result column="case_stu_score" jdbcType="DECIMAL" property="caseStuScore"/>
|
|
|
|
|
<result column="knowledge_summary_score" jdbcType="DECIMAL" property="knowledgeSummaryScore"/>
|
|
|
|
|
<result column="resource_learning_score" jdbcType="DECIMAL" property="resourceLearningScore"/>
|
|
|
|
|
<result column="learning_eval_score" jdbcType="DECIMAL" property="learningEvalScore"/>
|
|
|
|
|
<result column="exp_training_score" jdbcType="DECIMAL" property="expTrainingScore"/>
|
|
|
|
|
<result column="knowledge_summary_complete_status" jdbcType="INTEGER"
|
|
|
|
|
property="knowledgeSummaryCompleteStatus"/>
|
|
|
|
|
<result column="resource_learning_complete_status" jdbcType="INTEGER"
|
|
|
|
|
property="resourceLearningCompleteStatus"/>
|
|
|
|
|
<result column="learning_eval_complete_status" jdbcType="INTEGER" property="learningEvalCompleteStatus"/>
|
|
|
|
|
<result column="exp_training_complete_status" jdbcType="INTEGER" property="expTrainingCompleteStatus"/>
|
|
|
|
|
<result column="report_id" jdbcType="VARCHAR" property="reportId"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.financial_bigdata.entity.StuTrainingWithBLOBs">
|
|
|
|
|
<result column="learning_eval_idList" jdbcType="LONGVARCHAR" property="learningEvalIdlist" />
|
|
|
|
|
<result column="learning_eval_answer" jdbcType="LONGVARCHAR" property="learningEvalAnswer" />
|
|
|
|
|
<result column="case_stu_answer" jdbcType="LONGVARCHAR" property="caseStuAnswer" />
|
|
|
|
|
<result column="knowledge_note" jdbcType="LONGVARCHAR" property="knowledgeNote" />
|
|
|
|
|
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs"
|
|
|
|
|
type="com.sztzjy.financial_bigdata.entity.StuTrainingWithBLOBs">
|
|
|
|
|
<result column="learning_eval_idList" jdbcType="LONGVARCHAR" property="learningEvalIdlist"/>
|
|
|
|
|
<result column="learning_eval_answer" jdbcType="LONGVARCHAR" property="learningEvalAnswer"/>
|
|
|
|
|
<result column="case_stu_answer" jdbcType="LONGVARCHAR" property="caseStuAnswer"/>
|
|
|
|
|
<result column="knowledge_note" jdbcType="LONGVARCHAR" property="knowledgeNote"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
<sql id="Example_Where_Clause">
|
|
|
|
|
<where>
|
|
|
|
@ -41,7 +44,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>
|
|
|
|
@ -70,7 +74,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>
|
|
|
|
@ -82,39 +87,43 @@
|
|
|
|
|
</where>
|
|
|
|
|
</sql>
|
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
|
training_id, user_id, chapter_id, progress, case_stu_score, knowledge_summary_score,
|
|
|
|
|
training_id
|
|
|
|
|
, user_id, chapter_id, progress, case_stu_score, knowledge_summary_score,
|
|
|
|
|
resource_learning_score, learning_eval_score, exp_training_score, knowledge_summary_complete_status,
|
|
|
|
|
resource_learning_complete_status, learning_eval_complete_status, exp_training_complete_status,
|
|
|
|
|
report_id
|
|
|
|
|
</sql>
|
|
|
|
|
<sql id="Blob_Column_List">
|
|
|
|
|
learning_eval_idList, learning_eval_answer, case_stu_answer, knowledge_note
|
|
|
|
|
learning_eval_idList
|
|
|
|
|
, learning_eval_answer, case_stu_answer, knowledge_note
|
|
|
|
|
</sql>
|
|
|
|
|
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingExample" resultMap="ResultMapWithBLOBs">
|
|
|
|
|
<select id="selectByExampleWithBLOBs" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingExample"
|
|
|
|
|
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 stu_training
|
|
|
|
|
<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.financial_bigdata.entity.StuTrainingExample" resultMap="BaseResultMap">
|
|
|
|
|
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingExample"
|
|
|
|
|
resultMap="BaseResultMap">
|
|
|
|
|
select
|
|
|
|
|
<if test="distinct">
|
|
|
|
|
distinct
|
|
|
|
|
</if>
|
|
|
|
|
<include refid="Base_Column_List" />
|
|
|
|
|
<include refid="Base_Column_List"/>
|
|
|
|
|
from stu_training
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
|
<include refid="Example_Where_Clause"/>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="orderByClause != null">
|
|
|
|
|
order by ${orderByClause}
|
|
|
|
@ -122,20 +131,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 stu_training
|
|
|
|
|
where training_id = #{trainingId,jdbcType=VARCHAR}
|
|
|
|
|
</select>
|
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
|
|
delete from stu_training
|
|
|
|
|
delete
|
|
|
|
|
from stu_training
|
|
|
|
|
where training_id = #{trainingId,jdbcType=VARCHAR}
|
|
|
|
|
</delete>
|
|
|
|
|
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingExample">
|
|
|
|
|
delete from stu_training
|
|
|
|
|
<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.StuTrainingWithBLOBs">
|
|
|
|
@ -148,11 +158,13 @@
|
|
|
|
|
learning_eval_answer, case_stu_answer,
|
|
|
|
|
knowledge_note)
|
|
|
|
|
values (#{trainingId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{chapterId,jdbcType=VARCHAR},
|
|
|
|
|
#{progress,jdbcType=DECIMAL}, #{caseStuScore,jdbcType=DECIMAL}, #{knowledgeSummaryScore,jdbcType=DECIMAL},
|
|
|
|
|
#{progress,jdbcType=DECIMAL}, #{caseStuScore,jdbcType=DECIMAL},
|
|
|
|
|
#{knowledgeSummaryScore,jdbcType=DECIMAL},
|
|
|
|
|
#{resourceLearningScore,jdbcType=DECIMAL}, #{learningEvalScore,jdbcType=DECIMAL},
|
|
|
|
|
#{expTrainingScore,jdbcType=DECIMAL}, #{knowledgeSummaryCompleteStatus,jdbcType=INTEGER},
|
|
|
|
|
#{resourceLearningCompleteStatus,jdbcType=INTEGER}, #{learningEvalCompleteStatus,jdbcType=INTEGER},
|
|
|
|
|
#{expTrainingCompleteStatus,jdbcType=INTEGER}, #{reportId,jdbcType=VARCHAR}, #{learningEvalIdlist,jdbcType=LONGVARCHAR},
|
|
|
|
|
#{expTrainingCompleteStatus,jdbcType=INTEGER}, #{reportId,jdbcType=VARCHAR},
|
|
|
|
|
#{learningEvalIdlist,jdbcType=LONGVARCHAR},
|
|
|
|
|
#{learningEvalAnswer,jdbcType=LONGVARCHAR}, #{caseStuAnswer,jdbcType=LONGVARCHAR},
|
|
|
|
|
#{knowledgeNote,jdbcType=LONGVARCHAR})
|
|
|
|
|
</insert>
|
|
|
|
@ -271,10 +283,11 @@
|
|
|
|
|
</if>
|
|
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingExample" resultType="java.lang.Long">
|
|
|
|
|
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTrainingExample"
|
|
|
|
|
resultType="java.lang.Long">
|
|
|
|
|
select count(*) from stu_training
|
|
|
|
|
<if test="_parameter != null">
|
|
|
|
|
<include refid="Example_Where_Clause" />
|
|
|
|
|
<include refid="Example_Where_Clause"/>
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
<update id="updateByExampleSelective" parameterType="map">
|
|
|
|
@ -336,7 +349,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">
|
|
|
|
@ -360,7 +373,7 @@
|
|
|
|
|
case_stu_answer = #{record.caseStuAnswer,jdbcType=LONGVARCHAR},
|
|
|
|
|
knowledge_note = #{record.knowledgeNote,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">
|
|
|
|
@ -380,7 +393,7 @@
|
|
|
|
|
exp_training_complete_status = #{record.expTrainingCompleteStatus,jdbcType=INTEGER},
|
|
|
|
|
report_id = #{record.reportId,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.StuTrainingWithBLOBs">
|
|
|
|
@ -479,22 +492,36 @@
|
|
|
|
|
where training_id = #{trainingId,jdbcType=VARCHAR}
|
|
|
|
|
</update>
|
|
|
|
|
<resultMap id="DtoBaseResultMap" type="com.sztzjy.financial_bigdata.entity.tea_dto.TrainingDto">
|
|
|
|
|
<result column="title" jdbcType="VARCHAR" property="name" />
|
|
|
|
|
<result column="chapter_name" jdbcType="VARCHAR" property="task" />
|
|
|
|
|
<result column="case_id" jdbcType="VARCHAR" property="caseId" />
|
|
|
|
|
<result column="total_steps_count" jdbcType="INTEGER" property="count" />
|
|
|
|
|
<result column="total_steps_score" jdbcType="DECIMAL" property="score" />
|
|
|
|
|
<result column="total_steps_score" jdbcType="DECIMAL" property="score" />
|
|
|
|
|
<result column="title" jdbcType="VARCHAR" property="name"/>
|
|
|
|
|
<result column="chapter_name" jdbcType="VARCHAR" property="task"/>
|
|
|
|
|
<result column="case_id" jdbcType="VARCHAR" property="caseId"/>
|
|
|
|
|
<result column="total_steps_count" jdbcType="INTEGER" property="count"/>
|
|
|
|
|
<result column="total_steps_score" jdbcType="DECIMAL" property="score"/>
|
|
|
|
|
<result column="total_steps_score" jdbcType="DECIMAL" property="score"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<select id="selectTrainingByIds" parameterType="com.sztzjy.financial_bigdata.entity.StuTraining" resultMap="DtoBaseResultMap">
|
|
|
|
|
SELECT SUM(sqs.score) AS total_steps_score, sqs.case_id,COUNT(sqs.case_step_id) AS total_steps_count, sq.title, scc.chapter_name
|
|
|
|
|
<select id="selectTrainingByIds" parameterType="com.sztzjy.financial_bigdata.entity.StuTraining"
|
|
|
|
|
resultMap="DtoBaseResultMap">
|
|
|
|
|
SELECT SUM(sqs.score) AS total_steps_score, sqs.case_id,COUNT(sqs.case_step_id) AS total_steps_count, sq.title,
|
|
|
|
|
scc.chapter_name
|
|
|
|
|
FROM sys_case_question_step sqs
|
|
|
|
|
JOIN sys_case_question sq ON sqs.case_id = sq.case_id
|
|
|
|
|
JOIN sys_course_chapter scc ON sq.chapter_id = scc.chapter_id
|
|
|
|
|
WHERE sqs.case_id IN <foreach item="item" collection="ids" open="(" separator="," close=")">
|
|
|
|
|
WHERE sqs.case_id IN
|
|
|
|
|
<foreach item="item" collection="ids" open="(" separator="," close=")">
|
|
|
|
|
#{item}
|
|
|
|
|
</foreach>
|
|
|
|
|
GROUP BY sq.title, scc.chapter_name,sqs.case_id;
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<select id="getByUserIdAndChapterIds" resultMap="BaseResultMap">
|
|
|
|
|
SELECT chapter_id,progress
|
|
|
|
|
FROM stu_training
|
|
|
|
|
WHERE user_id = #{userId}
|
|
|
|
|
AND chapter_id IN
|
|
|
|
|
<foreach collection="chapterIds" item="chapterId" separator="," open="(" close=")">
|
|
|
|
|
#{chapterId}
|
|
|
|
|
</foreach>
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|