Browse Source

导入到excel

pull/1/head
马府强 2 years ago
parent
commit
b62540e50f
  1. 6
      ThreadExportExcelDataNew/ExportExcelData.iml
  2. 5
      ThreadExportExcelDataNew/pom.xml
  3. 23
      ThreadExportExcelDataNew/src/main/java/com/wm/file/config/DataSourceConfig.java
  4. 197
      ThreadExportExcelDataNew/src/main/java/com/wm/file/config/DataSourceProperties.java
  5. 53
      ThreadExportExcelDataNew/src/main/java/com/wm/file/config/DynamicDataSourceFactory.java
  6. 53
      ThreadExportExcelDataNew/src/main/java/com/wm/file/controller/FileController.java
  7. 68
      ThreadExportExcelDataNew/src/main/java/com/wm/file/listen/EasyExceGeneralDatalListener.java
  8. 3
      ThreadExportExcelDataNew/src/main/java/com/wm/file/service/UserService.java
  9. 59
      ThreadExportExcelDataNew/src/main/java/com/wm/file/service/impl/UserServiceImpl.java
  10. 57
      ThreadExportExcelDataNew/src/main/java/com/wm/file/util/easypoi/JDBCDruidUtils.java
  11. 39
      ThreadExportExcelDataNew/src/main/resources/application.yml
  12. 13
      ThreadExportExcelDataNew/target/classes/application.properties
  13. BIN
      ThreadExportExcelDataNew/target/classes/com/wm/file/ExportExcelDataApplication.class
  14. BIN
      ThreadExportExcelDataNew/target/classes/com/wm/file/FileController.class
  15. BIN
      ThreadExportExcelDataNew/target/classes/com/wm/file/config/AsyncTaskPoolConfig.class
  16. BIN
      ThreadExportExcelDataNew/target/classes/com/wm/file/config/NamedThreadFactory.class
  17. BIN
      ThreadExportExcelDataNew/target/classes/com/wm/file/entity/UserEntity.class
  18. BIN
      ThreadExportExcelDataNew/target/classes/com/wm/file/mapper/UserMapper.class
  19. BIN
      ThreadExportExcelDataNew/target/classes/com/wm/file/service/UserService.class
  20. BIN
      ThreadExportExcelDataNew/target/classes/com/wm/file/service/impl/UserServiceImpl.class
  21. BIN
      ThreadExportExcelDataNew/target/classes/com/wm/file/util/easypoi/ExcelStyleUtil.class
  22. BIN
      ThreadExportExcelDataNew/target/classes/com/wm/file/util/easypoi/MyExcelExportService.class
  23. 30
      ThreadExportExcelDataNew/target/classes/mapper/UserMapper.xml
  24. BIN
      ThreadExportExcelDataNew/target/test-classes/com/wm/file/TestDemo.class

6
ThreadExportExcelDataNew/ExportExcelData.iml

@ -50,10 +50,13 @@
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.5.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:druid-spring-boot-starter:1.1.13" level="project" />
<orderEntry type="library" name="Maven: com.alibaba:druid:1.1.13" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.2.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.2.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: cn.afterturn:easypoi-annotation:4.1.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.2.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.2.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.2.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.2.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
@ -86,7 +89,6 @@
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.4.3.1" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.7" level="project" />
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.6" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.2.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.19" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.2.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.2" level="project" />

5
ThreadExportExcelDataNew/pom.xml

@ -27,6 +27,11 @@
<artifactId>easypoi-web</artifactId>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.13</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-annotation</artifactId>

23
ThreadExportExcelDataNew/src/main/java/com/wm/file/config/DataSourceConfig.java

@ -0,0 +1,23 @@
package com.wm.file.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.sql.DataSource;
@Configuration
public class DataSourceConfig {
@Bean
@ConfigurationProperties(prefix = "spring.datasource.druid")
public DataSourceProperties dataSourceProperties() {
return new DataSourceProperties();
}
@Bean
public DataSource dynamicDataSource(DataSourceProperties dataSourceProperties) {
return DynamicDataSourceFactory.buildDruidDataSource(dataSourceProperties);
}
}

197
ThreadExportExcelDataNew/src/main/java/com/wm/file/config/DataSourceProperties.java

