分析:
那么什么情况下会发生“There is no getter for property named in ‘class java.lang.String’”错误呢?
其实是在这种情况下:
<select id="getRiskMember" resultMap="BaseResultMap" parameterType="String">
<include refid="selectMember"/>
and safetylevel > 1
and stauts = 1
<if test="username != null">
and username = #{username}
</if>
</select>
注意看,是在if test=验证的时候发生的 “There is no getter for property named in ‘class java.lang.String’”,
而并非是and username = #{username} 的时候发生的错误。
解决办法:
<select id="getRiskMember" resultMap="BaseResultMap" parameterType="String">
<include refid="selectMember"/>
and safetylevel > 1
and stauts = 1
<if test="_parameter != null">
and username = #{username}
</if>
</select>