💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
![](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); } ```