你检查检查你的每个字段后面是不是忘记加,号了!!!
这是我遇到之后修改正确的代码:
<!-- 7 modify -->
<update id="modify" parameterType="user">
update smbms_user
<set>
<if test="userCode != null">userCode = #{userCode},</if>
<if test="userName != null">userName = #{userName},</if>
<if test="userPassword != null">userPassword = #{userPassword},</if>
<if test="gender != null">gender = #{gender},</if>
<if test="birthday != null">birthday = #{birthday},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="address != null">address = #{address},</if>
<if test="userRole != null">userRole = #{userRole},</if>
<if test="createdBy != null">createdBy = #{createdBy},</if>
<if test="creationDate != null">creationDate = #{creationDate},</if>
<if test="modifyBy != null">modifyBy = #{modifyBy},</if>
<if test="modifyDate != null">modifyDate = #{modifyDate}</if>
</set>
where id = #{id}
</update>