ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
![](https://img.kancloud.cn/39/2f/392f9382fd927103fc73a8b60615b4de_1702x178.jpg) **1. 创建实体类** ```java @Data @AllArgsConstructor public class Student { @ExcelProperty("姓名") private String name; @ExcelProperty("年龄") private Integer age; @ExcelProperty("性别") private String gender; /** 忽略total数据 */ @ExcelIgnore private Integer total; } ``` **2. 数据写入表格** ```java @Test public void write01() { List<Student> dataList = Lists.newArrayList(); Student student01 = new Student("张三", 25, "男", 175); Student student02 = new Student("李四", 29, "男", 178); dataList.add(student01); dataList.add(student02); String path = "e:/upload/easyexcel/001.xlsx"; EasyExcel.write(path, Student.class).sheet("Sheet1").doWrite(dataList); } ```