用”_parameter”代替当前参数
正确:
1 2 3 4 5 6 7 8 |
<select id="selectSubjectByPId" parameterType="java.lang.Integer" resultType="java.util.Map"> select subjectId,subjectName from ts_subject where subjectParentId= 0 <if test="_parameter != null"> and subjectId = #{_parameter,jdbcType=INTEGER} </if> </select> |
错误:
1 2 3 4 5 6 7 8 |
<select id="selectSubjectByPId" parameterType="java.lang.Integer" resultType="java.util.Map"> select subjectId,subjectName from ts_subject where subjectParentId= 0 <if test="subjectId != null"> and subjectId = #{subjectId,jdbcType=INTEGER} </if> </select> |
这时候就会出现异常.
1 |
There is no getter for property named 'subjectId' in 'class java.lang.Integer |