微服务 教程
1085个小节阅读:196k
目录
C语言快速入门
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
1=>B 2=>D
xxxxxxxxxx
// 根据id查询
@Test
public void testFindById() {
Student student = studentMapper.selectById(1);
System.out.println(student);
}
// 根据id批量查询
@Test
public void testFindBatch() {
//创建主键集合
List<Integer> ids = new ArrayList<>();
ids.add(1);
ids.add(2);
ids.add(3);
List<Student> students = studentMapper.selectBatchIds(ids);
students.forEach(System.out::println);
}
// 根据字段条件查询
@Test
public void testFindMap() {
Map<String,Object> map = new HashMap<>();
map.put("sname","baizhan");
map.put("gender","m");
//查询name为baizhan,gender为m的数据
List<Student> students = studentMapper.selectByMap(map);
students.forEach(System.out::println);
}
1. 在MyBatisPlus中,根据id查询方法为
A selectById()
B selectBatchIds()
C select()
D selectByMap()
2. 在MyBatisPlus中,根据id批量查询方法为
A selectById()
B selectBatchIds()
C select()
D selectByMap()
1=>A 2=>B