v_Cloud 2017-10-27 09:13 采纳率: 50%
浏览 2052
已采纳

mybatis调用mysql存储过程,得到null,求帮助

Dao层

 int instertUserWeight(@Param("_uid") Integer uid,@Param("_gid") Integer gid,@Param("_count") Long count,@Param("_result") Integer result);

Mapping层

<select id="instertUserWeight" parameterType="map" statementType="CALLABLE" resultMap="BaseResultMap">
    {CALL proc_BetWeightSave(
      #{_uid,mode=IN,jdbcType=INTEGER},
      #{_gid,mode=IN,jdbcType=INTEGER},
      #{_count,mode=IN,jdbcType=BIGINT},
      #{_result,mode=OUT,jdbcType=INTEGER}
    )}
  </select>

存储过程
图片说明
运行结果是2
可是我用mybatis调用的时候拿到的是null
attempted to return null from a method with a primitive return type (int).

** 求帮助**

  • 写回答

2条回答 默认 最新

  • v_Cloud 2017-10-30 02:42
    关注

    这个问题是由resultmap造成的,应该改成resulttype
    ,好吧还是自己解决了

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?