企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
~~~ @RunWith(SpringRunner.class) @SpringBootTest public class SpringbootMybatisApplicationTests { @Autowired private PersonMapper personMapper; @Test public void testInsert() { Person person = new Person(); person.setAge(11); person.setName("aa"); int i = personMapper.insertPerson(person); System.out.println(i); } @Test public void testInsertGetId() { Person person = new Person(); person.setAge(11); person.setName("aa"); int i = personMapper.insertPersonGetId(person); System.out.println(person.getId()); } @Test public void testGetOne() { Person person = personMapper.getPerson(1); System.out.println(person.toString()); } @Test public void testGetAll() { List<Person> persons = personMapper.getPersons(); System.out.println(persons.toString()); } @Test public void testUpdate() { Person person = new Person(); person.setId(1); person.setName("aaaaaaaa"); int i = personMapper.updatePersonById(person); System.out.println(i); } @Test public void testDel() { Person person = new Person(); person.setId(1); int i = personMapper.deletePerson(person); System.out.println(i); } @Test public void testParams() { List<Person> persons = personMapper.findByNameAndAge("aa", 11); System.out.println(persons); } } ~~~