MyBatisPlus实现添加操作

@Test
public void addUser() {
    User user = new User();
    user.setName("leavescai7");
    user.setAge(26);
    user.setEmail("376650839@qq.com");

    int insert = userMapper.insert(user);
    System.out.println("insert:" + insert);
}

MyBatisPlus实现修改操作

 

@Test
public void updateUser() {
    User user = new User();
    user.setId(9001);
    user.setAge(126);

    int row= userMapper.updateById(user);
    System.out.println(row);
}

 

 

 

posted on 2020-11-19 14:37  LeavesCai7  阅读(111)  评论(0)    收藏  举报