后台从Mariadb中读取学生列表(表名:student,包含字段:id,name,age,address)
使用 https://baomidou.com/pages/24112f/#%E7%89%B9%E6%80%A7
建好对应的实体类的和xml文件,一行代码就可以实现查询
List<Student> studentList = studentMapper.selectAll();
primary key 设为主键,唯一且非空即该字段不能重复且不能为空
auto_increment 给字段设为自增,只能给int类型字段设置,即新增数据时该字段如果为 null 则在新增的数据该字段为之前出现的最大数字加1,
not null 设为非空即该字段不能为空
create table teachar1(id int primary key auto_increment,name varchar(255) not null);