Mybatis Plus会自动setId不用做任何操作和转换
Student student = new Student(); student.setName("小明"); student.setAge(16); studentServiceImpl.save(student); System.out.println(student); // {id = 1, name = "小明", age = 16}
Student student = new Student(); student.setName("小明"); student.setAge(16); studentServiceImpl.save(student); System.out.println(student); // {id = 1, name = "小明", age = 16}