try {
//SUser user= mapper.find(username.toLowerCase());
//user.setUR_XM(ur_truename_value);
user.setUR_XM("===================");
mapper.update(user);//这样不能更新
//ibatisUtils.getSession().update("com.project.mybaits.SUserMapper.update", user);//这样可以更新
ibatisUtils.commitSession();
return true;
} catch (Exception e) {
e.printStackTrace();
} finally {
ibatisUtils.closeSession();
}
return false;
<update id="update" parameterType="SUser">
update S_USER
<trim prefix="SET" suffixOverrides=",">
<if test="UR_BM != null">UR_BM = #{UR_BM},</if>
<if test="UR_XM != null">UR_XM = #{UR_XM},</if>
<if test="UR_DZ != null">UR_DZ = #{UR_DZ},</if>
<if test="UR_DH != null">UR_DH = #{UR_DH},</if>
<if test="UR_MM != null">UR_MM = #{UR_MM},</if>
<if test="UR_QX != null">UR_QX = #{UR_QX},</if>
<if test="UR_CJYH != null">UR_CJYH = #{UR_CJYH},</if>
<if test="UR_MMZHSJ != null">UR_MMZHSJ = #{UR_MMZHSJ},</if>
<if test="UR_BZ != null">UR_BZ = #{UR_BZ},</if>
</trim>
where UR_MC = #{UR_MC}
</update>
我使用mapper查询是可以,update却不可以, 求高手解答...