乐于分享
好东西不私藏

Java导入、导出excel保姆级教程(附封装好的工具类)

Java导入、导出excel保姆级教程(附封装好的工具类)
👇推荐大家关注一个公众号👇
点击上方 "编程技术圈"关注, 星标或置顶一起成长
后台回复“大礼包”有惊喜礼包!

日英文

What is adhere to? Is day, and one day, you tell yourself, insist again one day.

什么是坚持?就是一天,又一天,你告诉自己,再坚持一天。

每日掏心话

不要沉迷过去,不要害怕未来,过去。得失也好,成败也罢,无论快乐,还是痛苦,都过去了,你只能回忆,而无法回去。

责编:乐乐 | 来自:是江迪呀

链接:https://blog.csdn.net/qq_42785250/article/details/129654178

编程技术圈(ID:study_tech)第 1953 期推文

往日回顾:小红书崩了,开除谁?

      正文     

大家好,我是小乐。

前言

我们在日常开发中,一定遇到过要将数据导出为Excel的需求,那么怎么做呢?在做之前,我们需要思考下Excel的组成。Excel是由四个元素组成的分别是:WorkBook(工作簿)、Sheet(工作表)、Row(行)、Cell(单元格),其中包含关系是从左至右,一个WorkBook可以包含多个Sheet,一个Sheet又是由多个Row组成,一个Row是由多个Cell组成。知道这些后那么我们就使用java来将数据以Excel的方式导出。让我们一起来学习吧!

一、引入Apache POI依赖

使用Java实现将数据以Excel的方式导出,需要依赖第三方的库。我们需要再pom.xml中引入下面的依赖:

<dependency><groupId>org.apache.poi</groupId><artifactId>poi</artifactId><version>4.1.2</version></dependency><dependency><groupId>org.apache.poi</groupId><artifactId>poi-ooxml</artifactId><version>4.1.2</version></dependency>

二、用法&步骤

2.1 创建Excel的元素

1)创建WokrBook

Workbook workbook = new XSSFWorkbook();

2)创建Sheet

 Sheet sheet = workbook.createSheet();

设置sheet的名称

 Sheet sheet = workbook.createSheet("sheet名称");

3)创建行Row

Row row = sheet.createRow(0);

4)创建单元格Cell

Cell cell = row.createCell(0, CellType.STRING);

可以指定单元格的类型,支持的类型有下面7种:

_NONE(-1),NUMERIC(0),STRING(1),//公式FORMULA(2),BLANK(3),//布尔BOOLEAN(4),ERROR(5);

5) 填充数据

 cell.setCellValue("苹果");

2.3 样式和字体

如果我们需要导出的Excel美观一些,如设置字体的样式加粗、颜色、大小等等,就需要创建样式和字体。

创建样式:

CellStyle cellStyle = workbook.createCellStyle();

1)左右垂直居中

//左右居中excelTitleStyle.setAlignment(HorizontalAlignment.CENTER);// 设置垂直居中excelTitleStyle.setVerticalAlignment(VerticalAlignment.CENTER);

2)字体加粗、颜色

创建加粗样式并设置到CellStyle 中:

Font font = workbook.createFont();//字体颜色为红色font.setColor(IndexedColors.RED.getIndex());//字体加粗font.setBold(true);cellStyle.setFont(font);

指定Cell单元格使用该样式:

cell.setCellStyle(style);

3)调整列宽和高

Sheet sheet = workbook.createSheet();//自动调整列的宽度来适应内容sheet.autoSizeColumn(int column); // 设置列的宽度sheet.setColumnWidth(220 * 256); 

autoSizeColumn()传递的参数就是要设置的列索引。setColumnWidth()第一个参数是要设置的列索引,第二参数是具体的宽度值,宽度 = 字符个数 * 256(例如20个字符的宽度就是20 * 256

4)倾斜、下划线

Font font = workbook.createFont();font.setItalic(boolean italic); 设置倾斜font.setUnderline(byte underline); 设置下划线

2.4 进阶用法

1)合并单元格

Workbook workbook = new XSSFWorkbook();Sheet sheet = workbook.createSheet(fileName);sheet.addMergedRegion(new CellRangeAddress(0005));