@ -0,0 +1,197 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.wm.file.config;
public class DataSourceProperties {
private String driverClassName;
private String url;
private String username;
private String password;
/**
* Druid默认参数
*/
private int initialSize = 2;
private int maxActive = 10;
private int minIdle = -1;
private long maxWait = 60 * 1000L;
private long timeBetweenEvictionRunsMillis = 60 * 1000L;
private long minEvictableIdleTimeMillis = 1000L * 60L * 30L;
private long maxEvictableIdleTimeMillis = 1000L * 60L * 60L * 7;
private String validationQuery = "select 1";
private int validationQueryTimeout = -1;
private boolean testOnBorrow = false;
private boolean testOnReturn = false;
private boolean testWhileIdle = true;
private boolean poolPreparedStatements = false;
private int maxOpenPreparedStatements = -1;
private boolean sharePreparedStatements = false;
private String filters = "stat,wall";
public String getDriverClassName() {
return driverClassName;
}
public void setDriverClassName(String driverClassName) {
this.driverClassName = driverClassName;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public int getInitialSize() {
return initialSize;
}
public void setInitialSize(int initialSize) {
this.initialSize = initialSize;
}
public int getMaxActive() {
return maxActive;
}
public void setMaxActive(int maxActive) {
this.maxActive = maxActive;
}
public int getMinIdle() {
return minIdle;
}
public void setMinIdle(int minIdle) {
this.minIdle = minIdle;
}
public long getMaxWait() {
return maxWait;
}
public void setMaxWait(long maxWait) {
this.maxWait = maxWait;
}
public long getTimeBetweenEvictionRunsMillis() {
return timeBetweenEvictionRunsMillis;
}
public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) {
this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
}
public long getMinEvictableIdleTimeMillis() {
return minEvictableIdleTimeMillis;
}
public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) {
this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
}
public long getMaxEvictableIdleTimeMillis() {
return maxEvictableIdleTimeMillis;
}
public void setMaxEvictableIdleTimeMillis(long maxEvictableIdleTimeMillis) {
this.maxEvictableIdleTimeMillis = maxEvictableIdleTimeMillis;
}
public String getValidationQuery() {
return validationQuery;
}
public void setValidationQuery(String validationQuery) {
this.validationQuery = validationQuery;
}
public int getValidationQueryTimeout() {
return validationQueryTimeout;
}
public void setValidationQueryTimeout(int validationQueryTimeout) {
this.validationQueryTimeout = validationQueryTimeout;
}
public boolean isTestOnBorrow() {
return testOnBorrow;
}
public void setTestOnBorrow(boolean testOnBorrow) {
this.testOnBorrow = testOnBorrow;
}
public boolean isTestOnReturn() {
return testOnReturn;
}
public void setTestOnReturn(boolean testOnReturn) {
this.testOnReturn = testOnReturn;
}
public boolean isTestWhileIdle() {
return testWhileIdle;
}
public void setTestWhileIdle(boolean testWhileIdle) {
this.testWhileIdle = testWhileIdle;
}
public boolean isPoolPreparedStatements() {
return poolPreparedStatements;
}
public void setPoolPreparedStatements(boolean poolPreparedStatements) {
this.poolPreparedStatements = poolPreparedStatements;
}
public int getMaxOpenPreparedStatements() {
return maxOpenPreparedStatements;
}
public void setMaxOpenPreparedStatements(int maxOpenPreparedStatements) {
this.maxOpenPreparedStatements = maxOpenPreparedStatements;
}
public boolean isSharePreparedStatements() {
return sharePreparedStatements;
}
public void setSharePreparedStatements(boolean sharePreparedStatements) {
this.sharePreparedStatements = sharePreparedStatements;
}
public String getFilters() {
return filters;
}
public void setFilters(String filters) {
this.filters = filters;
}
}

53
ThreadExportExcelDataNew/src/main/java/com/wm/file/config/DynamicDataSourceFactory.java

