<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                **數據量大超過5W,還在100W以內的數據導出處理** >[info] 1.3.8+ 支持 [TOC] ## 方法介紹 1.注解方式 ~~~ ExcelExportUtil.exportBigExcel(ExportParams entity, Class<?> pojoClass,IExcelExportServer server, Object queryParams) ~~~ 2.自定義方式 ~~~ ExcelExportUtil.exportBigExcel(ExportParams entity, List<ExcelExportEntity> excelParams,IExcelExportServer server, Object queryParams) ~~~ ## 傳參介紹 | 參數 | 含義| |------|------| | ExportParams entity | 導出參數屬性,例如表格標題、名稱等等 | | Class<?> pojoClass | Excel對象Class(注解方式) | | List<ExcelExportEntity> excelParams | 導出工具類集合,對cell做處理(自定義) | | IExcelExportServer server | 查詢數據的接口 | |Object queryParams | 查詢數據的參數 | ## 使用示例(注解) ~~~ import org.apache.poi.ss.usermodel.Workbook; import org.jeecgframework.poi.excel.ExcelExportUtil; import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.handler.inter.IExcelExportServer; import org.junit.Test; import java.io.File; import java.io.FileOutputStream; import java.util.ArrayList; import java.util.Date; import java.util.List; public class ExcelExportBigData { @Test public void bigDataExport() throws Exception { Workbook workbook = null; Date start = new Date(); //設置表格標題 ExportParams params = new ExportParams("大數據測試","測試"); /** * params:(表格標題屬性)篩選條件,sheet值 * TestEntity:表格的實體類 * IExcelExportServer:查詢數據接口 */ workbook = ExcelExportUtil.exportBigExcel(params, TestEntity.class, new IExcelExportServer() { /** * obj 就是下面的10,限制條件 * page 是頁數,他是在分頁進行文件轉換,page每次+1 */ @Override public List<Object> selectListForExcelExport(Object obj, int page) { //page每次加一,當等于obj的值時返回空,代碼結束; //特別注意,最好每次10000條,否則,可能有內存溢出風險 if (((int) obj) == page) { return null; } //不是空時:一直循環運行selectListForExcelExport。每次返回1萬條數據。 List<Object> list = new ArrayList<Object>(); for (int i = 0; i < 10000; i++) { TestEntity client = new TestEntity(); client.setName("小明" + i); client.setAge(i); list.add(client); } return list; } }, 10); System.out.println(new Date().getTime() - start.getTime()); File savefile = new File("D:/excel/"); if (!savefile.exists()) { savefile.mkdirs(); } FileOutputStream fos = new FileOutputStream("D:/excel/bigDataExport.xlsx"); workbook.write(fos); fos.close(); } } ~~~ TestEntity : ~~~ import org.jeecgframework.poi.excel.annotation.Excel; public class TestEntity implements java.io.Serializable { @Excel(name = "姓名", width = 15) private String name; @Excel(name = "年齡", width = 15) private Integer age; public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } } ~~~ ## 導出效果 ![](https://img.kancloud.cn/0c/e8/0ce833ba4b865de820d0c7bb39afcb67_288x837.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看