在这里插入图片描述

Cause: java.lang.UnsupportedOperationException] with root cause java.lang.UnsupportedOperationException: null

mapper层接口

   List selectRolePredict(@Param("organId") String organId,@Param("businessId") String businessId);

mybatis.xml sql结构

 <select id="selectRolePredict" resultType="list">
            select  DISTINCT  next_approval_role from business_node_approval_role
            <where>
                organ_id=#{organId} and business_id=#{businessId} and !isnull(next_approval_role)
            </where>
    </select>

解决方法:把resultType=“java.util.List” 改为String

原因:
resultType返回的是集合中的元素类型,而不是集合本身

 <select id="selectRolePredict" resultType="string">
            select  DISTINCT  next_approval_role from business_node_approval_role
            <where>
                organ_id=#{organId} and business_id=#{businessId} and !isnull(next_approval_role)
            </where>
    </select>

修改之后重新启动项目再次测试接口
在这里插入图片描述
解决

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