Compare commits
No commits in common. "900832c03c2ff982145472cbb07e9aaf6817f979" and "9c55346ac72ee61cf4ed868e583fb92bcfd69b34" have entirely different histories.
900832c03c
...
9c55346ac7
@ -31,30 +31,4 @@ pnpm dev
|
|||||||
|
|
||||||
5. 构建生产版本
|
5. 构建生产版本
|
||||||
```bash
|
```bash
|
||||||
pnpm build
|
pnpm build
|
||||||
|
|
||||||
|
|
||||||
部署tongweb
|
|
||||||
|
|
||||||
1、cd dist
|
|
||||||
|
|
||||||
2、mkdir WEB-INF
|
|
||||||
|
|
||||||
3、touch web.xml
|
|
||||||
|
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
|
|
||||||
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
|
|
||||||
version="3.1" metadata-complete="true">
|
|
||||||
<display-name>Router for Tomcat</display-name>
|
|
||||||
<error-page>
|
|
||||||
<error-code>404</error-code>
|
|
||||||
<location>/index.html</location>
|
|
||||||
</error-page>
|
|
||||||
</web-app>
|
|
||||||
|
|
||||||
|
|
||||||
4、jar -cvf mps-vue.war *
|
|
||||||
5、将war复制到tongweb安装目录
|
|
@ -77,11 +77,9 @@ spring:
|
|||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
# 单个文件大小
|
# 单个文件大小
|
||||||
max-file-size: 50MB
|
max-file-size: 10MB
|
||||||
# 设置总上传的文件大小
|
# 设置总上传的文件大小
|
||||||
max-request-size: 100MB
|
max-request-size: 20MB
|
||||||
#指定上传文件的临时目录,必须带,否则tongweb会报错
|
|
||||||
location: /data/upload_tmp
|
|
||||||
mvc:
|
mvc:
|
||||||
# 设置静态资源路径 防止所有请求都去查静态资源
|
# 设置静态资源路径 防止所有请求都去查静态资源
|
||||||
static-path-pattern: /static/**
|
static-path-pattern: /static/**
|
||||||
|
@ -10,8 +10,6 @@ import org.apache.ibatis.annotations.Param;
|
|||||||
import org.dromara.common.mybatis.annotation.DataColumn;
|
import org.dromara.common.mybatis.annotation.DataColumn;
|
||||||
import org.dromara.common.mybatis.annotation.DataPermission;
|
import org.dromara.common.mybatis.annotation.DataPermission;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ${functionName}Mapper接口
|
* ${functionName}Mapper接口
|
||||||
*
|
*
|
||||||
@ -35,7 +33,4 @@ public interface ${ClassName}Mapper extends BaseMapperPlus<${ClassName}, ${Class
|
|||||||
//})
|
//})
|
||||||
// List<SysUserExportVo> select${ClassName}ExportList(@Param(Constants.WRAPPER) Wrapper<${ClassName}> queryWrapper);
|
// List<SysUserExportVo> select${ClassName}ExportList(@Param(Constants.WRAPPER) Wrapper<${ClassName}> queryWrapper);
|
||||||
|
|
||||||
// 批量插入
|
|
||||||
void batchInsert(@Param("list") Collection<${ClassName}> list);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -50,30 +50,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service {
|
|||||||
if (isUpdateSupport) {
|
if (isUpdateSupport) {
|
||||||
baseMapper.insertOrUpdateBatch(list);
|
baseMapper.insertOrUpdateBatch(list);
|
||||||
} else {
|
} else {
|
||||||
//baseMapper.insertBatch(list);
|
baseMapper.insertBatch(list);
|
||||||
|
|
||||||
/**
|
|
||||||
* 多笔写入方式有循环写入、开启数据库batch模式、sql拼接后多笔入库以及mapper foreach多笔写入模式
|
|
||||||
* 经对比验证,foreach方式效率最高
|
|
||||||
*
|
|
||||||
* **/
|
|
||||||
|
|
||||||
//由于mybatis的批量方法为伪批量,以下优化为真批量
|
|
||||||
//SqlHelper与service的注解事务管理冲突,所以此处自行写分批
|
|
||||||
int batchSize = 1000;//每批1000条
|
|
||||||
List<${ClassName}> batchList = new ArrayList<>(batchSize);
|
|
||||||
for (${ClassName} item : list) {
|
|
||||||
batchList.add(item);
|
|
||||||
if (batchList.size() == batchSize) {
|
|
||||||
baseMapper.batchInsert(batchList);
|
|
||||||
batchList.clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理最后一批不满batchSize的数据
|
|
||||||
if (!batchList.isEmpty()) {
|
|
||||||
baseMapper.batchInsert(batchList);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,21 +4,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="${packageName}.mapper.${ClassName}Mapper">
|
<mapper namespace="${packageName}.mapper.${ClassName}Mapper">
|
||||||
|
|
||||||
<!--mysql写法,达梦兼容-->
|
|
||||||
<insert id="batchInsert">
|
|
||||||
INSERT INTO ${tableName}
|
|
||||||
(
|
|
||||||
#foreach($column in $columns)
|
|
||||||
$column.columnName#if($foreach.count != $columns.size()),#end
|
|
||||||
#end
|
|
||||||
)
|
|
||||||
VALUES
|
|
||||||
<foreach collection="list" item="item" separator=",">
|
|
||||||
(
|
|
||||||
#foreach($column in $columns)
|
|
||||||
#{item.$column.javaField}#if($foreach.count != $columns.size()),#end
|
|
||||||
#end
|
|
||||||
)
|
|
||||||
</foreach>
|
|
||||||
</insert>
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -10,8 +10,6 @@ import org.apache.ibatis.annotations.Param;
|
|||||||
import org.dromara.common.mybatis.annotation.DataColumn;
|
import org.dromara.common.mybatis.annotation.DataColumn;
|
||||||
import org.dromara.common.mybatis.annotation.DataPermission;
|
import org.dromara.common.mybatis.annotation.DataPermission;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人手机银行签约明细Mapper接口
|
* 个人手机银行签约明细Mapper接口
|
||||||
*
|
*
|
||||||
@ -35,6 +33,4 @@ public interface OriginalMobileBankSignupMapper extends BaseMapperPlus<OriginalM
|
|||||||
//})
|
//})
|
||||||
// List<SysUserExportVo> selectOriginalMobileBankSignupExportList(@Param(Constants.WRAPPER) Wrapper<OriginalMobileBankSignup> queryWrapper);
|
// List<SysUserExportVo> selectOriginalMobileBankSignupExportList(@Param(Constants.WRAPPER) Wrapper<OriginalMobileBankSignup> queryWrapper);
|
||||||
|
|
||||||
// 批量插入(MySQL多值语法)
|
|
||||||
void batchInsert(@Param("list") Collection<OriginalMobileBankSignup> list);
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package org.dromara.original.service.impl;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@ -19,7 +20,6 @@ import org.dromara.original.service.IOriginalMobileBankSignupService;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人手机银行签约明细Service业务层处理
|
* 个人手机银行签约明细Service业务层处理
|
||||||
@ -48,22 +48,7 @@ public class OriginalMobileBankSignupServiceImpl implements IOriginalMobileBankS
|
|||||||
if (isUpdateSupport) {
|
if (isUpdateSupport) {
|
||||||
baseMapper.insertOrUpdateBatch(list);
|
baseMapper.insertOrUpdateBatch(list);
|
||||||
} else {
|
} else {
|
||||||
//由于mybatis的批量方法为伪批量,以下优化为真批量
|
baseMapper.insertBatch(list);
|
||||||
//SqlHelper与service的注解事务管理冲突,所以此处自行写分批
|
|
||||||
int batchSize = 1000;//每批1000条
|
|
||||||
List<OriginalMobileBankSignup> batchList = new ArrayList<>(batchSize);
|
|
||||||
for (OriginalMobileBankSignup item : list) {
|
|
||||||
batchList.add(item);
|
|
||||||
if (batchList.size() == batchSize) {
|
|
||||||
baseMapper.batchInsert(batchList);
|
|
||||||
batchList.clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理最后一批不满batchSize的数据
|
|
||||||
if (!batchList.isEmpty()) {
|
|
||||||
baseMapper.batchInsert(batchList);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,36 +4,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.dromara.original.mapper.OriginalMobileBankSignupMapper">
|
<mapper namespace="org.dromara.original.mapper.OriginalMobileBankSignupMapper">
|
||||||
|
|
||||||
<!--mysql写法,达梦兼容-->
|
|
||||||
<insert id="batchInsert">
|
|
||||||
INSERT INTO original_mobile_bank_signup
|
|
||||||
(
|
|
||||||
branch_name,
|
|
||||||
branch_code,
|
|
||||||
customer_name,
|
|
||||||
id_type,
|
|
||||||
id_number,
|
|
||||||
main_account,
|
|
||||||
signup_date,
|
|
||||||
auth_method,
|
|
||||||
serial_number,
|
|
||||||
teller
|
|
||||||
)
|
|
||||||
VALUES
|
|
||||||
<foreach collection="list" item="item" separator=",">
|
|
||||||
(
|
|
||||||
#{item.branchName},
|
|
||||||
#{item.branchCode},
|
|
||||||
#{item.customerName},
|
|
||||||
#{item.idType},
|
|
||||||
#{item.idNumber},
|
|
||||||
#{item.mainAccount},
|
|
||||||
#{item.signupDate},
|
|
||||||
#{item.authMethod},
|
|
||||||
#{item.serialNumber},
|
|
||||||
#{item.teller}
|
|
||||||
)
|
|
||||||
</foreach>
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user