</select> <!-- 折线图 --> <select id="selectBroken" resultType="map"> select sum(t.score_num) score_num,trunc(t.tim/10000) tim(聚合函数必须区别名!!) from tbl_score_log t where 1= 1 <if test="beginDate != null and beginDate!= '' "> tim >= #{beginDate} </if> <if test="endDate != null and endDate != '' "> and tim <= #{endDate} </if> <if test="uid!=null and uid!='' "> and t.user_id =#{uid} </if> <if test="type !=null and type!= '' "> and t.score_type = #{type} </if> group by trunc(t.tim/10000) </select>