话不多说上代码

Dao层

	/**
	 * 查看宿舍评比的圆图
	 * @param map 传入的参数有学校id 时间范围
	 * @return
	 */
	public List<String> getEChartsMap(Map map);

mapper.xml

	<select id="getEChartsMap"   parameterType="Map" resultType="string">
        SELECT
            dormitory_rating.score
        FROM
            `dormitory_rating`
        <where>
            <if test="_parameter.containsKey('schoolNo')">
                and school_no = #{schoolNo,jdbcType=VARCHAR}
            </if>
            <if test="_parameter.containsKey('beginTime')">
                and create_time &gt;= #{beginTime,jdbcType=VARCHAR}
            </if>
            <if test="_parameter.containsKey('endTime')">
                and create_time &lt;= #{endTime,jdbcType=VARCHAR}
            </if>
        </where>
        ORDER BY score ASC
    </select>