1.Spring-mybatis-XML方式的入门
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user