批处理方式
@Resource
SqlSessionFactory sessionFactory;
@Test
void test1() {
//使用批处理, 开启事务, 打开一个会话
SqlSession sqlSession = sessionFactory.openSession(ExecutorType.BATCH, false);
//取得statementMapper, 执行sql语句
NationReportSaveDao mapper = sqlSession.getMapper(NationReportSaveDao.class);
long start = System.currentTimeMillis();
for (int i = 0; i < 10000; i++) {
//伪造数据源
String xmid = "xmid337" + i;
AreaStatisticsDataDTO dataDTO = AreaStatisticsDataDTO.builder()
.housesTypeName("普通住宅")