|
@@ -39,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</select>
|
|
|
|
|
|
<select id="getAvgScore" parameterType="ScoreInfo" resultType="int">
|
|
|
- select ROUND(avg(score),0) from score_info s
|
|
|
+ select IFNULL(ROUND(avg(score),0),0) from score_info s
|
|
|
<where>
|
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
|
</where>
|
|
@@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
|
|
|
|
<select id="getMaxScore" parameterType="ScoreInfo" resultType="int">
|
|
|
- select max(score) from score_info s
|
|
|
+ select IFNULL(max(score),0) from score_info s
|
|
|
<where>
|
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
|
</where>
|