|
@@ -52,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
FROM
|
|
FROM
|
|
score_data_student b
|
|
score_data_student b
|
|
LEFT JOIN score_data_detail d ON d.score_data_name_id = b.score_data_name_id
|
|
LEFT JOIN score_data_detail d ON d.score_data_name_id = b.score_data_name_id
|
|
- where b.score_id = #{scoreId} and find_in_set(b.score_data_name_id,#{params.stdId})
|
|
|
|
|
|
+ where b.score_id = #{scoreId} and find_in_set(b.score_data_name_id,#{params.stdId}) order by b.score_sort
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="selectScoreByScoreId" parameterType="Long" resultMap="ScoreDataStudentResult">
|
|
<select id="selectScoreByScoreId" parameterType="Long" resultMap="ScoreDataStudentResult">
|
|
@@ -67,10 +67,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
FROM
|
|
FROM
|
|
score_data_student b
|
|
score_data_student b
|
|
LEFT JOIN score_data_detail d ON d.score_data_name_id = b.score_data_name_id
|
|
LEFT JOIN score_data_detail d ON d.score_data_name_id = b.score_data_name_id
|
|
- where b.score_id = #{scoreId}
|
|
|
|
|
|
+ where b.score_id = #{scoreId} order by b.score_sort
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <select id="selectScoreByScoreIds" parameterType="String" resultMap="ScoreDataStudentResult">
|
|
|
|
|
|
+ <select id="selectScoreByScoreIds" resultMap="ScoreDataStudentResult">
|
|
SELECT
|
|
SELECT
|
|
b.score_id,
|
|
b.score_id,
|
|
b.zongfen
|
|
b.zongfen
|
|
@@ -83,29 +83,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
</foreach>
|
|
</foreach>
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <select id="gradeRank" parameterType="Long" resultMap="ScoreDataStudentResult">
|
|
|
|
- SET @index = 0;
|
|
|
|
- SELECT @index:=@index+1 AS `score_sort`,s.score_data_name,s.score_data_name_id,s.zongfen
|
|
|
|
|
|
+ <select id="gradeRank" parameterType="org.dromara.system.domain.score.ScoreData" resultMap="ScoreDataStudentResult">
|
|
|
|
+
|
|
|
|
+ SELECT (@index:=@index+1) AS `score_sort`,s.score_data_name,s.score_data_name_id,s.zongfen,s.score_id
|
|
FROM score_data_student s where score_id IN (
|
|
FROM score_data_student s where score_id IN (
|
|
select d.score_id
|
|
select d.score_id
|
|
- FROM score_data d
|
|
|
|
|
|
+ FROM score_data d,(select @INDEX:=0) init
|
|
<where>
|
|
<where>
|
|
<if test="scoreType != null and scoreType != ''"> and d.score_type = #{scoreType}</if>
|
|
<if test="scoreType != null and scoreType != ''"> and d.score_type = #{scoreType}</if>
|
|
<if test="scoreTime != null "> and d.score_time = #{scoreTime}</if>
|
|
<if test="scoreTime != null "> and d.score_time = #{scoreTime}</if>
|
|
- <if test="scoreClassId != null "> and d.score_class_id = #{scoreClassId}</if>
|
|
|
|
<if test="scoreClassName != null and scoreClassName != ''"> and d.score_class_name like concat( #{scoreClassName}, '%')</if>
|
|
<if test="scoreClassName != null and scoreClassName != ''"> and d.score_class_name like concat( #{scoreClassName}, '%')</if>
|
|
</where>
|
|
</where>
|
|
|
|
+ )
|
|
order by s.zongfen DESC
|
|
order by s.zongfen DESC
|
|
</select>
|
|
</select>
|
|
- <select id="xuekeRank" parameterType="Long" resultMap="ScoreDataDetailResult">
|
|
|
|
- SET @INDEX = 0;
|
|
|
|
|
|
+ <select id="xuekeRank" parameterType="org.dromara.system.domain.score.bo.ScoreDataBo" resultMap="ScoreDataDetailResult">
|
|
|
|
+
|
|
SELECT
|
|
SELECT
|
|
- @INDEX := @INDEX + 1 AS `score_sort`,
|
|
|
|
- dd.score_data_name,
|
|
|
|
- dd.score_data_name_id,
|
|
|
|
- dd.score
|
|
|
|
|
|
+ (@INDEX := @INDEX + 1) AS `score_sort`,
|
|
|
|
+ dd.score_data_name as sdd_score_data_name,
|
|
|
|
+ dd.score_data_name_id as sdd_score_data_name_id,
|
|
|
|
+ dd.xueke as sdd_xueke,
|
|
|
|
+ dd.score as sdd_score
|
|
FROM
|
|
FROM
|
|
- score_data_detail dd
|
|
|
|
|
|
+ score_data_detail dd,(select @INDEX:=0) init
|
|
WHERE
|
|
WHERE
|
|
score_id IN (
|
|
score_id IN (
|
|
SELECT
|
|
SELECT
|
|
@@ -115,6 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
<where>
|
|
<where>
|
|
<if test="scoreType != null and scoreType != ''"> and d.score_type = #{scoreType}</if>
|
|
<if test="scoreType != null and scoreType != ''"> and d.score_type = #{scoreType}</if>
|
|
<if test="scoreTime != null "> and d.score_time = #{scoreTime}</if>
|
|
<if test="scoreTime != null "> and d.score_time = #{scoreTime}</if>
|
|
|
|
+ <if test="scoreId != null "> and d.score_id = #{scoreId}</if>
|
|
<if test="scoreClassName != null and scoreClassName != ''"> and d.score_class_name like concat( #{scoreClassName}, '%')</if>
|
|
<if test="scoreClassName != null and scoreClassName != ''"> and d.score_class_name like concat( #{scoreClassName}, '%')</if>
|
|
</where>
|
|
</where>
|
|
) and dd.xueke=#{xueke} order by dd.score DESC
|
|
) and dd.xueke=#{xueke} order by dd.score DESC
|