I. Discovering problems
<!--standard material stock inquiry--><select id= "Selectbzwzkucun" resulttype= "Com.labway.portal.po.X_bzwz_kucun" param Etertyp E= "String" >select bzwzname, SUM (buynumber) as Stocknumber from X_bzwz_ruku Group by Bzwzname <if test= "Name!=null an D name!= "> have bzwzname like '% ' | | #{name}| | ' % ' </if> </select>mybatis query passed in a string pass argument, reported there is no getter for property named ' Num ' in ' Class java.lang.String ' 。 Second, solve the problem
<!--standard material stock enquiry-
<select id= "Selectbzwzkucun" resulttype= "Com.labway.portal.po.X_bzwz_kucun" parametertype= "String" >
Select Bzwzname, sum (buynumber) as Stocknumber from X_bzwz_ruku Group by Bzwzname
<if test= "name_parameter!=null and name_parameter! =" "> have bzwzname like '% ' | | #{name_parameter}| | ' % ' </if>
</select>
Regardless of the parameter name, change to "_parameter".
Three. cause Analysis
MyBatis by default with ONGL parsing parameters, so the object tree will automatically take the form of string.name values, causing error. The public List methodName (@Param (value= "name") String name can also be used to describe the parameter value
This article is from the "Big Talk Program" blog, please be sure to keep this source http://houqida.blog.51cto.com/8877896/1582274
MyBatis Package There is no getter for property named ' XXX ' in ' Class java.lang.String '