今天突然遇到这个问题
There is no getter for property named '' in 'class java.lang.String'
通过以下文章解决
There is no getter for property named 'moduleCode' in 'class java.lang.String
错误写法:
<select id="queryAllParentModule" resultType="jobModule" parameterType="jobModule">
select modulecode,
modulename,
modulevalue,
linkurl,
rank,
parentmodule=isnull(parentmodule,1),
moduledescription
from job_module
<where>
<choose>
<when test="moduleCode!=null and moduleCode!=''">modulecode = #{moduleCode}</when>
<when test="moduleCode==null or moduleCode==''">(parentmodule is null or len(parentmodule)<=0)</when>
</choose>
</where>
</select>
需要修改成:
<select id="queryModuleByCode" resultType="jobModule" parameterType="string">
select modulecode,
modulename,
modulevalue,
linkurl,
rank,
parentmodule=isnull(parentmodule,1),
moduledescription
from job_module
<where>
<choose>
<when test="_parameter!=null and _parameter!=''">modulecode = #{_parameter}</when>
<when test="_parameter==null or _parameter==''">(parentmodule is null or len(parentmodule)<=0)</when>
</choose>
</where>
</select>
不管你的参数是什么,都要改成"_parameter"