@ -0,0 +1,53 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.wm.file.config;
import com.alibaba.druid.pool.DruidDataSource;
import java.sql.SQLException;
/**
* DruidDataSource
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
public class DynamicDataSourceFactory {
public static DruidDataSource buildDruidDataSource(DataSourceProperties properties) {
DruidDataSource druidDataSource = new DruidDataSource();
druidDataSource.setDriverClassName(properties.getDriverClassName());
druidDataSource.setUrl(properties.getUrl());
druidDataSource.setUsername(properties.getUsername());
druidDataSource.setPassword(properties.getPassword());
druidDataSource.setInitialSize(properties.getInitialSize());
druidDataSource.setMaxActive(properties.getMaxActive());
druidDataSource.setMinIdle(properties.getMinIdle());
druidDataSource.setMaxWait(properties.getMaxWait());
druidDataSource.setTimeBetweenEvictionRunsMillis(properties.getTimeBetweenEvictionRunsMillis());
druidDataSource.setMinEvictableIdleTimeMillis(properties.getMinEvictableIdleTimeMillis());
druidDataSource.setMaxEvictableIdleTimeMillis(properties.getMaxEvictableIdleTimeMillis());
druidDataSource.setValidationQuery(properties.getValidationQuery());
druidDataSource.setValidationQueryTimeout(properties.getValidationQueryTimeout());
druidDataSource.setTestOnBorrow(properties.isTestOnBorrow());
druidDataSource.setTestOnReturn(properties.isTestOnReturn());
druidDataSource.setPoolPreparedStatements(properties.isPoolPreparedStatements());
druidDataSource.setMaxOpenPreparedStatements(properties.getMaxOpenPreparedStatements());
druidDataSource.setSharePreparedStatements(properties.isSharePreparedStatements());
try {
druidDataSource.setFilters(properties.getFilters());
druidDataSource.init();
} catch (SQLException e) {
e.printStackTrace();
}
return druidDataSource;
}
}

53
ThreadExportExcelDataNew/src/main/java/com/wm/file/controller/FileController.java

@ -5,8 +5,10 @@ import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.wm.file.entity.UserEntity;
import com.wm.file.listen.EasyExceGeneralDatalListener;
import com.wm.file.mapper.UserMapper;
import com.wm.file.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
@ -29,19 +31,13 @@ import java.util.concurrent.ThreadPoolExecutor;
* @Date:2020/6/15 22:42
**/
@RestController
@Slf4j
public class FileController {
@Autowired
private UserMapper userMapper;
@Autowired
private ThreadPoolExecutor threadPoolExecutor;
@Resource
private UserService userService;
/**
* 多线程实现百万导出到excel 50s优化到11s
* @param response
@ -95,7 +91,12 @@ public class FileController {
response.getOutputStream().close();
}
/**
*
* 单线程实现百万导出到excel 50s优化到11s
* @param response
* @throws IOException
*/
@GetMapping("/newExport")
public void newExport(HttpServletResponse response) throws IOException {
OutputStream outputStream = response.getOutputStream();
@ -111,7 +112,7 @@ public class FileController {
//获取总数据量
int count = userService.count();
//每页多少个
int pageSize = 10000;
int pageSize = 1000000;
//必须放到循环外,否则会刷新流
ExcelWriter excelWriter = EasyExcel.write(outputStream).build();
//先查询第一页
@ -146,6 +147,40 @@ public class FileController {
}
@Autowired
private UserService userService;
/**
* 从excel导入100万数据到mysql
*
* 1首先是分批读取Excel中的100w数据
* 这一点EasyExcel有自己的解决方案 我是用的20w
*
* 2其次就是往DB里插入怎么去插入这20w条数据
* 当然不能一条一条的循环应该批量插入这20w条数据
* 同样也不能使用Mybatis的批量插入因为效率也低
*
* 3使用JDBC+事务的批量操作将数据插入到数据库
*
* 分批读取+JDBC分批插入+手动事务控制
*
*
*/
@GetMapping("/importExecel")
public void importExecel() throws IOException {
String fileName = "D:\\down_1674181635510.xlsx";
//记录开始读取Excel时间,也是导入程序开始时间
long startReadTime = System.currentTimeMillis();
log.info("------开始读取Excel的Sheet时间(包括导入数据过程):" + startReadTime + "ms------");
//读取所有Sheet的数据.每次读完一个Sheet就会调用这个方法
EasyExcel.read(fileName, new EasyExceGeneralDatalListener(userService)).doReadAll();
long endReadTime = System.currentTimeMillis();
log.info("------结束读取耗时" + (endReadTime-startReadTime) + "ms------");
}

68
ThreadExportExcelDataNew/src/main/java/com/wm/file/listen/EasyExceGeneralDatalListener.java

@ -0,0 +1,68 @@
package com.wm.file.listen;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.wm.file.service.UserService;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
// 事件监听
public class EasyExceGeneralDatalListener extends AnalysisEventListener<Map<Integer, String>> {
/**
* 处理业务逻辑的Service,也可以是Mapper
*/
private UserService userService;
/**
* 用于存储读取的数据
*/
private List<Map<Integer, String>> dataList = new ArrayList<Map<Integer, String>>();
public EasyExceGeneralDatalListener() {
}
public EasyExceGeneralDatalListener(UserService userService) {
this.userService = userService;
}
@Override
public void invoke(Map<Integer, String> data, AnalysisContext context) {
//数据add进入集合
dataList.add(data);
//size是否为200000条:这里其实就是分批.当数据等于20w的时候执行一次插入
if (dataList.size() >= 200000) {
//存入数据库:数据小于1w条使用Mybatis的批量插入即可;
saveData();
//清理集合便于GC回收
dataList.clear();
}
}
/**
* 保存数据到DB
*
* @param
* @MethodName: saveData
* @return: void
*/
private void saveData() {
userService.importDBFromExcel10w(dataList);
dataList.clear();
}
/**
* Excel中所有数据解析完毕会调用此方法
*
* @param: context
* @MethodName: doAfterAllAnalysed
* @return: void
*/
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
saveData();
dataList.clear();
}
}

3
ThreadExportExcelDataNew/src/main/java/com/wm/file/service/UserService.java

@ -5,6 +5,7 @@ import com.wm.file.entity.UserEntity;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
public interface UserService extends IService<UserEntity> {
@ -12,4 +13,6 @@ public interface UserService extends IService<UserEntity> {
List<UserEntity> findLimit(int i, int pageSize);
List<UserEntity> findNewPage(String o, int pageSize);
Map<String, Object> importDBFromExcel10w(List<Map<Integer, String>> dataList);
}

59
ThreadExportExcelDataNew/src/main/java/com/wm/file/service/impl/UserServiceImpl.java

@ -4,11 +4,19 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wm.file.entity.UserEntity;
import com.wm.file.mapper.UserMapper;
import com.wm.file.service.UserService;
import com.wm.file.util.easypoi.JDBCDruidUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.Timestamp;
import java.util.*;
@Service
@Slf4j
public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> implements UserService {
@Override
@ -24,5 +32,56 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
}
@Autowired
private DataSource dataSource;
@Override
public Map<String, Object> importDBFromExcel10w(List<Map<Integer, String>> dataList) {
HashMap<String, Object> result = new HashMap<>();
//结果集中数据为0时,结束方法.进行下一次调用
if (dataList.size() == 0) {
result.put("empty", "0000");
return result;
}
//JDBC分批插入+事务操作完成对10w数据的插入
Connection conn = null;
PreparedStatement ps = null;
try {
long startTime = System.currentTimeMillis();
log.info(dataList.size() + "条,开始导入到数据库时间:" + startTime + "ms");
conn = dataSource.getConnection();
//控制事务:默认不提交
conn.setAutoCommit(false);
String sql = "insert into usernew (id,name,phone,ceate_by) values (?,?,?,?)";
ps = conn.prepareStatement(sql);
//循环结果集:这里循环不支持"烂布袋"表达式
for (int i = 0; i < dataList.size(); i++) {
Map<Integer, String> item = dataList.get(i);
ps.setString(1, item.get(0));
ps.setString(2, item.get(1));
ps.setString(3, item.get(2));
ps.setString(4, item.get(3));
//将一组参数添加到此 PreparedStatement 对象的批处理命令中。
ps.addBatch();
}
//执行批处理
ps.executeBatch();
//手动提交事务
conn.commit();
long endTime = System.currentTimeMillis();
log.info(dataList.size() + "条,结束导入到数据库时间:" + endTime + "ms");
log.info(dataList.size() + "条,导入用时:" + (endTime - startTime) + "ms");
result.put("success", "1111");
} catch (Exception e) {
result.put("exception", "0000");
e.printStackTrace();
} finally {
//关连接
JDBCDruidUtils.close(conn, ps);
}
return result;
}
}

57
ThreadExportExcelDataNew/src/main/java/com/wm/file/util/easypoi/JDBCDruidUtils.java

@ -0,0 +1,57 @@
package com.wm.file.util.easypoi;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class JDBCDruidUtils {
/**
* 关闭conn, statement独对象资源
*
* @param connection
* @param statement
* @MethodName: close
* @return: void
*/
public static void close(Connection connection, Statement statement) {
if (connection != null) {
try {
connection.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
if (statement != null) {
try {
statement.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
/**
* 关闭 conn , statement 和resultset三个对象资源
*
* @param connection
* @param statement
* @param resultSet
* @MethodName: close
* @return: void
*/
public static void close(Connection connection, Statement statement, ResultSet resultSet) {
close(connection, statement);
if (resultSet != null) {
try {
resultSet.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}
}

39
ThreadExportExcelDataNew/src/main/resources/application.yml

@ -0,0 +1,39 @@
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
druid:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
username: root
password: 123456
initial-size: 10
max-active: 100
min-idle: 10
max-wait: 60000
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
time-between-eviction-runs-millis: 60000
min-evictable-idle-time-millis: 300000
#Oracle需要打开注释
#validation-query: SELECT 1 FROM DUAL
test-while-idle: true
test-on-borrow: false
test-on-return: false
stat-view-servlet:
enabled: true
url-pattern: /druid/*
#login-username: admin
#login-password: admin
filter:
stat:
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: false
wall:
config:
multi-statement-allow: true
mybatis-plus:
mapper-locations: classpath*:/mapper/*.xml
configuration:
map-underscore-to-camel-case: true

13
ThreadExportExcelDataNew/target/classes/application.properties

@ -1,13 +0,0 @@
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&allowMultiQueries=true
spring.datasource.username=root
spring.datasource.password=123456
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#mybatis-plus.configuration.log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mybatis-plus.configuration.map-underscore-to-camel-case: true
mybatis-plus.mapper-locations=classpath*:/mapper/*.xml
# �����þ��ǽ������»��ߵı��ֶ�ӳ��Ϊ�շ��ʽ��ʵ��������

BIN
ThreadExportExcelDataNew/target/classes/com/wm/file/ExportExcelDataApplication.class

Binary file not shown.

BIN
ThreadExportExcelDataNew/target/classes/com/wm/file/FileController.class

Binary file not shown.

BIN
ThreadExportExcelDataNew/target/classes/com/wm/file/config/AsyncTaskPoolConfig.class

Binary file not shown.

BIN
ThreadExportExcelDataNew/target/classes/com/wm/file/config/NamedThreadFactory.class

Binary file not shown.

BIN
ThreadExportExcelDataNew/target/classes/com/wm/file/entity/UserEntity.class

Binary file not shown.

BIN
ThreadExportExcelDataNew/target/classes/com/wm/file/mapper/UserMapper.class

Binary file not shown.

BIN
ThreadExportExcelDataNew/target/classes/com/wm/file/service/UserService.class

Binary file not shown.

BIN
ThreadExportExcelDataNew/target/classes/com/wm/file/service/impl/UserServiceImpl.class

Binary file not shown.

BIN
ThreadExportExcelDataNew/target/classes/com/wm/file/util/easypoi/ExcelStyleUtil.class

Binary file not shown.

BIN
ThreadExportExcelDataNew/target/classes/com/wm/file/util/easypoi/MyExcelExportService.class

Binary file not shown.

30
ThreadExportExcelDataNew/target/classes/mapper/UserMapper.xml

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.wm.file.mapper.UserMapper">
<select id="findLimit" resultType="com.wm.file.entity.UserEntity">
select id,
name,
phone,
ceate_by as ceateBy
from user
order by id asc
limit #{index},#{pageSize}
</select>
<select id="findNewPage" resultType="com.wm.file.entity.UserEntity">
SELECT id,NAME,
phone,ceate_by AS ceateBy
FROM USER
<if test="id!=null and id!=''">
WHERE id > #{id}
</if>
ORDER BY id ASC
LIMIT #{pageSize}
</select>
</mapper>

BIN
ThreadExportExcelDataNew/target/test-classes/com/wm/file/TestDemo.class

Binary file not shown.
Loading…
Cancel
Save