CellRangeAddress()方法四个参数分别是fristRow:起始行、lastRow:结束行、fristCol:起始列、lastCol:结束列。

如果你想合并从第一行到第二行从一列到第十列的单元格(一共合并20格),那么就是CellRangeAddress(0,1,0,10)

2)字段必填

//创建数据验证DataValidationHelper dvHelper = sheet.getDataValidationHelper();//创建要添加校验的单元格对象CellRangeAddressList addressList = new CellRangeAddressList(00010);//创建必填校验规则DataValidationConstraint constraint = validationHelper.createCustomConstraint("NOT(ISBLANK(A1))");//设置校验DataValidation validation = dvHelper.createValidation(constraint, addressList);//校验不通过 提示validation.setShowErrorBox(true);sheet.addValidationData(validation);

CellRangeAddressList()方法传递四个参数,分别是:fristRow:起始行、lastRow:结束行、fristCol:起始列、lastCol:结束列。CellRangeAddressList(0, 0, 0, 10)表示的就是给第一行从第一列开始到第十列一共十个单元格添加数据校验。

3)添加公式

SUM:求和函数

//创建SUM公式FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();Cell sumCell = row.createCell(0);sumCell.setCellFormula("SUM(A1:A10)");//计算SUM公式结果Cell sumResultCell = row.createCell(1);sumResultCell.setCellValue(evaluator.evaluate(sumCell).getNumberValue());

AVERAGE:平均数函数。另外,搜索公众号Linux就该这样学后台回复“猴子”,获取一份惊喜礼包。

//创建AVERAGE公式FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();Cell averageCell = row.createCell(0);averageCell.setCellFormula("AVERAGE(A1:A10)");//计算AVERAGE公式结果Cell averageResultCell = row.createCell(1);averageResultCell.setCellValue(evaluator.evaluate(averageCell).getNumberValue());

COUNT:计数函数

//创建COUNT公式FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();Cell countCell = row.createCell(0);countCell.setCellFormula("COUNT(A1:A10)");//计算COUNT公式结果Cell countResultCell = row.createCell(1);countResultCell.setCellValue(evaluator.evaluate(countCell).getNumberValue());

IF:条件函数

//创建IF公式FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();Cell ifCell = row.createCell(0);ifCell.setCellFormula("IF(A1>B1,\"Yes\",\"No\")");//计算IF公式结果Cell ifResultCell = row.createCell(1);ifResultCell.setCellValue(evaluator.evaluate(ifCell).getStringValue());

CONCATENATE:连接函数

//创建CONCATENATE公式FormulaEvaluator evaluator = workbook.getCreationHelper().createFormulaEvaluator();Cell concatenateCell = row.createCell(0);concatenateCell.setCellFormula("CONCATENATE(A1,\" \",B1)");//计算CONCATENATE公式结果Cell concatenateResultCell = row.createCell(1);concatenateResultCell.setCellValue(evaluator.evaluate(concatenateCell).getStringValue());

4)下拉选择

//下拉值private List<String> grade = Arrays.asList("高""中""低");(此处省略n行代码)Sheet sheet = workbook.createSheet("sheet");DataValidation dataValidation = this.addPullDownConstraint(i, sheet, grade );sheet.addValidationData(dataValidation);

5)设置单元格的数据类型

数字格式

// 设置单元格样式 - 数字格式CellStyle numberCellStyle = workbook.createCellStyle();numberCellStyle.setDataFormat(workbook.createDataFormat().getFormat("#,##0.00"));//指定单元格Row row = sheet.createRow(0);Cell cell = row.createCell(0);cell.setCellStyle(numberCellStyle);

日期格式

// 设置单元格样式 - 日期格式CellStyle dateCellStyle = workbook.createCellStyle();dateCellStyle.setDataFormat(workbook.createDataFormat().getFormat("yyyy-MM-dd"));//指定单元格Row row = sheet.createRow(0);Cell cell = row.createCell(0);cell.setCellStyle(dateCellStyle);

三、导出完整示例

下面的示例使用SpringBoot项目来演示:

