|
|
@ -32,7 +32,8 @@
|
|
|
|
</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="("
|
|
|
|
|
|
|
|
separator=",">
|
|
|
|
#{listItem}
|
|
|
|
#{listItem}
|
|
|
|
</foreach>
|
|
|
|
</foreach>
|
|
|
|
</when>
|
|
|
|
</when>
|
|
|
@ -61,7 +62,8 @@
|
|
|
|
</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="("
|
|
|
|
|
|
|
|
separator=",">
|
|
|
|
#{listItem}
|
|
|
|
#{listItem}
|
|
|
|
</foreach>
|
|
|
|
</foreach>
|
|
|
|
</when>
|
|
|
|
</when>
|
|
|
@ -73,10 +75,12 @@
|
|
|
|
</where>
|
|
|
|
</where>
|
|
|
|
</sql>
|
|
|
|
</sql>
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
<sql id="Base_Column_List">
|
|
|
|
user_id, school_id, class_id, name, student_id, exam_count, highest_score, lowest_score,
|
|
|
|
user_id
|
|
|
|
|
|
|
|
, school_id, class_id, name, student_id, exam_count, highest_score, lowest_score,
|
|
|
|
total_duration, average_score, system_owner
|
|
|
|
total_duration, average_score, system_owner
|
|
|
|
</sql>
|
|
|
|
</sql>
|
|
|
|
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecordExample" resultMap="BaseResultMap">
|
|
|
|
<select id="selectByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecordExample"
|
|
|
|
|
|
|
|
resultMap="BaseResultMap">
|
|
|
|
select
|
|
|
|
select
|
|
|
|
<if test="distinct">
|
|
|
|
<if test="distinct">
|
|
|
|
distinct
|
|
|
|
distinct
|
|
|
@ -97,7 +101,8 @@
|
|
|
|
where user_id = #{userId,jdbcType=VARCHAR}
|
|
|
|
where user_id = #{userId,jdbcType=VARCHAR}
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
|
|
|
|
delete from stu_theory_record
|
|
|
|
delete
|
|
|
|
|
|
|
|
from stu_theory_record
|
|
|
|
where user_id = #{userId,jdbcType=VARCHAR}
|
|
|
|
where user_id = #{userId,jdbcType=VARCHAR}
|
|
|
|
</delete>
|
|
|
|
</delete>
|
|
|
|
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecordExample">
|
|
|
|
<delete id="deleteByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecordExample">
|
|
|
@ -189,7 +194,8 @@
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
</trim>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
</insert>
|
|
|
|
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecordExample" resultType="java.lang.Long">
|
|
|
|
<select id="countByExample" parameterType="com.sztzjy.financial_bigdata.entity.StuTheoryRecordExample"
|
|
|
|
|
|
|
|
resultType="java.lang.Long">
|
|
|
|
select count(*) from stu_theory_record
|
|
|
|
select count(*) from stu_theory_record
|
|
|
|
<if test="_parameter != null">
|
|
|
|
<if test="_parameter != null">
|
|
|
|
<include refid="Example_Where_Clause"/>
|
|
|
|
<include refid="Example_Where_Clause"/>
|
|
|
@ -311,8 +317,12 @@
|
|
|
|
<result column="rank" jdbcType="INTEGER" property="theoryLastRank"/>
|
|
|
|
<result column="rank" jdbcType="INTEGER" property="theoryLastRank"/>
|
|
|
|
</resultMap>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="selectTheoryInfo" parameterType="com.sztzjy.financial_bigdata.entity.stu_dto.StuTheoryIndexInfoDto" resultMap="DtoMap">
|
|
|
|
<select id="selectTheoryInfo" parameterType="com.sztzjy.financial_bigdata.entity.stu_dto.StuTheoryIndexInfoDto"
|
|
|
|
SELECT ste.score, str.total_duration,str.exam_count, (
|
|
|
|
resultMap="DtoMap">
|
|
|
|
|
|
|
|
SELECT ste.score,
|
|
|
|
|
|
|
|
str.total_duration,
|
|
|
|
|
|
|
|
str.exam_count,
|
|
|
|
|
|
|
|
(
|
|
|
|
SELECT COUNT(*) AS `rank`
|
|
|
|
SELECT COUNT(*) AS `rank`
|
|
|
|
FROM stu_theory_exam
|
|
|
|
FROM stu_theory_exam
|
|
|
|
WHERE accuracy >= (
|
|
|
|
WHERE accuracy >= (
|
|
|
@ -320,11 +330,11 @@
|
|
|
|
FROM stu_theory_exam
|
|
|
|
FROM stu_theory_exam
|
|
|
|
WHERE user_id = 4
|
|
|
|
WHERE user_id = 4
|
|
|
|
ORDER BY exam_time DESC
|
|
|
|
ORDER BY exam_time DESC
|
|
|
|
LIMIT 1
|
|
|
|
LIMIT 1 )
|
|
|
|
)
|
|
|
|
|
|
|
|
) AS `rank`
|
|
|
|
) AS `rank`
|
|
|
|
FROM stu_theory_exam ste
|
|
|
|
FROM stu_theory_exam ste
|
|
|
|
JOIN stu_theory_record str ON ste.user_id = str.user_id
|
|
|
|
JOIN stu_theory_record str
|
|
|
|
|
|
|
|
ON ste.user_id = str.user_id
|
|
|
|
WHERE ste.user_id = 4
|
|
|
|
WHERE ste.user_id = 4
|
|
|
|
AND ste.answered = 1
|
|
|
|
AND ste.answered = 1
|
|
|
|
AND ste.accuracy >= (
|
|
|
|
AND ste.accuracy >= (
|
|
|
@ -337,4 +347,20 @@
|
|
|
|
ORDER BY ste.exam_time DESC
|
|
|
|
ORDER BY ste.exam_time DESC
|
|
|
|
LIMIT 1;
|
|
|
|
LIMIT 1;
|
|
|
|
</select>
|
|
|
|
</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>
|
|
|
|
</mapper>
|