0
点赞
收藏
分享

微信扫一扫

Mapper method ‘com.dao.xxxx‘ has an unsupported return type

出现此异常是因为返回的数据类型不对应
错误示范

dao层代码片

public List<student> insertgradesex(student stu);

对应的Mapper代码片

<select id="insertgradesex">
        select * from
            stuinfo
            where 1=1
            <if test="sex!=null and sex!=''">
                and sex = #{sex}
            </if>
            <if test="grade!=null and grade!=''">
                and grade = #{grade}
            </if>
    </select>

更正

 <select id="insertgradesex" parameterType="student" resultType="student">
        select * from
            stuinfo
            where 1=1
            <if test="sex!=null and sex!=''">
                and sex = #{sex}
            </if>
            <if test="grade!=null and grade!=''">
                and grade = #{grade}
            </if>
    </select>

异常解决

举报

相关推荐

0 条评论