Mybit錯誤,提示There is no getter for property named 'tid' in 'class java.lang.String'

改爲spa

<select id="queryStudentByNum" resultType="student" parameterType="string">  對象

select num,name,phone from student  
<where> 
<if test = " _parameter!=null and_parameter!='' ">
AND num = #{_parameter}
</if>
</where>
</select>
不管參數名,都要改爲"_parameter"。string

要加上parameterType="string"  而後把參數改爲_parametertest

緣由分析List

Mybatis默認採用ONGL解析參數,因此會自動採用對象樹的形式取string.num值,引發報錯。也能夠public List methodName(@Param(value="num") String num)的方法說明參數值select

相關文章
相關標籤/搜索