From 0021873ef7dcaa173c7b101337836d42b37964de Mon Sep 17 00:00:00 2001 From: Kane Wang Date: Wed, 11 Oct 2023 18:31:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=80=E5=A7=8B=E7=BC=96=E5=86=99=E6=8F=92?= =?UTF-8?q?=E5=85=A5=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/web/task_schedule/package-lock.json | 144 +++++++++--------- code/web/task_schedule/package.json | 6 +- .../mapper/ImportArchievementDataMapper.java | 17 +++ .../cpic/xim/mybatis/utils/MybatisUtils.java | 44 +++++- .../mapper/ImportArchievementDataMapper.xml | 8 + .../main/resources/mybatis/mybatis-config.xml | 1 + 6 files changed, 144 insertions(+), 76 deletions(-) create mode 100644 code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/mapper/ImportArchievementDataMapper.java create mode 100644 code/后端/desktop_archievement_backend/src/main/resources/mybatis/mapper/ImportArchievementDataMapper.xml diff --git a/code/web/task_schedule/package-lock.json b/code/web/task_schedule/package-lock.json index 092aecb..1148bce 100644 --- a/code/web/task_schedule/package-lock.json +++ b/code/web/task_schedule/package-lock.json @@ -21,20 +21,20 @@ "devDependencies": { "@babel/eslint-parser": "^7.22.15", "@rushstack/eslint-patch": "^1.5.1", - "@typescript-eslint/eslint-plugin": "^6.7.4", + "@typescript-eslint/eslint-plugin": "^6.7.5", "@vitejs/plugin-vue": "^4.4.0", "@vue/cli-plugin-eslint": "^5.0.8", "@vue/eslint-config-typescript": "^12.0.0", "axios": "^1.5.1", "babel": "^6.23.0", "eslint-config-recommended": "^4.1.0", - "eslint-config-standard-with-typescript": "^39.1.0", + "eslint-config-standard-with-typescript": "^39.1.1", "eslint-plugin-vue": "^9.17.0", "node-sass": "^9.0.0", - "sass": "^1.69.0", + "sass": "^1.69.2", "style-loader": "^3.3.3", "ts-node": "^10.9.1", - "vue-eslint-parser": "^9.3.1" + "vue-eslint-parser": "^9.3.2" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -1578,16 +1578,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.7.4", - "resolved": "https://registry.npmmirror.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.4.tgz", - "integrity": "sha512-DAbgDXwtX+pDkAHwiGhqP3zWUGpW49B7eqmgpPtg+BKJXwdct79ut9+ifqOFPJGClGKSHXn2PTBatCnldJRUoA==", + "version": "6.7.5", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.5.tgz", + "integrity": "sha512-JhtAwTRhOUcP96D0Y6KYnwig/MRQbOoLGXTON2+LlyB/N35SP9j1boai2zzwXb7ypKELXMx3DVk9UTaEq1vHEw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.7.4", - "@typescript-eslint/type-utils": "6.7.4", - "@typescript-eslint/utils": "6.7.4", - "@typescript-eslint/visitor-keys": "6.7.4", + "@typescript-eslint/scope-manager": "6.7.5", + "@typescript-eslint/type-utils": "6.7.5", + "@typescript-eslint/utils": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -1609,34 +1609,34 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "6.7.4", - "resolved": "https://registry.npmmirror.com/@typescript-eslint/scope-manager/-/scope-manager-6.7.4.tgz", - "integrity": "sha512-SdGqSLUPTXAXi7c3Ob7peAGVnmMoGzZ361VswK2Mqf8UOYcODiYvs8rs5ILqEdfvX1lE7wEZbLyELCW+Yrql1A==", + "version": "6.7.5", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/scope-manager/-/scope-manager-6.7.5.tgz", + "integrity": "sha512-GAlk3eQIwWOJeb9F7MKQ6Jbah/vx1zETSDw8likab/eFcqkjSD7BI75SDAeC5N2L0MmConMoPvTsmkrg71+B1A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.4", - "@typescript-eslint/visitor-keys": "6.7.4" + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5" }, "engines": { "node": "^16.0.0 || >=18.0.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "6.7.4", - "resolved": "https://registry.npmmirror.com/@typescript-eslint/types/-/types-6.7.4.tgz", - "integrity": "sha512-o9XWK2FLW6eSS/0r/tgjAGsYasLAnOWg7hvZ/dGYSSNjCh+49k5ocPN8OmG5aZcSJ8pclSOyVKP2x03Sj+RrCA==", + "version": "6.7.5", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/types/-/types-6.7.5.tgz", + "integrity": "sha512-WboQBlOXtdj1tDFPyIthpKrUb+kZf2VroLZhxKa/VlwLlLyqv/PwUNgL30BlTVZV1Wu4Asu2mMYPqarSO4L5ZQ==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.7.4", - "resolved": "https://registry.npmmirror.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.4.tgz", - "integrity": "sha512-pOW37DUhlTZbvph50x5zZCkFn3xzwkGtNoJHzIM3svpiSkJzwOYr/kVBaXmf+RAQiUDs1AHEZVNPg6UJCJpwRA==", + "version": "6.7.5", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.5.tgz", + "integrity": "sha512-3MaWdDZtLlsexZzDSdQWsFQ9l9nL8B80Z4fImSpyllFC/KLqWQRdEcB+gGGO+N3Q2uL40EsG66wZLsohPxNXvg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/types": "6.7.5", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -1723,13 +1723,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.7.4", - "resolved": "https://registry.npmmirror.com/@typescript-eslint/type-utils/-/type-utils-6.7.4.tgz", - "integrity": "sha512-n+g3zi1QzpcAdHFP9KQF+rEFxMb2KxtnJGID3teA/nxKHOVi3ylKovaqEzGBbVY2pBttU6z85gp0D00ufLzViQ==", + "version": "6.7.5", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/type-utils/-/type-utils-6.7.5.tgz", + "integrity": "sha512-Gs0qos5wqxnQrvpYv+pf3XfcRXW6jiAn9zE/K+DlmYf6FcpxeNYN0AIETaPR7rHO4K2UY+D0CIbDP9Ut0U4m1g==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.7.4", - "@typescript-eslint/utils": "6.7.4", + "@typescript-eslint/typescript-estree": "6.7.5", + "@typescript-eslint/utils": "6.7.5", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -1746,22 +1746,22 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "6.7.4", - "resolved": "https://registry.npmmirror.com/@typescript-eslint/types/-/types-6.7.4.tgz", - "integrity": "sha512-o9XWK2FLW6eSS/0r/tgjAGsYasLAnOWg7hvZ/dGYSSNjCh+49k5ocPN8OmG5aZcSJ8pclSOyVKP2x03Sj+RrCA==", + "version": "6.7.5", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/types/-/types-6.7.5.tgz", + "integrity": "sha512-WboQBlOXtdj1tDFPyIthpKrUb+kZf2VroLZhxKa/VlwLlLyqv/PwUNgL30BlTVZV1Wu4Asu2mMYPqarSO4L5ZQ==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.7.4", - "resolved": "https://registry.npmmirror.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.4.tgz", - "integrity": "sha512-ty8b5qHKatlNYd9vmpHooQz3Vki3gG+3PchmtsA4TgrZBKWHNjWfkQid7K7xQogBqqc7/BhGazxMD5vr6Ha+iQ==", + "version": "6.7.5", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.5.tgz", + "integrity": "sha512-NhJiJ4KdtwBIxrKl0BqG1Ur+uw7FiOnOThcYx9DpOGJ/Abc9z2xNzLeirCG02Ig3vkvrc2qFLmYSSsaITbKjlg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.4", - "@typescript-eslint/visitor-keys": "6.7.4", + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1778,12 +1778,12 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.7.4", - "resolved": "https://registry.npmmirror.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.4.tgz", - "integrity": "sha512-pOW37DUhlTZbvph50x5zZCkFn3xzwkGtNoJHzIM3svpiSkJzwOYr/kVBaXmf+RAQiUDs1AHEZVNPg6UJCJpwRA==", + "version": "6.7.5", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.5.tgz", + "integrity": "sha512-3MaWdDZtLlsexZzDSdQWsFQ9l9nL8B80Z4fImSpyllFC/KLqWQRdEcB+gGGO+N3Q2uL40EsG66wZLsohPxNXvg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/types": "6.7.5", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -1898,17 +1898,17 @@ "dev": true }, "node_modules/@typescript-eslint/utils": { - "version": "6.7.4", - "resolved": "https://registry.npmmirror.com/@typescript-eslint/utils/-/utils-6.7.4.tgz", - "integrity": "sha512-PRQAs+HUn85Qdk+khAxsVV+oULy3VkbH3hQ8hxLRJXWBEd7iI+GbQxH5SEUSH7kbEoTp6oT1bOwyga24ELALTA==", + "version": "6.7.5", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/utils/-/utils-6.7.5.tgz", + "integrity": "sha512-pfRRrH20thJbzPPlPc4j0UNGvH1PjPlhlCMq4Yx7EGjV7lvEeGX0U6MJYe8+SyFutWgSHsdbJ3BXzZccYggezA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.7.4", - "@typescript-eslint/types": "6.7.4", - "@typescript-eslint/typescript-estree": "6.7.4", + "@typescript-eslint/scope-manager": "6.7.5", + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/typescript-estree": "6.7.5", "semver": "^7.5.4" }, "engines": { @@ -1919,35 +1919,35 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": { - "version": "6.7.4", - "resolved": "https://registry.npmmirror.com/@typescript-eslint/scope-manager/-/scope-manager-6.7.4.tgz", - "integrity": "sha512-SdGqSLUPTXAXi7c3Ob7peAGVnmMoGzZ361VswK2Mqf8UOYcODiYvs8rs5ILqEdfvX1lE7wEZbLyELCW+Yrql1A==", + "version": "6.7.5", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/scope-manager/-/scope-manager-6.7.5.tgz", + "integrity": "sha512-GAlk3eQIwWOJeb9F7MKQ6Jbah/vx1zETSDw8likab/eFcqkjSD7BI75SDAeC5N2L0MmConMoPvTsmkrg71+B1A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.4", - "@typescript-eslint/visitor-keys": "6.7.4" + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5" }, "engines": { "node": "^16.0.0 || >=18.0.0" } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { - "version": "6.7.4", - "resolved": "https://registry.npmmirror.com/@typescript-eslint/types/-/types-6.7.4.tgz", - "integrity": "sha512-o9XWK2FLW6eSS/0r/tgjAGsYasLAnOWg7hvZ/dGYSSNjCh+49k5ocPN8OmG5aZcSJ8pclSOyVKP2x03Sj+RrCA==", + "version": "6.7.5", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/types/-/types-6.7.5.tgz", + "integrity": "sha512-WboQBlOXtdj1tDFPyIthpKrUb+kZf2VroLZhxKa/VlwLlLyqv/PwUNgL30BlTVZV1Wu4Asu2mMYPqarSO4L5ZQ==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.7.4", - "resolved": "https://registry.npmmirror.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.4.tgz", - "integrity": "sha512-ty8b5qHKatlNYd9vmpHooQz3Vki3gG+3PchmtsA4TgrZBKWHNjWfkQid7K7xQogBqqc7/BhGazxMD5vr6Ha+iQ==", + "version": "6.7.5", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.5.tgz", + "integrity": "sha512-NhJiJ4KdtwBIxrKl0BqG1Ur+uw7FiOnOThcYx9DpOGJ/Abc9z2xNzLeirCG02Ig3vkvrc2qFLmYSSsaITbKjlg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.4", - "@typescript-eslint/visitor-keys": "6.7.4", + "@typescript-eslint/types": "6.7.5", + "@typescript-eslint/visitor-keys": "6.7.5", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1964,12 +1964,12 @@ } }, "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.7.4", - "resolved": "https://registry.npmmirror.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.4.tgz", - "integrity": "sha512-pOW37DUhlTZbvph50x5zZCkFn3xzwkGtNoJHzIM3svpiSkJzwOYr/kVBaXmf+RAQiUDs1AHEZVNPg6UJCJpwRA==", + "version": "6.7.5", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.5.tgz", + "integrity": "sha512-3MaWdDZtLlsexZzDSdQWsFQ9l9nL8B80Z4fImSpyllFC/KLqWQRdEcB+gGGO+N3Q2uL40EsG66wZLsohPxNXvg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.7.4", + "@typescript-eslint/types": "6.7.5", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -6777,9 +6777,9 @@ } }, "node_modules/eslint-config-standard-with-typescript": { - "version": "39.1.0", - "resolved": "https://registry.npmmirror.com/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-39.1.0.tgz", - "integrity": "sha512-5+SPKis3yr6T1X6wSA7HhDuumTRMrTDMcsTrIWhdZuI+sX3e8SPGZYzuJxVxdc239Yo718dEVEVyJhHI6jUjrQ==", + "version": "39.1.1", + "resolved": "https://registry.npmmirror.com/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-39.1.1.tgz", + "integrity": "sha512-t6B5Ep8E4I18uuoYeYxINyqcXb2UbC0SOOTxRtBSt2JUs+EzeXbfe2oaiPs71AIdnoWhXDO2fYOHz8df3kV84A==", "dev": true, "dependencies": { "@typescript-eslint/parser": "^6.4.0", @@ -12813,9 +12813,9 @@ "dev": true }, "node_modules/sass": { - "version": "1.69.0", - "resolved": "https://registry.npmmirror.com/sass/-/sass-1.69.0.tgz", - "integrity": "sha512-l3bbFpfTOGgQZCLU/gvm1lbsQ5mC/WnLz3djL2v4WCJBDrWm58PO+jgngcGRNnKUh6wSsdm50YaovTqskZ0xDQ==", + "version": "1.69.2", + "resolved": "https://registry.npmmirror.com/sass/-/sass-1.69.2.tgz", + "integrity": "sha512-48lDtG/9OuSQZ9oNmJMUXI2QdCakAWrAGjpX/Fy6j4Og8dEAyE598x5GqCqnHkwV7+I5w8DJpqjm581q5HNh3w==", "devOptional": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0", @@ -14424,9 +14424,9 @@ } }, "node_modules/vue-eslint-parser": { - "version": "9.3.1", - "resolved": "https://registry.npmmirror.com/vue-eslint-parser/-/vue-eslint-parser-9.3.1.tgz", - "integrity": "sha512-Clr85iD2XFZ3lJ52/ppmUDG/spxQu6+MAeHXjjyI4I1NUYZ9xmenQp4N0oaHJhrA8OOxltCVxMRfANGa70vU0g==", + "version": "9.3.2", + "resolved": "https://registry.npmmirror.com/vue-eslint-parser/-/vue-eslint-parser-9.3.2.tgz", + "integrity": "sha512-q7tWyCVaV9f8iQyIA5Mkj/S6AoJ9KBN8IeUSf3XEmBrOtxOZnfTg5s4KClbZBCK3GtnT/+RyCLZyDHuZwTuBjg==", "dev": true, "dependencies": { "debug": "^4.3.4", diff --git a/code/web/task_schedule/package.json b/code/web/task_schedule/package.json index 2e4096c..eff8f01 100644 --- a/code/web/task_schedule/package.json +++ b/code/web/task_schedule/package.json @@ -22,7 +22,7 @@ "devDependencies": { "@babel/eslint-parser": "^7.22.15", "@rushstack/eslint-patch": "^1.5.1", - "@typescript-eslint/eslint-plugin": "^6.7.4", + "@typescript-eslint/eslint-plugin": "^6.7.5", "@vitejs/plugin-vue": "^4.4.0", "@vue/cli-plugin-eslint": "^5.0.8", "@vue/eslint-config-typescript": "^12.0.0", @@ -32,9 +32,9 @@ "eslint-config-standard-with-typescript": "^39.1.1", "eslint-plugin-vue": "^9.17.0", "node-sass": "^9.0.0", - "sass": "^1.69.0", + "sass": "^1.69.2", "style-loader": "^3.3.3", "ts-node": "^10.9.1", - "vue-eslint-parser": "^9.3.1" + "vue-eslint-parser": "^9.3.2" } } diff --git a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/mapper/ImportArchievementDataMapper.java b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/mapper/ImportArchievementDataMapper.java new file mode 100644 index 0000000..52a79c6 --- /dev/null +++ b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/mapper/ImportArchievementDataMapper.java @@ -0,0 +1,17 @@ +/* + * @Author: Kane + * @Date: 2023-10-11 16:47:59 + * @LastEditors: Kane + * @FilePath: /desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/mapper/ImportArchievementDataMapper.java + * @Description: + * + * Copyright (c) ${2023} by Kane, All Rights Reserved. + */ +package com.cpic.xim.mybatis.mapper; + +import com.cpic.xim.mybatis.pojo.TelsalerAttachingRateRecord; + +public interface ImportArchievementDataMapper +{ + public void importTesalerAttachingRateDataToDB( TelsalerAttachingRateRecord record); +} \ No newline at end of file diff --git a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/utils/MybatisUtils.java b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/utils/MybatisUtils.java index 6d3acb0..e0acbd9 100644 --- a/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/utils/MybatisUtils.java +++ b/code/后端/desktop_archievement_backend/src/main/java/com/cpic/xim/mybatis/utils/MybatisUtils.java @@ -13,13 +13,15 @@ import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import org.apache.ibatis.io.Resources; +import org.apache.ibatis.session.ExecutorType; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactoryBuilder; public class MybatisUtils { - private static HashMap SessionMap = new HashMap<>(); + private static HashMap SessionMap = new HashMap<>(5); + private static HashMap SessionMapBatch = new HashMap<>(5); private static String DEFAULT_CONFIGFILE = "mybatis/mybatis-config.xml"; /** @@ -50,6 +52,26 @@ public class MybatisUtils return session; } + public static SqlSession getSqlSessionBatch( String configFile ) throws IOException + { + SqlSession sessionBatch = SessionMapBatch.get( configFile ); + + if ( sessionBatch != null ) + { + return sessionBatch; + } + + // 没有缓存的就创建一个新的 + InputStream configIS = Resources.getResourceAsStream( configFile ); + SqlSessionFactory factory = new SqlSessionFactoryBuilder().build( configIS ); + sessionBatch = factory.openSession(ExecutorType.BATCH ); + + //保存 + SessionMapBatch.put( configFile, sessionBatch ); + + return sessionBatch; + } + public static SqlSession getSqlSession() throws IOException { // 根据配置文件的路径,查找是否已经创建了对应的session @@ -71,4 +93,24 @@ public class MybatisUtils return session; } + + public static SqlSession getSqlSessionBatch() throws IOException + { + SqlSession sessionBatch = SessionMapBatch.get( DEFAULT_CONFIGFILE ); + + if ( sessionBatch != null ) + { + return sessionBatch; + } + + // 没有缓存的就创建一个新的 + InputStream configIS = Resources.getResourceAsStream( DEFAULT_CONFIGFILE ); + SqlSessionFactory factory = new SqlSessionFactoryBuilder().build( configIS ); + sessionBatch = factory.openSession(ExecutorType.BATCH ); + + //保存 + SessionMapBatch.put( DEFAULT_CONFIGFILE, sessionBatch ); + + return sessionBatch; + } } diff --git a/code/后端/desktop_archievement_backend/src/main/resources/mybatis/mapper/ImportArchievementDataMapper.xml b/code/后端/desktop_archievement_backend/src/main/resources/mybatis/mapper/ImportArchievementDataMapper.xml new file mode 100644 index 0000000..baf0b0f --- /dev/null +++ b/code/后端/desktop_archievement_backend/src/main/resources/mybatis/mapper/ImportArchievementDataMapper.xml @@ -0,0 +1,8 @@ + + + + + insert into 电销坐席车非渗透统计表 ( telsaler_name, moto_premium, nomoto_premium, moto_premium_proportion, attaching_rate, attaching_rate_change ) + values ( #{telsalerName}, #{motoPremium}, #{nomotoPremium}, #{motoPremiumProportion}, #{attachingRate}, #{attachingRateChange} ) + + \ No newline at end of file diff --git a/code/后端/desktop_archievement_backend/src/main/resources/mybatis/mybatis-config.xml b/code/后端/desktop_archievement_backend/src/main/resources/mybatis/mybatis-config.xml index a678ba2..01d45cf 100644 --- a/code/后端/desktop_archievement_backend/src/main/resources/mybatis/mybatis-config.xml +++ b/code/后端/desktop_archievement_backend/src/main/resources/mybatis/mybatis-config.xml @@ -26,5 +26,6 @@ + \ No newline at end of file