mybatis delete
//insert一个用户
int deleteUser(User user);
<delete id="deleteUser" parameterType="int">
delete from mybatis.mybatis where password = #{password};
</delete>
@Test
public void deleteUser(){
SqlSession sqlSession = MybatisUtils.getSqlSession();
UserDao mapper = sqlSession.getMapper(UserDao.class);
int res = mapper.addUser(new User("王二狗","111"));
if(res>0){
System.out.println("插入成功");
}
//提交事务
sqlSession.commit();
sqlSession.close();
}