修改三个导出功能,和首页考核列表查询功能
parent
678e1dfd93
commit
ff476f9192
@ -1,340 +1,366 @@
|
||||
<?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.StuTheoryRecordMapper">
|
||||
<resultMap id="BaseResultMap" type="com.sztzjy.financial_bigdata.entity.StuTheoryRecord">
|
||||
<id column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||
<result column="school_id" jdbcType="VARCHAR" property="schoolId" />
|
||||
<result column="class_id" jdbcType="VARCHAR" property="classId" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="student_id" jdbcType="VARCHAR" property="studentId" />
|
||||
<result column="exam_count" jdbcType="INTEGER" property="examCount" />
|
||||
<result column="highest_score" jdbcType="DECIMAL" property="highestScore" />
|
||||
<result column="lowest_score" jdbcType="DECIMAL" property="lowestScore" />
|
||||
<result column="total_duration" jdbcType="INTEGER" property="totalDuration" />
|
||||
<result column="average_score" jdbcType="DECIMAL" property="averageScore" />
|
||||
<result column="system_owner" jdbcType="VARCHAR" property="systemOwner" />
|
||||
</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.StuTheoryRecord">
|
||||
<id column="user_id" jdbcType="VARCHAR" property="userId"/>
|
||||
<result column="school_id" jdbcType="VARCHAR" property="schoolId"/>
|
||||
<result column="class_id" jdbcType="VARCHAR" property="classId"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
<result column="student_id" jdbcType="VARCHAR" property="studentId"/>
|
||||
<result column="exam_count" jdbcType="INTEGER" property="examCount"/>
|
||||
<result column="highest_score" jdbcType="DECIMAL" property="highestScore"/>
|
||||
<result column="lowest_score" jdbcType="DECIMAL" property="lowestScore"/>
|
||||
<result column="total_duration" jdbcType="INTEGER" property="totalDuration"/>
|
||||
<result column="average_score" jdbcType="DECIMAL" property="averageScore"/>
|
||||
<result column="system_owner" jdbcType="VARCHAR" property="systemOwner"/>
|
||||
</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">
|
||||
user_id, school_id, class_id, name, student_id, exam_count, highest_score, lowest_score,
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
user_id
|
||||
, school_id, class_id, name, student_id, exam_count, highest_score, lowest_score,
|
||||
total_duration, average_score, system_owner
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecordExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from stu_theory_record
|
||||
<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 stu_theory_record
|
||||
where user_id = #{userId,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete from stu_theory_record
|
||||
where user_id = #{userId,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecordExample">
|
||||
delete from stu_theory_record
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecord">
|
||||
insert into stu_theory_record (user_id, school_id, class_id,
|
||||
name, student_id, exam_count,
|
||||
highest_score, lowest_score, total_duration,
|
||||
average_score, system_owner)
|
||||
values (#{userId,jdbcType=VARCHAR}, #{schoolId,jdbcType=VARCHAR}, #{classId,jdbcType=VARCHAR},
|
||||
#{name,jdbcType=VARCHAR}, #{studentId,jdbcType=VARCHAR}, #{examCount,jdbcType=INTEGER},
|
||||
#{highestScore,jdbcType=DECIMAL}, #{lowestScore,jdbcType=DECIMAL}, #{totalDuration,jdbcType=INTEGER},
|
||||
#{averageScore,jdbcType=DECIMAL}, #{systemOwner,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecord">
|
||||
insert into stu_theory_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="schoolId != null">
|
||||
school_id,
|
||||
</if>
|
||||
<if test="classId != null">
|
||||
class_id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="studentId != null">
|
||||
student_id,
|
||||
</if>
|
||||
<if test="examCount != null">
|
||||
exam_count,
|
||||
</if>
|
||||
<if test="highestScore != null">
|
||||
highest_score,
|
||||
</if>
|
||||
<if test="lowestScore != null">
|
||||
lowest_score,
|
||||
</if>
|
||||
<if test="totalDuration != null">
|
||||
total_duration,
|
||||
</if>
|
||||
<if test="averageScore != null">
|
||||
average_score,
|
||||
</if>
|
||||
<if test="systemOwner != null">
|
||||
system_owner,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="schoolId != null">
|
||||
#{schoolId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="classId != null">
|
||||
#{classId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="studentId != null">
|
||||
#{studentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="examCount != null">
|
||||
#{examCount,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="highestScore != null">
|
||||
#{highestScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="lowestScore != null">
|
||||
#{lowestScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="totalDuration != null">
|
||||
#{totalDuration,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="averageScore != null">
|
||||
#{averageScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="systemOwner != null">
|
||||
#{systemOwner,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecordExample" resultType="java.lang.Long">
|
||||
select count(*) from stu_theory_record
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update stu_theory_record
|
||||
<set>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.schoolId != null">
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecordExample"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
from stu_theory_record
|
||||
<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 stu_theory_record
|
||||
where user_id = #{userId,jdbcType=VARCHAR}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
||||
delete
|
||||
from stu_theory_record
|
||||
where user_id = #{userId,jdbcType=VARCHAR}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecordExample">
|
||||
delete from stu_theory_record
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecord">
|
||||
insert into stu_theory_record (user_id, school_id, class_id,
|
||||
name, student_id, exam_count,
|
||||
highest_score, lowest_score, total_duration,
|
||||
average_score, system_owner)
|
||||
values (#{userId,jdbcType=VARCHAR}, #{schoolId,jdbcType=VARCHAR}, #{classId,jdbcType=VARCHAR},
|
||||
#{name,jdbcType=VARCHAR}, #{studentId,jdbcType=VARCHAR}, #{examCount,jdbcType=INTEGER},
|
||||
#{highestScore,jdbcType=DECIMAL}, #{lowestScore,jdbcType=DECIMAL}, #{totalDuration,jdbcType=INTEGER},
|
||||
#{averageScore,jdbcType=DECIMAL}, #{systemOwner,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecord">
|
||||
insert into stu_theory_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="schoolId != null">
|
||||
school_id,
|
||||
</if>
|
||||
<if test="classId != null">
|
||||
class_id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="studentId != null">
|
||||
student_id,
|
||||
</if>
|
||||
<if test="examCount != null">
|
||||
exam_count,
|
||||
</if>
|
||||
<if test="highestScore != null">
|
||||
highest_score,
|
||||
</if>
|
||||
<if test="lowestScore != null">
|
||||
lowest_score,
|
||||
</if>
|
||||
<if test="totalDuration != null">
|
||||
total_duration,
|
||||
</if>
|
||||
<if test="averageScore != null">
|
||||
average_score,
|
||||
</if>
|
||||
<if test="systemOwner != null">
|
||||
system_owner,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="schoolId != null">
|
||||
#{schoolId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="classId != null">
|
||||
#{classId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="studentId != null">
|
||||
#{studentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="examCount != null">
|
||||
#{examCount,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="highestScore != null">
|
||||
#{highestScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="lowestScore != null">
|
||||
#{lowestScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="totalDuration != null">
|
||||
#{totalDuration,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="averageScore != null">
|
||||
#{averageScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="systemOwner != null">
|
||||
#{systemOwner,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecordExample"
|
||||
resultType="java.lang.Long">
|
||||
select count(*) from stu_theory_record
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update stu_theory_record
|
||||
<set>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.schoolId != null">
|
||||
school_id = #{record.schoolId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.classId != null">
|
||||
class_id = #{record.classId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.studentId != null">
|
||||
student_id = #{record.studentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.examCount != null">
|
||||
exam_count = #{record.examCount,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.highestScore != null">
|
||||
highest_score = #{record.highestScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.lowestScore != null">
|
||||
lowest_score = #{record.lowestScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.totalDuration != null">
|
||||
total_duration = #{record.totalDuration,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.averageScore != null">
|
||||
average_score = #{record.averageScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.systemOwner != null">
|
||||
system_owner = #{record.systemOwner,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause"/>
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update stu_theory_record
|
||||
set user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
school_id = #{record.schoolId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.classId != null">
|
||||
class_id = #{record.classId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.studentId != null">
|
||||
student_id = #{record.studentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.examCount != null">
|
||||
exam_count = #{record.examCount,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.highestScore != null">
|
||||
highest_score = #{record.highestScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.lowestScore != null">
|
||||
lowest_score = #{record.lowestScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.totalDuration != null">
|
||||
total_duration = #{record.totalDuration,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.averageScore != null">
|
||||
average_score = #{record.averageScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.systemOwner != null">
|
||||
system_owner = #{record.systemOwner,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update stu_theory_record
|
||||
set user_id = #{record.userId,jdbcType=VARCHAR},
|
||||
school_id = #{record.schoolId,jdbcType=VARCHAR},
|
||||
class_id = #{record.classId,jdbcType=VARCHAR},
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
student_id = #{record.studentId,jdbcType=VARCHAR},
|
||||
exam_count = #{record.examCount,jdbcType=INTEGER},
|
||||
highest_score = #{record.highestScore,jdbcType=DECIMAL},
|
||||
lowest_score = #{record.lowestScore,jdbcType=DECIMAL},
|
||||
total_duration = #{record.totalDuration,jdbcType=INTEGER},
|
||||
average_score = #{record.averageScore,jdbcType=DECIMAL},
|
||||
system_owner = #{record.systemOwner,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecord">
|
||||
update stu_theory_record
|
||||
<set>
|
||||
<if test="schoolId != null">
|
||||
school_id = #{schoolId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="classId != null">
|
||||
class_id = #{classId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="studentId != null">
|
||||
student_id = #{studentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="examCount != null">
|
||||
exam_count = #{examCount,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="highestScore != null">
|
||||
highest_score = #{highestScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="lowestScore != null">
|
||||
lowest_score = #{lowestScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="totalDuration != null">
|
||||
total_duration = #{totalDuration,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="averageScore != null">
|
||||
average_score = #{averageScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="systemOwner != null">
|
||||
system_owner = #{systemOwner,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where user_id = #{userId,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecord">
|
||||
update stu_theory_record
|
||||
set school_id = #{schoolId,jdbcType=VARCHAR},
|
||||
class_id = #{classId,jdbcType=VARCHAR},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
student_id = #{studentId,jdbcType=VARCHAR},
|
||||
exam_count = #{examCount,jdbcType=INTEGER},
|
||||
highest_score = #{highestScore,jdbcType=DECIMAL},
|
||||
lowest_score = #{lowestScore,jdbcType=DECIMAL},
|
||||
total_duration = #{totalDuration,jdbcType=INTEGER},
|
||||
average_score = #{averageScore,jdbcType=DECIMAL},
|
||||
system_owner = #{systemOwner,jdbcType=VARCHAR}
|
||||
where user_id = #{userId,jdbcType=VARCHAR}
|
||||
</update>
|
||||
system_owner = #{record.systemOwner,jdbcType=VARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause"/>
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecord">
|
||||
update stu_theory_record
|
||||
<set>
|
||||
<if test="schoolId != null">
|
||||
school_id = #{schoolId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="classId != null">
|
||||
class_id = #{classId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="studentId != null">
|
||||
student_id = #{studentId,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="examCount != null">
|
||||
exam_count = #{examCount,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="highestScore != null">
|
||||
highest_score = #{highestScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="lowestScore != null">
|
||||
lowest_score = #{lowestScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="totalDuration != null">
|
||||
total_duration = #{totalDuration,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="averageScore != null">
|
||||
average_score = #{averageScore,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="systemOwner != null">
|
||||
system_owner = #{systemOwner,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where user_id = #{userId,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecord">
|
||||
update stu_theory_record
|
||||
set school_id = #{schoolId,jdbcType=VARCHAR},
|
||||
class_id = #{classId,jdbcType=VARCHAR},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
student_id = #{studentId,jdbcType=VARCHAR},
|
||||
exam_count = #{examCount,jdbcType=INTEGER},
|
||||
highest_score = #{highestScore,jdbcType=DECIMAL},
|
||||
lowest_score = #{lowestScore,jdbcType=DECIMAL},
|
||||
total_duration = #{totalDuration,jdbcType=INTEGER},
|
||||
average_score = #{averageScore,jdbcType=DECIMAL},
|
||||
system_owner = #{systemOwner,jdbcType=VARCHAR}
|
||||
where user_id = #{userId,jdbcType=VARCHAR}
|
||||
</update>
|
||||
|
||||
<resultMap id="DtoMap" type="com.sztzjy.financial_bigdata.entity.stu_dto.StuTheoryIndexInfoDto">
|
||||
<result column="score" jdbcType="DECIMAL" property="lastTaskScore" />
|
||||
<result column="total_duration" jdbcType="INTEGER" property="theoryTotalDuration" />
|
||||
<result column="exam_count" jdbcType="INTEGER" property="theoryNum" />
|
||||
<result column="rank" jdbcType="INTEGER" property="theoryLastRank" />
|
||||
</resultMap>
|
||||
<resultMap id="DtoMap" type="com.sztzjy.financial_bigdata.entity.stu_dto.StuTheoryIndexInfoDto">
|
||||
<result column="score" jdbcType="DECIMAL" property="lastTaskScore"/>
|
||||
<result column="total_duration" jdbcType="INTEGER" property="theoryTotalDuration"/>
|
||||
<result column="exam_count" jdbcType="INTEGER" property="theoryNum"/>
|
||||
<result column="rank" jdbcType="INTEGER" property="theoryLastRank"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectTheoryInfo" parameterType="com.sztzjy.financial_bigdata.entity.stu_dto.StuTheoryIndexInfoDto" resultMap="DtoMap">
|
||||
SELECT ste.score, str.total_duration,str.exam_count, (
|
||||
SELECT COUNT(*) AS `rank`
|
||||
FROM stu_theory_exam
|
||||
WHERE accuracy >= (
|
||||
SELECT accuracy
|
||||
FROM stu_theory_exam
|
||||
WHERE user_id = 4
|
||||
ORDER BY exam_time DESC
|
||||
LIMIT 1
|
||||
)
|
||||
<select id="selectTheoryInfo" parameterType="com.sztzjy.financial_bigdata.entity.stu_dto.StuTheoryIndexInfoDto"
|
||||
resultMap="DtoMap">
|
||||
SELECT ste.score,
|
||||
str.total_duration,
|
||||
str.exam_count,
|
||||
(
|
||||
SELECT COUNT(*) AS `rank`
|
||||
FROM stu_theory_exam
|
||||
WHERE accuracy >= (
|
||||
SELECT accuracy
|
||||
FROM stu_theory_exam
|
||||
WHERE user_id = 4
|
||||
ORDER BY exam_time DESC
|
||||
LIMIT 1 )
|
||||
) AS `rank`
|
||||
FROM stu_theory_exam ste
|
||||
JOIN stu_theory_record str ON ste.user_id = str.user_id
|
||||
WHERE ste.user_id = 4
|
||||
AND ste.answered = 1
|
||||
AND ste.accuracy >= (
|
||||
SELECT accuracy
|
||||
FROM stu_theory_exam
|
||||
WHERE user_id = 4
|
||||
ORDER BY exam_time DESC
|
||||
LIMIT 1
|
||||
)
|
||||
ORDER BY ste.exam_time DESC
|
||||
LIMIT 1;
|
||||
</select>
|
||||
FROM stu_theory_exam ste
|
||||
JOIN stu_theory_record str
|
||||
ON ste.user_id = str.user_id
|
||||
WHERE ste.user_id = 4
|
||||
AND ste.answered = 1
|
||||
AND ste.accuracy >= (
|
||||
SELECT accuracy
|
||||
FROM stu_theory_exam
|
||||
WHERE user_id = 4
|
||||
ORDER BY exam_time DESC
|
||||
LIMIT 1
|
||||
)
|
||||
ORDER BY ste.exam_time DESC
|
||||
LIMIT 1;
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectConditions" resultMap="BaseResultMap">
|
||||
select *
|
||||
from stu_theory_record
|
||||
<where>
|
||||
system_owner = #{systemOwner}
|
||||
AND school_id = #{schoolId}
|
||||
<if test="classId != null and classId != ''">
|
||||
AND class_id = #{classId}
|
||||
</if>
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
AND (student_id like CONCAT ('%',#{keyWord},'%') or name like CONCAT ('%',#{keyWord},'%'))
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue