1.Spring-mybatis-XML方式的入门

This commit is contained in:
2025-09-26 13:53:33 +08:00
parent be745c3d1a
commit f6d39acad2
5 changed files with 68 additions and 5 deletions

View File

@@ -8,6 +8,7 @@ import org.springframework.boot.test.context.SpringBootTest;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
@SpringBootTest
class SpringbootMybatisCrudApplicationTests {
@@ -56,4 +57,18 @@ class SpringbootMybatisCrudApplicationTests {
emp.setUpdateTime(LocalDateTime.now());
empMapper.update(emp);
}
@Test
void testSelectById(){
Emp emp = empMapper.selectById(14);
System.out.println(emp);
}
//条件查询测试
@Test
void testList(){
List<Emp> list = empMapper.list("", (short) 1, LocalDate.of(2010, 1, 1), LocalDate.of(2020, 1, 1));
System.out.println(list);
}
}