修改密码——持久层

1.持久层

1.1规划sql语句
update t_user set password=? where uid = ?
1.2做映射
Integer UpdatePasswordByUid(String uid,String password);

 

 <update id="UpdatePasswordByUid">
      update t_user set password = #{password} where uid = ${uid}
</update>

 

1.3测试
@Test
   public void updatepassword()
  {
       Integer integer = userMapper.UpdatePasswordByUid(7, "6666");
       System.out.println(integer);
       User byUid = userMapper.findByUid(7);
       System.out.println(byUid);
  }

 

posted @ 2022-03-12 21:04  爽爽子的秃头生活  阅读(32)  评论(0)    收藏  举报