BUG 解決記錄 一

b10l07發表於2017-05-10
攀登谷底

1. ITEM ONE

** 報錯關鍵資訊 **

2017-05-10 23:23:49.704 ERROR 6491 --- [0.1-8088-exec-7] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.lang.Integer] with root cause

java.lang.IllegalArgumentException: Result Maps collection does not contain value for java.lang.Integer
Mapper 中的 SQL 語句如下:
 <select id="getStatisticDataSucessNum" resultMap="java.lang.Integer" parameterType="java.util.Map">
        SELECT COUNT(*)
        from t_order_sms
        WHERE result_code = 2000
        <if test="chId != null">
            and ch_id = #{chId ,jdbcType=VARCHAR}
        </if>
    </select>

** 問題所在 : ** resultMap ——> resultType

** 更改後程式碼 :**

 <select id="getStatisticDataSucessNum" resultType="java.lang.Integer" parameterType="java.util.Map">
        SELECT COUNT(*)
        from t_order_sms
        WHERE result_code = 2000
        <if test="chId != null">
            and ch_id = #{chId ,jdbcType=VARCHAR}
        </if>
    </select>

2. ITEM TWO

** 報錯資訊**

Ambiguous mapping. Cannot map ‘’********‘’

** 報錯原因 **
多個 cotroller 中不能 同時對映一個 @RequestMapping("url") 中的 url

3. ITEM THREE

** 報錯資訊**

request method 'post' not supported

** 報錯原因 **
前端的 url 在後臺無對應的 controller
前端對映的 Url 在 Controller 中沒有下沒有相應的方法與之對應,更改 URL 使前端和後臺業務的相同

相關文章