pom.xml依赖:

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><version>2.7.5</version></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter</artifactId><version>2.7.5</version></dependency><dependency><groupId>org.apache.poi</groupId><artifactId>poi</artifactId><version>4.1.2</version></dependency><!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml --><dependency><groupId>org.apache.poi</groupId><artifactId>poi-ooxml</artifactId><version>4.1.2</version></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>1.16.16</version></dependency><!-- https://mvnrepository.com/artifact/com.alibaba.fastjson2/fastjson2 --><dependency><groupId>com.alibaba</groupId><artifactId>fastjson</artifactId><version>2.0.21</version></dependency><dependency><groupId>org.apache.commons</groupId><artifactId>commons-lang3</artifactId><version>3.12.0</version></dependency>

Controller层代码:

package shijiangdiya.controller;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.web.bind.annotation.PostMapping;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;import shijiangdiya.utils.ExportUtils;import javax.servlet.http.HttpServletResponse;@RestController@RequestMapping("/sync")publicclassExportController{}

1)代码

@Autowiredprivate HttpServletResponse response;@PostMapping("/export")publicvoidexport(){//模拟json数据    String data = "[{\n" +"    \"studentId\": \"20210101\",\n" +"    \"name\": \"Alice\",\n" +"    \"age\": 20,\n" +"    \"credit\": 80\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210102\",\n" +"    \"name\": \"Bob\",\n" +"    \"age\": 21,\n" +"    \"credit\": 85\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210103\",\n" +"    \"name\": \"Charlie\",\n" +"    \"age\": 22,\n" +"    \"credit\": 90\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210104\",\n" +"    \"name\": \"David\",\n" +"    \"age\": 20,\n" +"    \"credit\": 75\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210105\",\n" +"    \"name\": \"Emily\",\n" +"    \"age\": 21,\n" +"    \"credit\": 82\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210106\",\n" +"    \"name\": \"Frank\",\n" +"    \"age\": 22,\n" +"    \"credit\": 88\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210107\",\n" +"    \"name\": \"Grace\",\n" +"    \"age\": 20,\n" +"    \"credit\": 81\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210108\",\n" +"    \"name\": \"Henry\",\n" +"    \"age\": 21,\n" +"    \"credit\": 89\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210109\",\n" +"    \"name\": \"Isaac\",\n" +"    \"age\": 22,\n" +"    \"credit\": 92\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210110\",\n" +"    \"name\": \"John\",\n" +"    \"age\": 20,\n" +"    \"credit\": 78\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210111\",\n" +"    \"name\": \"Kelly\",\n" +"    \"age\": 21,\n" +"    \"credit\": 84\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210112\",\n" +"    \"name\": \"Linda\",\n" +"    \"age\": 22,\n" +"    \"credit\": 87\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210113\",\n" +"    \"name\": \"Mike\",\n" +"    \"age\": 20,\n" +"    \"credit\": 77\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210114\",\n" +"    \"name\": \"Nancy\",\n" +"    \"age\": 21,\n" +"    \"credit\": 83\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210115\",\n" +"    \"name\": \"Oscar\",\n" +"    \"age\": 22,\n" +"    \"credit\": 91\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210116\",\n" +"    \"name\": \"Paul\",\n" +"    \"age\": 20,\n" +"    \"credit\": 76\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210117\",\n" +"    \"name\": \"Queen\",\n" +"    \"age\": 21,\n" +"    \"credit\": 86\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210118\",\n" +"    \"name\": \"Rachel\",\n" +"    \"age\": 22,\n" +"    \"credit\": 94\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210119\",\n" +"    \"name\": \"Sarah\",\n" +"    \"age\": 20,\n" +"    \"credit\": 79\n" +"  },\n" +"  {\n" +"    \"studentId\": \"20210120\",\n" +"    \"name\": \"Tom\",\n" +"    \"age\": 21,\n" +"    \"credit\": 80\n" +"  }\n" +"]\n";    ExportUtils.exportExcel("学生信息", data, Student.classresponse);}

2)工具类

牛逼啊!接私活必备的 N 个开源项目!赶快收藏

