First, the problem found
<select id= "Querystudentbynum" resulttype= "Student" parametertype= "string" >
Select Num,name,phone from Student
<where>
<if test = "Num!=null and num!=" >
and num = #{num}
</if>
</where>
</select>
The MyBatis query passes in a string-pass parameter, and is reported to there is no getters for the property named ' Num ' in ' Class java.lang.String '.
Second, solve the problem
<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>
Regardless of the parameter name, change to "_parameter".
Third, the reason analysis
MyBatis by default with ONGL parsing parameters, so the object tree will automatically take the form of string.num values, causing error. The public List methodName (@Param (value= "num") String num can also be used to describe the parameter values
MyBatis Package There is no getter for property named ' XXX ' in ' Class java.lang.String '