/** * 数据导出 * @param fileName 导出excel名称 * @param data 导出的数据 * @param c 导出数据的实体class * @param response 响应 * @throws Exception */publicstaticvoidexportExcel(String fileName, String data, Class<?> c, HttpServletResponse response)throws Exception {try {// 创建表头// 创建工作薄        Workbook workbook = new XSSFWorkbook();        Sheet sheet = workbook.createSheet();// 创建表头行        Row rowHeader = sheet.createRow(0);if (c == null) {thrownew RuntimeException("Class对象不能为空!");        }        Field[] declaredFields = c.getDeclaredFields();        List<String> headerList = new ArrayList<>();if (declaredFields.length == 0) {return;        }for (int i = 0; i < declaredFields.length; i++) {            Cell cell = rowHeader.createCell(i, CellType.STRING);            String headerName = String.valueOf(declaredFields[i].getName());            cell.setCellValue(headerName);            headerList.add(i, headerName);        }// 填充数据        List<?> objects = JSONObject.parseArray(data, c);        Object obj = c.newInstance();if (!CollectionUtils.isEmpty(objects)) {for (int o = 0; o < objects.size(); o++) {                Row rowData = sheet.createRow(o + 1);for (int i = 0; i < headerList.size(); i++) {                    Cell cell = rowData.createCell(i);                    Field nameField = c.getDeclaredField(headerList.get(i));                    nameField.setAccessible(true);                    String value = String.valueOf(nameField.get(objects.get(o)));                    cell.setCellValue(value);                }            }        }        response.setContentType("application/vnd.ms-excel");        String resultFileName = URLEncoder.encode(fileName, "UTF-8");        response.setHeader("Content-disposition""attachment;filename=" + resultFileName + ";" + "filename*=utf-8''" + resultFileName);        workbook.write(response.getOutputStream());        workbook.close();        response.flushBuffer();    } catch (Exception e) {thrownew RuntimeException(e);    }}

3)结果

四、导入完整示例

1)代码

@PostMapping("/import")publicvoidimportExcel(@RequestParam("excel") MultipartFile excel){    Workbook workbook = null;try {        workbook = WorkbookFactory.create(excel.getInputStream());        Sheet sheet = workbook.getSheetAt(0);        List<Student> students = new ArrayList<>();int i = 0;for (Row row : sheet) {            Row row1 = sheet.getRow(i + 1);if(row1 != null){                Student data = new Student();                data.setStudentId(Integer.parseInt(row1.getCell(0).getStringCellValue()));                data.setName(row1.getCell(1).getStringCellValue());                data.setAge(Integer.parseInt(row1.getCell(2).getStringCellValue()));                data.setCredit(Integer.parseInt(row1.getCell(3).getStringCellValue()));                students.add(data);            }        }        System.out.println(students);        workbook.close();    } catch (IOException e) {thrownew RuntimeException(e);    }

2)工具类

/**     * 导入     * @param workbook 工作簿     * @param c 实体类     * @return 实体类集合     */publicstatic <T> List<T> importExcel(Workbook workbook,Class<?> c){        List<T> dataList = new ArrayList<>();try {            Sheet sheet = workbook.getSheetAt(0);int i = 0;            T o = null;for (Row row : sheet) {                Row row1 = sheet.getRow(i + 1);if(row1 != null){                    o = (T) c.newInstance();                    Field[] declaredFields = c.getDeclaredFields();for (int i1 = 0; i1 < declaredFields.length; i1++) {                        String name = declaredFields[i1].getName();                        Field declaredField1 = o.getClass().getDeclaredField(name);                        declaredField1.setAccessible(true);                        Cell cell = row1.getCell(i1);                        String type = declaredFields[i1].getType().getName();                        String value = String.valueOf(cell);if(StringUtils.equals(type,"int") || StringUtils.equals(type,"Integer")){                            declaredField1.set(o,Integer.parseInt(value));                        } elseif(StringUtils.equals(type,"java.lang.String") || StringUtils.equals(type,"char") || StringUtils.equals(type,"Character") ||                                StringUtils.equals(type,"byte") || StringUtils.equals(type,"Byte")){                            declaredField1.set(o,value);                        } elseif(StringUtils.equals(type,"boolean") || StringUtils.equals(type,"Boolean")){                            declaredField1.set(o,Boolean.valueOf(value));                        } elseif(StringUtils.equals(type,"double") || StringUtils.equals(type,"Double")){                            declaredField1.set(o,Double.valueOf(value));                        } elseif (StringUtils.equals(type,"long") || StringUtils.equals(type,"Long")) {                            declaredField1.set(o,Long.valueOf(value));                        } elseif(StringUtils.equals(type,"short") || StringUtils.equals(type,"Short")){                            declaredField1.set(o,Short.valueOf(value));                        } elseif(StringUtils.equals(type,"float") || StringUtils.equals(type,"Float")){                            declaredField1.set(o,Float.valueOf(value));                        }                    }                }                dataList.add(o);            }            workbook.close();return dataList;        }catch (Exception e){            e.printStackTrace();        }return dataList;    }

注意:导入工具类仅限Java的八大基础数据类型和String类型。如果还有其他类型需要自己扩展。

3)结果

学生信息集合:

为了跟上AI时代我干了一件事儿,我创建了一个知识星球社群:ChartGPT与副业。想带着大家一起探索ChatGPT和新的AI时代。

很多小伙伴搞不定ChatGPT账号,于是我们决定,凡是这三天之内加入ChatPGT的小伙伴,我们直接送一个正常可用的永久ChatGPT独立账户。

不光是增长速度最快,我们的星球品质也绝对经得起考验,短短一个月时间,我们的课程团队发布了8个专栏、18个副业项目

简单说下这个星球能给大家提供什么:

1、不断分享如何使用ChatGPT来完成各种任务,让你更高效地使用ChatGPT,以及副业思考、变现思路、创业案例、落地案例分享。

2、分享ChatGPT的使用方法、最新资讯、商业价值。

3、探讨未来关于ChatGPT的机遇,共同成长。

4、帮助大家解决ChatGPT遇到的问题。

5、提供一整年的售后服务,一起搞副业

星球福利:

1、加入星球4天后,就送ChatGPT独立账号。

2、邀请你加入ChatGPT会员交流群。

3、赠送一份完整的ChatGPT手册和66个ChatGPT副业赚钱手册。

其它福利还在筹划中...不过,我给你大家保证,加入星球后,收获的价值会远远大于今天加入的门票费用 !

本星球第一期原价399,目前属于试运营,早鸟价139,每超过50人涨价10元,星球马上要来一波大的涨价,如果你还在犹豫,可能最后就要以更高价格加入了。。

早就是优势。建议大家尽早以便宜的价格加入!

欢迎有需要的同学试试,如果本文对您有帮助,也请帮忙点个 赞 + 在看 啦!❤️
你还有什么想要补充的吗?

PS:欢迎在留言区留下你的观点,一起讨论提高。如果今天的文章让你有新的启发,欢迎转发分享给更多人。

版权申明:内容来源网络,版权归原创者所有。除非无法确认,我们都会标明作者及出处,如有侵权烦请告知,我们会立即删除并表示歉意。谢谢!

欢迎加入后端架构师交流群,在后台回复“学习”即可。

最近面试BAT,整理一份面试资料《Java面试BAT通关手册》,覆盖了Java核心技术、JVM、Java并发、SSM、微服务、数据库、数据结构等等。在这里,我为大家准备了一份2021年最新最全BAT等大厂Java面试经验总结。

别找了,想获取史上最简单的Java大厂面试题学习资料

扫下方二维码回复面试就好了

猜你还想看

阿里、腾讯、百度、华为、京东最新面试题汇集

看看人家那权限管理系统,那叫一个优雅(附源码)!

牛逼啊!接私活必备的 400 个开源项目!赶快收藏吧(附源码合集)!

分享一个基于 Vue3.x 的数据可视化大屏项目

C盘 真的一下子就不红了!微软官方工具就能解决!

这是我见过最好的支付系统!

Oracle 再严查 Java 许可,网友:公司已卸载 Java,重新招聘程序员开发新系统!

Java 大后端各种架构图汇总

第一天上班看到这段注释就想辞职

重磅!ChatGPT 终于正式登陆安卓平台!

集资产管理系统+监控系统+顺序多主机自愈系统为一体的运维管理故障自愈系统!

弃用 Nginx 后,成了最受欢迎 Web 服务器!来看看它有多牛逼。。。

还在用 Navicat?阿里又开源了一款数据库神器,太炸裂了!

“穿丝袜等我”技术群出现不雅信息!建群单位称病毒入侵并已报警!

被 GPT 4.0 Plus 价格劝退了!

,你在看吗?

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-05-03 02:45:13 HTTP/1.1 GET : https://www.yeyulingfeng.com/a/574120.html
  2. 运行时间 : 0.095121s [ 吞吐率:10.51req/s ] 内存消耗:4,696.30kb 文件加载:145
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=187b86acfa3ad1baf1f17efac59a4390
  1. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/autoload_static.php ( 6.05 KB )
  7. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/ralouphie/getallheaders/src/getallheaders.php ( 1.60 KB )
  10. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  11. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  12. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  13. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  14. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  15. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  16. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  17. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  18. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  19. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/guzzlehttp/guzzle/src/functions_include.php ( 0.16 KB )
  21. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/guzzlehttp/guzzle/src/functions.php ( 5.54 KB )
  22. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  23. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  24. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  25. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/provider.php ( 0.19 KB )
  26. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  27. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  28. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  29. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/common.php ( 0.03 KB )
  30. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  32. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/alipay.php ( 3.59 KB )
  33. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  34. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/app.php ( 0.95 KB )
  35. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/cache.php ( 0.78 KB )
  36. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/console.php ( 0.23 KB )
  37. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/cookie.php ( 0.56 KB )
  38. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/database.php ( 2.48 KB )
  39. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/filesystem.php ( 0.61 KB )
  40. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/lang.php ( 0.91 KB )
  41. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/log.php ( 1.35 KB )
  42. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/middleware.php ( 0.19 KB )
  43. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/route.php ( 1.89 KB )
  44. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/session.php ( 0.57 KB )
  45. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/trace.php ( 0.34 KB )
  46. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/view.php ( 0.82 KB )
  47. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/event.php ( 0.25 KB )
  48. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  49. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/service.php ( 0.13 KB )
  50. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/AppService.php ( 0.26 KB )
  51. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  52. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  53. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  54. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  55. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  56. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/services.php ( 0.14 KB )
  57. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  58. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  59. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  60. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  61. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  62. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  63. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  64. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  65. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  66. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  67. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  68. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  69. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  70. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  71. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  72. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  73. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  74. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  75. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  76. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  77. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  78. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  79. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  80. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  81. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  82. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  83. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  84. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  85. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  86. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  87. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/Request.php ( 0.09 KB )
  88. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  89. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/middleware.php ( 0.25 KB )
  90. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  91. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  92. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  93. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  94. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  95. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  96. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  97. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  98. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  99. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  100. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  101. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  102. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  103. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/route/app.php ( 3.94 KB )
  104. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  105. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  106. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/controller/Index.php ( 9.87 KB )
  108. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/BaseController.php ( 2.05 KB )
  109. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  110. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  111. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  112. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  113. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  114. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  115. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  116. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  117. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  118. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  119. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  120. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  121. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  122. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  123. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  124. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  125. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  126. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  127. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  128. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  129. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  130. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  131. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  132. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  133. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  134. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  135. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/controller/Es.php ( 3.30 KB )
  136. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  137. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  138. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  139. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  140. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  141. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  142. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  143. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  144. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/runtime/temp/c935550e3e8a3a4c27dd94e439343fdf.php ( 31.50 KB )
  145. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000719s ] mysql:host=127.0.0.1;port=3306;dbname=wenku;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000788s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000283s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000361s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000689s ]
  6. SELECT * FROM `set` [ RunTime:0.000240s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000743s ]
  8. SELECT * FROM `article` WHERE `id` = 574120 LIMIT 1 [ RunTime:0.000611s ]
  9. UPDATE `article` SET `lasttime` = 1777747513 WHERE `id` = 574120 [ RunTime:0.000749s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 64 LIMIT 1 [ RunTime:0.000925s ]
  11. SELECT * FROM `article` WHERE `id` < 574120 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000801s ]
  12. SELECT * FROM `article` WHERE `id` > 574120 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000512s ]
  13. SELECT * FROM `article` WHERE `id` < 574120 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.006333s ]
  14. SELECT * FROM `article` WHERE `id` < 574120 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.001750s ]
  15. SELECT * FROM `article` WHERE `id` < 574120 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.003220s ]
0.096810s