From a5bfbf3624221c770d5c7ca6d1db317d3585da3a Mon Sep 17 00:00:00 2001 From: cyFeng <123456789@qq.com> Date: Tue, 28 Nov 2023 15:07:59 +0800 Subject: [PATCH] first commit --- .gitignore | 29 + README.md | 3 + config/application.properties | 4 + config/logback.xml | 93 +++ mvnw | 286 ++++++++++ mvnw.cmd | 161 ++++++ pom.xml | 113 ++++ .../MysqlOracleTestApplication.java | 24 + .../mysqloracletest/domain/VSySydzMysql.java | 22 + .../mysqloracletest/domain/VSySydzOracle.java | 22 + .../domain/VillageSendRecordStatic.java | 30 + .../domain/VillageUserInfo.java | 397 +++++++++++++ .../mapper/VSySydzMysqlMapper.java | 15 + .../mapper/VSySydzOracleMapper.java | 16 + .../mapper/VillageSendRecordStaticMapper.java | 48 ++ .../mapper/VillageUserInfoMapper.java | 93 +++ .../schedule/ScheduleConfig.java | 18 + .../service/VSySydzMysqlService.java | 14 + .../service/VSySydzOracleService.java | 14 + .../service/VillageUserInfoService.java | 65 +++ .../service/impl/VSySydzMysqlServiceImpl.java | 31 + .../impl/VSySydzOracleServiceImpl.java | 30 + .../impl/VillageUserInfoServiceImpl.java | 119 ++++ .../ssf/mysqloracletest/task/VSySydzTask.java | 114 ++++ .../mysqloracletest/utils/ConfigParam.java | 13 + .../com/ssf/mysqloracletest/utils/NumKit.java | 51 ++ .../utils/OrderedProperties.java | 43 ++ .../mysqloracletest/utils/PropertiesUtil.java | 189 ++++++ .../ssf/mysqloracletest/utils/StringKit.java | 203 +++++++ .../mysqloracletest/utils/safe/AESTools.java | 88 +++ .../utils/safe/AesConstant.java | 7 + .../utils/safe/Base64Tools.java | 116 ++++ .../utils/safe/SignAlgorithm.java | 64 +++ .../utils/safe/SignatureTools.java | 89 +++ .../mysqloracletest/utils/safe/TestAes.java | 18 + .../mysqloracletest/utils/safe/TestSign.java | 35 ++ src/main/resources/application.yml | 1 + src/main/resources/logback.xml | 93 +++ .../resources/mapper/VSySydzMysqlMapper.xml | 68 +++ .../resources/mapper/VSySydzOracleMapper.xml | 24 + .../mapper/VillageSendRecordStaticMapper.xml | 173 ++++++ .../mapper/VillageUserInfoMapper.xml | 537 ++++++++++++++++++ 42 files changed, 3573 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 config/application.properties create mode 100644 config/logback.xml create mode 100644 mvnw create mode 100644 mvnw.cmd create mode 100644 pom.xml create mode 100644 src/main/java/com/ssf/mysqloracletest/MysqlOracleTestApplication.java create mode 100644 src/main/java/com/ssf/mysqloracletest/domain/VSySydzMysql.java create mode 100644 src/main/java/com/ssf/mysqloracletest/domain/VSySydzOracle.java create mode 100644 src/main/java/com/ssf/mysqloracletest/domain/VillageSendRecordStatic.java create mode 100644 src/main/java/com/ssf/mysqloracletest/domain/VillageUserInfo.java create mode 100644 src/main/java/com/ssf/mysqloracletest/mapper/VSySydzMysqlMapper.java create mode 100644 src/main/java/com/ssf/mysqloracletest/mapper/VSySydzOracleMapper.java create mode 100644 src/main/java/com/ssf/mysqloracletest/mapper/VillageSendRecordStaticMapper.java create mode 100644 src/main/java/com/ssf/mysqloracletest/mapper/VillageUserInfoMapper.java create mode 100644 src/main/java/com/ssf/mysqloracletest/schedule/ScheduleConfig.java create mode 100644 src/main/java/com/ssf/mysqloracletest/service/VSySydzMysqlService.java create mode 100644 src/main/java/com/ssf/mysqloracletest/service/VSySydzOracleService.java create mode 100644 src/main/java/com/ssf/mysqloracletest/service/VillageUserInfoService.java create mode 100644 src/main/java/com/ssf/mysqloracletest/service/impl/VSySydzMysqlServiceImpl.java create mode 100644 src/main/java/com/ssf/mysqloracletest/service/impl/VSySydzOracleServiceImpl.java create mode 100644 src/main/java/com/ssf/mysqloracletest/service/impl/VillageUserInfoServiceImpl.java create mode 100644 src/main/java/com/ssf/mysqloracletest/task/VSySydzTask.java create mode 100644 src/main/java/com/ssf/mysqloracletest/utils/ConfigParam.java create mode 100644 src/main/java/com/ssf/mysqloracletest/utils/NumKit.java create mode 100644 src/main/java/com/ssf/mysqloracletest/utils/OrderedProperties.java create mode 100644 src/main/java/com/ssf/mysqloracletest/utils/PropertiesUtil.java create mode 100644 src/main/java/com/ssf/mysqloracletest/utils/StringKit.java create mode 100644 src/main/java/com/ssf/mysqloracletest/utils/safe/AESTools.java create mode 100644 src/main/java/com/ssf/mysqloracletest/utils/safe/AesConstant.java create mode 100644 src/main/java/com/ssf/mysqloracletest/utils/safe/Base64Tools.java create mode 100644 src/main/java/com/ssf/mysqloracletest/utils/safe/SignAlgorithm.java create mode 100644 src/main/java/com/ssf/mysqloracletest/utils/safe/SignatureTools.java create mode 100644 src/main/java/com/ssf/mysqloracletest/utils/safe/TestAes.java create mode 100644 src/main/java/com/ssf/mysqloracletest/utils/safe/TestSign.java create mode 100644 src/main/resources/application.yml create mode 100644 src/main/resources/logback.xml create mode 100644 src/main/resources/mapper/VSySydzMysqlMapper.xml create mode 100644 src/main/resources/mapper/VSySydzOracleMapper.xml create mode 100644 src/main/resources/mapper/VillageSendRecordStaticMapper.xml create mode 100644 src/main/resources/mapper/VillageUserInfoMapper.xml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..153c933 --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +HELP.md +/target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +/build/ + +### VS Code ### +.vscode/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..1de2fb2 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# mysql-oracle-dynamic-datasource +SpringBoot集成MyBatis-Plus动态数据源测试,同时集成Mysql和Oracle +射阳源数据表接入 diff --git a/config/application.properties b/config/application.properties new file mode 100644 index 0000000..c7ce1c1 --- /dev/null +++ b/config/application.properties @@ -0,0 +1,4 @@ +#ʵеַ봦 +sydzSwitch=false +#βѯ +oncesCounts=10000 diff --git a/config/logback.xml b/config/logback.xml new file mode 100644 index 0000000..630449f --- /dev/null +++ b/config/logback.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/sys-info.log + + + + ${log.path}/sys-info.%d{yyyy-MM-dd}.log + + 7 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/sys-error.log + + + + ${log.path}/sys-error.%d{yyyy-MM-dd}.log + + 7 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + ${log.path}/sys-user.log + + + ${log.path}/sys-user.%d{yyyy-MM-dd}.log + + 7 + + + ${log.pattern} + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/mvnw b/mvnw new file mode 100644 index 0000000..8b9da3b --- /dev/null +++ b/mvnw @@ -0,0 +1,286 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven2 Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" + # TODO classpath? +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + wget "$jarUrl" -O "$wrapperJarPath" + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + curl -o "$wrapperJarPath" "$jarUrl" + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 0000000..fef5a8f --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,161 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven2 Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.4.2/maven-wrapper-0.4.2.jar" +FOR /F "tokens=1,2 delims==" %%A IN (%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties) DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + echo Found %WRAPPER_JAR% +) else ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + powershell -Command "(New-Object Net.WebClient).DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')" + echo Finished downloading %WRAPPER_JAR% +) +@REM End of extension + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..f71549e --- /dev/null +++ b/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.1.4.RELEASE + + + com.ssf + dataCompareSy + 0.0.1-SNAPSHOT + + Demo project for Spring Boot + + + 1.8 + + + + + + org.springframework.boot + spring-boot-starter-web + + + com.baomidou + mybatis-plus-boot-starter + 3.1.1 + + + + com.baomidou + dynamic-datasource-spring-boot-starter + 2.5.4 + + + + mysql + mysql-connector-java + runtime + + + + com.oracle + ojdbc6 + 11.2.0.3 + + + + + + + + + org.springframework.boot + spring-boot-starter-web + + + + + + org.projectlombok + lombok + true + + + + com.alibaba + fastjson + 1.2.4 + + + + + cn.hutool + hutool-all + 5.8.16 + + + + + org.apache.commons + commons-lang3 + 3.6 + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + + + + + diff --git a/src/main/java/com/ssf/mysqloracletest/MysqlOracleTestApplication.java b/src/main/java/com/ssf/mysqloracletest/MysqlOracleTestApplication.java new file mode 100644 index 0000000..de6f34b --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/MysqlOracleTestApplication.java @@ -0,0 +1,24 @@ +package com.ssf.mysqloracletest; + +import org.mybatis.spring.annotation.MapperScan; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; + +@SpringBootApplication +@MapperScan("com.ssf.mysqloracletest.mapper") +@EnableScheduling +@EnableAsync(proxyTargetClass = true) +public class MysqlOracleTestApplication { + private static final Logger logger = LoggerFactory.getLogger(MysqlOracleTestApplication.class); + + public static void main(String[] args) { + SpringApplication.run(MysqlOracleTestApplication.class, args); + logger.info("---历史版本号--:1.0.0,版本描述初始化项目"); + logger.info("---当前版本号--:1.0.1,实有人口接入,标准地址接入处理,居住证图片接入处理,实有人口补充图片处理,根据 住户信息表里面没有图片的记录,去查户籍表的原始orcl表,有记录则回填到实有人口表里面"); + } + +} diff --git a/src/main/java/com/ssf/mysqloracletest/domain/VSySydzMysql.java b/src/main/java/com/ssf/mysqloracletest/domain/VSySydzMysql.java new file mode 100644 index 0000000..1c8ebf1 --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/domain/VSySydzMysql.java @@ -0,0 +1,22 @@ +package com.ssf.mysqloracletest.domain; + +import lombok.Data; + +@Data +public class VSySydzMysql { + + /** + * 主键 + */ + private String DZDXMC; + private String CJSJ; + private String ZRQDM; + private String JDZB; + private String WDZB; + + private String DZDXTYMC; + private String SJDZYSID; + private String DZYSID; + +} + diff --git a/src/main/java/com/ssf/mysqloracletest/domain/VSySydzOracle.java b/src/main/java/com/ssf/mysqloracletest/domain/VSySydzOracle.java new file mode 100644 index 0000000..5e6828c --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/domain/VSySydzOracle.java @@ -0,0 +1,22 @@ +package com.ssf.mysqloracletest.domain; + +import lombok.Data; + +@Data +public class VSySydzOracle { + + /** + * 主键 + */ + private String DZDXMC; + private String CJSJ; + private String ZRQDM; + private String JDZB; + private String WDZB; + + private String DZDXTYMC; + private String SJDZYSID; + private String DZYSID; + +} + diff --git a/src/main/java/com/ssf/mysqloracletest/domain/VillageSendRecordStatic.java b/src/main/java/com/ssf/mysqloracletest/domain/VillageSendRecordStatic.java new file mode 100644 index 0000000..efedc99 --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/domain/VillageSendRecordStatic.java @@ -0,0 +1,30 @@ +package com.ssf.mysqloracletest.domain; + +import lombok.Data; + +/** + * village_send_vehicle_record + * 形体抓拍转发记录表 + */ +@Data +public class VillageSendRecordStatic { + private String id; + private String villageCode; + private String villageName; + private String deviceCode; + private String tableName; + private String tableId; + private String sendTime; + private String receiveTime; + private String manufactorNo; + private String receiptId; + private String resultStatus; + private String resultRemark; + private String isactive; + private String c1; + private String c2; + private String c3; + private String c4; + private String c5; + +} diff --git a/src/main/java/com/ssf/mysqloracletest/domain/VillageUserInfo.java b/src/main/java/com/ssf/mysqloracletest/domain/VillageUserInfo.java new file mode 100644 index 0000000..14811af --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/domain/VillageUserInfo.java @@ -0,0 +1,397 @@ +package com.ssf.mysqloracletest.domain; + +import com.alibaba.fastjson.JSONObject; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * 住户信息对象 village_user_info + * + * @author ruoyi + */ +@Data +public class VillageUserInfo { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private Long id; + + /** + * 小区编码 + */ + private String villageCode; + + /** + * 小区名称 + */ + //@Excel(name = "小区名称*") + private String villageName; + /** + * 网格名称 + */ + //@Excel(name = "网格名称*") + private String gridName; + /** + * 楼栋名称 + */ + //@Excel(name = "楼栋名称*") + private String buildingName; + /** + * 单元名称 + */ + //@Excel(name = "单元名称*") + private String unitName; + /** + * 房屋名称 + */ + //@Excel(name = "房屋名称*") + private String homeName; + + /** + * 人员姓名 + */ + //@Excel(name = "住户姓名*") + private String userName; + /** + * 人员类型 + */ + //@Excel(name = "人员类型*", comboWt = "person_type") + private String personTypeCn; + /** + * 证件类型 + */ + //@Excel(name = "证件类型", comboWt = "identity_type") + private String identityTypeCn; + /** + * 证件号码 + */ + //@Excel(name = "证件号码*") + private String idcard; + /** + * 人员类别 + */ + //@Excel(name = "人员类别*", comboWt = "person_category") + private String personCategoryCn; + + /** + * 联系电话 + */ + //@Excel(name = "联系电话") + private String phone; + /** + * 出生日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + //@Excel(name = "出生日期", width = 30, dateFormat = "yyyy-MM-dd") + private Date birthday; + /** + * 关爱人员标签 + */ + //@Excel(name = "关爱人员标签", comboWt = "caring_label") + private String caringLabelCn; + /** + * 是否户主 + */ + //@Excel(name = "是否户主*", comboWt = "is_householder") + private String isHouseholderCn; + /** + * 与户主关系 + */ + //@Excel(name = "与户主关系*", comboWt = "householder_relation") + private String householderRelationCn; + /** + * 性别 + */ + //@Excel(name = "性别", comboWt = "sex") + private String sexCn; + //@Excel(name = "民族", comboWt = "nation") + private String nationCn; + /** + * 国籍 + */ + //@Excel(name = "国籍", comboWt = "nationality") + private String nationalityCn; + + /** + * 籍贯 + */ + //@Excel(name = "籍贯" ) + private String nativeplace; + /** + * 学历 + */ + //@Excel(name = "学历", comboWt = "education") + private String educationCn; + /** + * 政治面貌 + */ + //@Excel(name = "政治面貌", comboWt = "political_outlook") + private String politicalOutlookCn; + + /** + * 户籍 + */ + //@Excel(name = "户籍") + private String houseHoldRegister; + + /** + * 户籍地址 + */ + //@Excel(name = "户籍地址") + private String houseHoldAddress; + + /** + * 宗教信仰 + */ + //@Excel(name = "宗教信仰") + private String religious; + + + /** + * 网格编码 + */ + private String gridCode; + + /** + * 楼栋编号 + */ + private String buildingCode; + + + /** + * 单元编码 + */ + private String unitCode; + + + /** + * 房屋编码 + */ + private String homeCode; + + /** + * 人员照片 + */ + private String userPic; + + /** + * 常口库标准照片 + */ + private String userStandardPic; + //标准图片是空参数 + private String userStandardPicIsNull; + + /** + * 证件类型 + */ + private Integer identityType; + + + private String idcardCn; + + /** + * 性别 + */ + private Integer sex; + + + /** + * 民族 + */ + private Integer nation; + + /** + * 公司名称 + */ +// //@Excel(name = "公司名称") + private String company; + + private String phoneCn; + + /** + * 国籍 + */ + private Integer nationality; + + + /** + * 学历 + */ + private Integer education; + + + /** + * 现居行政区编码 + */ +// //@Excel(name = "现居行政区编码") + private String areaCode; + + /** + * 现居行政区名称 + */ +// //@Excel(name = "现居行政区名称") + private String areaName; + + /** + * 实际居住地 + */ +// //@Excel(name = "实际居住地") + private String habitation; + + + /** + * 政治面貌 + */ + private Integer politicalOutlook; + + + /** + * 入境时间 + */ +// //@Excel(name = "入境时间") + private Long entryTime; + + /** + * 婚姻状况 + */ + private Integer marriage; + /** + * 婚姻状况 + */ +// //@Excel(name = "婚姻状况", comboWt = "marriage") + private String marriageCn; + + /** + * 人员类型 + */ + private Integer personType; + + + /** + * 人员类别 + */ + private Integer personCategory; + + + /** + * 关爱人员标签 + */ + private Integer caringLabel; + + + /** + * 是否户主 + */ + private Integer isHouseholder; + + + /** + * 与户主关系 + */ + private Integer householderRelation; + + /** + * 是否接种疫苗 + */ + private Integer isVaccinate; + /** + * 是否接种疫苗 + */ + private String isVaccinateCn; + + /** + * 是否接种第一针疫苗 + */ + private Integer isFirstVaccinate; + /** + * 是否接种第一针疫苗 + */ + private String isFirstVaccinateCn; + + /** + * 是否接种第二针疫苗 + */ + private Integer isSecondVaccinate; + /** + * 是否接种第二针疫苗 + */ + private String isSecondVaccinateCn; + + /** + * 是否接种第三针疫苗 + */ + private Integer isThirdVaccinate; + /** + * 是否接种第三针疫苗 + */ + private String isThirdVaccinateCn; + + private String createtime; + private String createby; + private String updatetime; + private String updateby; + /** + * 0:不活跃,1:活跃 + */ + private Integer isactive; + + /** + * 扩展字段c1 + */ + private String c1; + private String c1Cn; + //更新version字段 + private String c2New; + + /** + * 扩展字段c2 + */ + private String c2; + + /** + * 扩展字段c3 + */ + private String c3; + + /** + * 扩展字段c4 + */ + private String c4; + + /** + * 扩展字段c5 + */ + private String c5; + + private String idsIn; + + private String idcardDesensitization; + + private String phoneDesensitization; + //重点人类型 + private String impUserType; + //多个重点人类型标签 + private JSONObject impUserTypes; + private String impUserTypeCn; + + private String imsi; + + private Boolean isExport; + //人员全息 规则 排序字段: 有图且打好标记的最优先展示 + private String orderByTomany; + /** + * 可信度 + */ + private String reliability; + + //是否重点人 + private String isImpUser; + + //是否全息档案请求 + private String enabledArchives; + +} diff --git a/src/main/java/com/ssf/mysqloracletest/mapper/VSySydzMysqlMapper.java b/src/main/java/com/ssf/mysqloracletest/mapper/VSySydzMysqlMapper.java new file mode 100644 index 0000000..9095e83 --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/mapper/VSySydzMysqlMapper.java @@ -0,0 +1,15 @@ +package com.ssf.mysqloracletest.mapper; + + +import com.ssf.mysqloracletest.domain.VSySydzMysql; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface VSySydzMysqlMapper { + + public VSySydzMysql selectVSySydzById(String id); + + public int insertVSySydz(VSySydzMysql bean); + + public int updateVSySydzById(VSySydzMysql bean); +} \ No newline at end of file diff --git a/src/main/java/com/ssf/mysqloracletest/mapper/VSySydzOracleMapper.java b/src/main/java/com/ssf/mysqloracletest/mapper/VSySydzOracleMapper.java new file mode 100644 index 0000000..ddeb1cf --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/mapper/VSySydzOracleMapper.java @@ -0,0 +1,16 @@ +package com.ssf.mysqloracletest.mapper; + + +import com.ssf.mysqloracletest.domain.VSySydzOracle; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +@Mapper +public interface VSySydzOracleMapper { + public int countSydz(); + + public List getSydzList(Map map); + +} \ No newline at end of file diff --git a/src/main/java/com/ssf/mysqloracletest/mapper/VillageSendRecordStaticMapper.java b/src/main/java/com/ssf/mysqloracletest/mapper/VillageSendRecordStaticMapper.java new file mode 100644 index 0000000..09a0c6d --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/mapper/VillageSendRecordStaticMapper.java @@ -0,0 +1,48 @@ +package com.ssf.mysqloracletest.mapper; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.ssf.mysqloracletest.domain.VillageSendRecordStatic; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +@Mapper +@DS("mysql") +public interface VillageSendRecordStaticMapper { + /** + * 插入一条记录 + * + * @return + */ + int insertRecord(VillageSendRecordStatic villageSendRecordStatic); + + /** + * 批量插入 + * + * @return + */ + int insertRecords(List villageSendRecordStatic); + + /** + * 单条更新 + * + * @return + */ + int updateRecord(VillageSendRecordStatic villageSendRecordStatic); + + int updateRecordByTableId(VillageSendRecordStatic villageSendRecordStatic); + + /** + * 查询车辆转发记录表中指定厂家,小区,表,设备,最大的一条已转发记录 + * + * @param map + * @return + */ + Long getMaxTableIdFromVillageSendRecordStatic(Map map); + + /** + * + */ + public List getList(Map map); +} diff --git a/src/main/java/com/ssf/mysqloracletest/mapper/VillageUserInfoMapper.java b/src/main/java/com/ssf/mysqloracletest/mapper/VillageUserInfoMapper.java new file mode 100644 index 0000000..1b88202 --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/mapper/VillageUserInfoMapper.java @@ -0,0 +1,93 @@ +package com.ssf.mysqloracletest.mapper; + +import com.ssf.mysqloracletest.domain.VillageUserInfo; + +import java.util.List; +import java.util.Map; + +/** + * 住户信息Mapper接口 + * + * @author ruoyi + * @date 2022-05-17 + */ +public interface VillageUserInfoMapper { + /** + * 查询住户信息 + * + * @param id 住户信息主键 + * @return 住户信息 + */ + public VillageUserInfo selectVillageUserInfoById(Long id); + + public VillageUserInfo selectVillageUserInfoByIdcard(String id); + + /** + * 查询住户信息列表 + * + * @param villageUserInfo 住户信息 + * @return 住户信息集合 + */ + public List selectVillageUserInfoList(VillageUserInfo villageUserInfo); + + /** + * 查询住户信息列表 + * + * @param villageUserInfo 住户信息 + * @return 住户信息集合 + */ + public List archivesList(VillageUserInfo villageUserInfo); + + /** + * 新增住户信息 + * + * @param villageUserInfo 住户信息 + * @return 结果 + */ + public int insertVillageUserInfo(VillageUserInfo villageUserInfo); + + public int saveOrUpdate(VillageUserInfo villageUserInfo); + + /** + * 修改住户信息 + * + * @param villageUserInfo 住户信息 + * @return 结果 + */ + public int updateVillageUserInfo(VillageUserInfo villageUserInfo); + + public int updateVillageUserInfoByIdcard(VillageUserInfo bean); + + /** + * 删除住户信息 + * + * @param id 住户信息主键 + * @return 结果 + */ + public int deleteVillageUserInfoById(Long id); + + public int deleteVillageUserInfoByUpdatetime(VillageUserInfo bean); + + /** + * 批量删除住户信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteVillageUserInfoByIds(String[] ids); + + /** + * 逻辑删除 + */ + public int logicDelete(Map map); + + /** + * 模型:疑似居住未登记人员功能模块使用 + */ + public int deleteVillageUserInfo(Map map); + + + public List userArchivesTask(VillageUserInfo userInfo); + + public List userArchivesTaskNotIn(VillageUserInfo userInfo); +} diff --git a/src/main/java/com/ssf/mysqloracletest/schedule/ScheduleConfig.java b/src/main/java/com/ssf/mysqloracletest/schedule/ScheduleConfig.java new file mode 100644 index 0000000..7375fae --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/schedule/ScheduleConfig.java @@ -0,0 +1,18 @@ +package com.ssf.mysqloracletest.schedule; + +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.SchedulingConfigurer; +import org.springframework.scheduling.config.ScheduledTaskRegistrar; + +import java.util.concurrent.Executors; + +@Configuration +@EnableScheduling +public class ScheduleConfig implements SchedulingConfigurer { + + @Override + public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { + taskRegistrar.setScheduler(Executors.newScheduledThreadPool(30)); + } +} diff --git a/src/main/java/com/ssf/mysqloracletest/service/VSySydzMysqlService.java b/src/main/java/com/ssf/mysqloracletest/service/VSySydzMysqlService.java new file mode 100644 index 0000000..8cd471f --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/service/VSySydzMysqlService.java @@ -0,0 +1,14 @@ +package com.ssf.mysqloracletest.service; + +import com.ssf.mysqloracletest.domain.VSySydzMysql; + +public interface VSySydzMysqlService { + + public VSySydzMysql selectVSySydzById(String id); + + public int insertVSySydz(VSySydzMysql sydz); + + public int updateVSySydzById(VSySydzMysql sydz); + + +} diff --git a/src/main/java/com/ssf/mysqloracletest/service/VSySydzOracleService.java b/src/main/java/com/ssf/mysqloracletest/service/VSySydzOracleService.java new file mode 100644 index 0000000..9f8920e --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/service/VSySydzOracleService.java @@ -0,0 +1,14 @@ +package com.ssf.mysqloracletest.service; + +import com.ssf.mysqloracletest.domain.VSySydzOracle; + +import java.util.List; +import java.util.Map; + +public interface VSySydzOracleService { + + public int countSydz(); + + public List getSydzList(Map map); + +} diff --git a/src/main/java/com/ssf/mysqloracletest/service/VillageUserInfoService.java b/src/main/java/com/ssf/mysqloracletest/service/VillageUserInfoService.java new file mode 100644 index 0000000..77913d7 --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/service/VillageUserInfoService.java @@ -0,0 +1,65 @@ +package com.ssf.mysqloracletest.service; + +import com.ssf.mysqloracletest.domain.VillageUserInfo; + +import java.util.List; + +/** + * 住户信息Service接口 + * + * @author ruoyi + * @date 2022-05-17 + */ +public interface VillageUserInfoService { + /** + * 查询住户信息 + * + * @param id 住户信息主键 + * @return 住户信息 + */ + public VillageUserInfo selectVillageUserInfoById(Long id); + + /** + * 查询住户信息列表 + * + * @param villageUserInfo 住户信息 + * @return 住户信息集合 + */ + public List selectVillageUserInfoList(VillageUserInfo villageUserInfo); + + public VillageUserInfo selectVillageUserInfoByIdcard(String idcard); + + /** + * 新增住户信息 + * + * @param villageUserInfo 住户信息 + * @return 结果 + */ + public int insertVillageUserInfo(VillageUserInfo villageUserInfo); + + /** + * 修改住户信息 + * + * @param villageUserInfo 住户信息 + * @return 结果 + */ + public int updateVillageUserInfo(VillageUserInfo villageUserInfo); + + /** + * 批量删除住户信息 + * + * @param ids 需要删除的住户信息主键集合 + * @return 结果 + */ + + public int updateVillageUserInfoByIdcard(VillageUserInfo bean); + + /** + * 删除住户信息信息 + * + * @param id 住户信息主键 + * @return 结果 + */ + public int deleteVillageUserInfoById(Long id); + +} diff --git a/src/main/java/com/ssf/mysqloracletest/service/impl/VSySydzMysqlServiceImpl.java b/src/main/java/com/ssf/mysqloracletest/service/impl/VSySydzMysqlServiceImpl.java new file mode 100644 index 0000000..efd9120 --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/service/impl/VSySydzMysqlServiceImpl.java @@ -0,0 +1,31 @@ +package com.ssf.mysqloracletest.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.ssf.mysqloracletest.domain.VSySydzMysql; +import com.ssf.mysqloracletest.mapper.VSySydzMysqlMapper; +import com.ssf.mysqloracletest.service.VSySydzMysqlService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@DS("mysql") +@RequiredArgsConstructor +public class VSySydzMysqlServiceImpl implements VSySydzMysqlService { + + private final VSySydzMysqlMapper sySydzMysqlMapper; + + @Override + public VSySydzMysql selectVSySydzById(String id) { + return sySydzMysqlMapper.selectVSySydzById(id); + } + + @Override + public int insertVSySydz(VSySydzMysql bean) { + return sySydzMysqlMapper.insertVSySydz(bean); + } + + @Override + public int updateVSySydzById(VSySydzMysql bean) { + return sySydzMysqlMapper.updateVSySydzById(bean); + } +} diff --git a/src/main/java/com/ssf/mysqloracletest/service/impl/VSySydzOracleServiceImpl.java b/src/main/java/com/ssf/mysqloracletest/service/impl/VSySydzOracleServiceImpl.java new file mode 100644 index 0000000..0567149 --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/service/impl/VSySydzOracleServiceImpl.java @@ -0,0 +1,30 @@ +package com.ssf.mysqloracletest.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.ssf.mysqloracletest.domain.VSySydzOracle; +import com.ssf.mysqloracletest.mapper.VSySydzOracleMapper; +import com.ssf.mysqloracletest.service.VSySydzOracleService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +@Service +@DS("oracleSydz") +public class VSySydzOracleServiceImpl implements VSySydzOracleService { + + @Resource + private VSySydzOracleMapper oracleMapper; + + @Override + public int countSydz() { + return oracleMapper.countSydz(); + } + + @Override + public List getSydzList(Map map) { + return oracleMapper.getSydzList(map); + } + +} diff --git a/src/main/java/com/ssf/mysqloracletest/service/impl/VillageUserInfoServiceImpl.java b/src/main/java/com/ssf/mysqloracletest/service/impl/VillageUserInfoServiceImpl.java new file mode 100644 index 0000000..fe6be12 --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/service/impl/VillageUserInfoServiceImpl.java @@ -0,0 +1,119 @@ +package com.ssf.mysqloracletest.service.impl; + +import com.baomidou.dynamic.datasource.annotation.DS; +import com.ssf.mysqloracletest.domain.VillageUserInfo; +import com.ssf.mysqloracletest.mapper.VillageUserInfoMapper; +import com.ssf.mysqloracletest.service.VillageUserInfoService; +import com.ssf.mysqloracletest.utils.NumKit; +import com.ssf.mysqloracletest.utils.StringKit; +import lombok.RequiredArgsConstructor; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 住户信息Service业务层处理 + * + * @author ruoyi + */ +@Service +@RequiredArgsConstructor +@DS("mysql") +public class VillageUserInfoServiceImpl implements VillageUserInfoService { + private static final Logger logger = LoggerFactory.getLogger(VillageUserInfoServiceImpl.class); + private final VillageUserInfoMapper villageUserInfoMapper; + + /** + * 查询住户信息 + * + * @param id 住户信息主键 + * @return 住户信息 + */ + @Override + public VillageUserInfo selectVillageUserInfoById(Long id) { + VillageUserInfo v = villageUserInfoMapper.selectVillageUserInfoById(id); + return v; + } + + /** + * 查询住户信息列表 + * + * @param villageUserInfo 住户信息 + * @return 住户信息 + */ + @Override + public List selectVillageUserInfoList(VillageUserInfo villageUserInfo) { + //查询之前加密 + List list = villageUserInfoMapper.selectVillageUserInfoList(villageUserInfo); + return list; + } + + + /** + * 新增住户信息 + * + * @param villageUserInfo 住户信息 + * @return 结果 + */ + @Override + public int insertVillageUserInfo(VillageUserInfo villageUserInfo) { + try { + return villageUserInfoMapper.insertVillageUserInfo(villageUserInfo); + } catch (Exception e) { + logger.info(StringKit.getTrace(e)); + return 0; + } + } + + + /** + * 修改住户信息 + * + * @param villageUserInfo 住户信息 + * @return 结果 + */ + @Override + public int updateVillageUserInfo(VillageUserInfo villageUserInfo) { + try { + return villageUserInfoMapper.updateVillageUserInfo(villageUserInfo); + } catch (Exception e) { + logger.info(StringKit.getTrace(e)); + return 0; + } + } + + @Override + public VillageUserInfo selectVillageUserInfoByIdcard(String idcard) { + VillageUserInfo v = villageUserInfoMapper.selectVillageUserInfoByIdcard(idcard); + return v; + } + + + @Override + public int updateVillageUserInfoByIdcard(VillageUserInfo bean) { + VillageUserInfo beanCheck = selectVillageUserInfoByIdcard(bean.getIdcard()); + String versionCheck = StringKit.toString(beanCheck.getC2()); + String c2 = "".equals(bean.getC2()) ? "1" : bean.getC2(); + int version = NumKit.checkInt(c2); + bean.setC2(StringKit.toString(version)); + bean.setC2New(StringKit.toString(version + 1)); + if ("".equals(versionCheck) || c2.equals(versionCheck)) { + return villageUserInfoMapper.updateVillageUserInfoByIdcard(bean); + } + return 0; + } + + + /** + * 删除住户信息信息 + * + */ + @Override + public int deleteVillageUserInfoById(Long id) { + return villageUserInfoMapper.deleteVillageUserInfoById(id); + } + + +} diff --git a/src/main/java/com/ssf/mysqloracletest/task/VSySydzTask.java b/src/main/java/com/ssf/mysqloracletest/task/VSySydzTask.java new file mode 100644 index 0000000..424e390 --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/task/VSySydzTask.java @@ -0,0 +1,114 @@ +package com.ssf.mysqloracletest.task; + +import com.ssf.mysqloracletest.domain.VSySydzMysql; +import com.ssf.mysqloracletest.domain.VSySydzOracle; +import com.ssf.mysqloracletest.service.VSySydzMysqlService; +import com.ssf.mysqloracletest.service.VSySydzOracleService; +import com.ssf.mysqloracletest.utils.ConfigParam; +import com.ssf.mysqloracletest.utils.NumKit; +import com.ssf.mysqloracletest.utils.StringKit; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +/** + * 灌云 用户数据接入 + */ +@Component +public class VSySydzTask { + + private static final Logger logger = LoggerFactory.getLogger(VSySydzTask.class); + + @Resource + private VSySydzMysqlService sydzMysqlService; + + @Resource + private VSySydzOracleService sydzOracleService; + + final int oncesCounts = NumKit.checkInt(ConfigParam.oncesCounts) == 0 ? 1000 : NumKit.checkInt(ConfigParam.oncesCounts); + + private boolean sydzTag = false; + + /** + * 连云港 对接海康平台获取人员基础数据 + * // + */ + @Scheduled(initialDelay = 100, fixedDelay = 3000) + public void transSydz() { + + if (sydzTag) { + return; + } + + if (!"true".equals(ConfigParam.sydzSwitch)) { + return; + } + + + try { + int countSydz = sydzOracleService.countSydz(); + logger.info("countSydz:" + countSydz); + + if (countSydz > 0) { + + sydzTag = true; + + int count = countSydz / oncesCounts; + CountDownLatch latch = new CountDownLatch(count); + ExecutorService sydzPool = Executors.newFixedThreadPool(50); + + for (int i = 0; i <= count; i++) { + Map sydzMap = new HashMap(); + sydzMap.put("rowStart", i * oncesCounts); + sydzMap.put("rowEnd", (i + 1) * oncesCounts); + sydzPool.submit(() -> { + try { + List sydzs = sydzOracleService.getSydzList(sydzMap); + for (VSySydzOracle sydz : sydzs) { + VSySydzMysql sBean = new VSySydzMysql(); + BeanUtils.copyProperties(sydz, sBean); + //确定一个数据是否唯一 + VSySydzMysql checkSydz = sydzMysqlService.selectVSySydzById(sydz.getDZDXMC()); + if (checkSydz == null) { + sydzMysqlService.insertVSySydz(sBean); + logger.info("sydz-" + sydz.getDZDXMC() + ":插入成功"); + } else { + sydzMysqlService.updateVSySydzById(sBean); + logger.info("sydz-" + sydz.getSJDZYSID() + ":更新成功"); + } + } + } catch (Exception e) { + logger.info("sydzs:" + e.getMessage()); + } + latch.countDown(); + }); + logger.info("sydzMap数据总量:" + countSydz + "," + "当前处理下标:" + sydzMap.get("rowStart") + "/" + sydzMap.get("rowEnd")); + } + + try { + // Wait for all threads to complete + latch.await(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + // 关闭线程池 + sydzPool.shutdown(); + } + + } catch (Exception e) { + logger.info(StringKit.getTrace(e)); + } + } + + +} diff --git a/src/main/java/com/ssf/mysqloracletest/utils/ConfigParam.java b/src/main/java/com/ssf/mysqloracletest/utils/ConfigParam.java new file mode 100644 index 0000000..4710305 --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/utils/ConfigParam.java @@ -0,0 +1,13 @@ +package com.ssf.mysqloracletest.utils; + +import org.springframework.stereotype.Component; + +import java.io.File; + +@Component +public class ConfigParam { + + public static String seq = File.separator; + public static String sydzSwitch = StringKit.toString(PropertiesUtil.queryPropertiesByKey("sydzSwitch")); + public static String oncesCounts = StringKit.toString(PropertiesUtil.queryPropertiesByKey("oncesCounts")); +} diff --git a/src/main/java/com/ssf/mysqloracletest/utils/NumKit.java b/src/main/java/com/ssf/mysqloracletest/utils/NumKit.java new file mode 100644 index 0000000..14a171f --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/utils/NumKit.java @@ -0,0 +1,51 @@ +package com.ssf.mysqloracletest.utils; + +import java.math.BigDecimal; + +public class NumKit { + + public NumKit() { + } + + + public static Double checkDouble(String num) { + try { + Double i = Double.valueOf(num); + return i; + } catch (Exception var3) { + } + + return 0D; + } + + public static Integer checkInt(String num) { + try { + Integer i = Integer.valueOf(num); + return i; + } catch (Exception var3) { + } + return 0; + } + + public static Long checkLong(String num) { + try { + Long i = Long.valueOf(num); + return i; + } catch (Exception var3) { + } + return 0L; + } + + public static BigDecimal checkBigDecimal(String num) { + try { + BigDecimal bd = new BigDecimal(num); + return bd; + } catch (Exception var3) { + } + return null; + } + + + + +} diff --git a/src/main/java/com/ssf/mysqloracletest/utils/OrderedProperties.java b/src/main/java/com/ssf/mysqloracletest/utils/OrderedProperties.java new file mode 100644 index 0000000..ff68b29 --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/utils/OrderedProperties.java @@ -0,0 +1,43 @@ +package com.ssf.mysqloracletest.utils; + +import java.util.*; + +/** + * OrderedProperties + * + * @author Unmi + * @date 2012-12-07 + */ +public class OrderedProperties extends Properties { + + private static final long serialVersionUID = -4627607243846121965L; + + private final LinkedHashSet keys = new LinkedHashSet(); + + @Override + public Enumeration keys() { + return Collections.enumeration(keys); + } + + @Override + public Object put(Object key, Object value) { + keys.add(key); + return super.put(key, value); + } + + @Override + public Set keySet() { + return keys; + } + + @Override + public Set stringPropertyNames() { + Set set = new LinkedHashSet(); + + for (Object key : this.keys) { + set.add((String) key); + } + + return set; + } +} \ No newline at end of file diff --git a/src/main/java/com/ssf/mysqloracletest/utils/PropertiesUtil.java b/src/main/java/com/ssf/mysqloracletest/utils/PropertiesUtil.java new file mode 100644 index 0000000..bd5c035 --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/utils/PropertiesUtil.java @@ -0,0 +1,189 @@ +package com.ssf.mysqloracletest.utils; + + +import java.io.*; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; + +/** + * 读取Properties综合类,默认绑定到classpath下的config.properties文件。 + * + * @author 朱志杰 QQ:695520848 + */ +public class PropertiesUtil { + //配置文件的路径 + private String configPath = "config" + File.separator + "application.properties"; + public static final String Path = "config" + File.separator + "application.properties"; + + /** + * 配置文件对象 + */ + private Properties props = null; + + /** + * 默认构造函数,用于sh运行,自动找到classpath下的config.properties。 + */ + public PropertiesUtil() throws IOException { + InputStream in = PropertiesUtil.class.getClassLoader().getResourceAsStream("application.properties"); + props = new Properties(); + props.load(in); + //关闭资源 + in.close(); + } + + /** + * 根据key值读取配置的值 + * Jun 26, 2010 9:15:43 PM + * + * @param key key值 + * @return key 键对应的值 + * @throws IOException + * @author 朱志杰 + */ + public String readValue(String key) throws IOException { + return props.getProperty(key); + } + + /** + * 读取properties的全部信息 + * Jun 26, 2010 9:21:01 PM + * + * @throws FileNotFoundException 配置文件没有找到 + * @throws IOException 关闭资源文件,或者加载配置文件错误 + * @author 朱志杰 + */ + public Map readAllProperties() throws FileNotFoundException, IOException { + //保存所有的键值 + Map map = new HashMap(); + Enumeration en = props.propertyNames(); + while (en.hasMoreElements()) { + String key = (String) en.nextElement(); + String Property = props.getProperty(key); + map.put(key, Property); + } + return map; + } + + /** + * 设置某个key的值,并保存至文件。 + * Jun 26, 2010 9:15:43 PM + * + * @param key key值 + * @return key 键对应的值 + * @throws IOException + * @author 朱志杰 + */ + public void setValue(String key, String value) throws IOException { + Properties prop = new Properties(); + InputStream fis = new FileInputStream(this.configPath); + // 从输入流中读取属性列表(键和元素对) + prop.load(fis); + // 调用 Hashtable 的方法 put。使用 getProperty 方法提供并行性。 + // 强制要求为属性的键和值使用字符串。返回值是 Hashtable 调用 put 的结果。 + OutputStream fos = new FileOutputStream(this.configPath); + prop.setProperty(key, value); + // 以适合使用 load 方法加载到 Properties 表中的格式, + // 将此 Properties 表中的属性列表(键和元素对)写入输出流 + prop.store(fos, "last update"); + //关闭文件 + fis.close(); + fos.close(); + } + + /** + * 读取配置文件中key的对应值 + * + * @param key + * @return + */ + public static String queryPropertiesByKey(String key) { + if ("".equals(StringKit.toString(key))) { + return ""; + } + Properties properties = new Properties(); + // 使用InPutStream流读取properties文件 + BufferedReader bufferedReader = null; + try { + bufferedReader = new BufferedReader(new FileReader(Path)); + properties.load(bufferedReader); + String rel = properties.getProperty(key); + bufferedReader.close(); + // 获取key对应的value值 + return rel; + } catch (IOException e) { + if (null != bufferedReader) { + try { + bufferedReader.close(); + } catch (IOException e1) { + e1.printStackTrace(); + } + } + e.printStackTrace(); + } + if (null != bufferedReader) { + try { + bufferedReader.close(); + } catch (IOException e1) { + e1.printStackTrace(); + } + } + return ""; + } + + /** + * 设置配置文件key的value值 + * + * @param key + * @param value + */ + public static void setPropertiesByKey(String key, String value) { + File file = new File(Path); + OrderedProperties properties = new OrderedProperties(); + try { + properties.load(new FileInputStream(file)); + properties.setProperty(key, value); + //true表示追加打开 + FileOutputStream oFile = new FileOutputStream(Path); + properties.store(oFile, "The New properties file"); + oFile.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 读取配置文件中key的对应值 + * + * @param key + * @return + */ + public static String queryValue(String key) { + if ("".equals(StringKit.toString(key))) { + return ""; + } + Properties properties = new Properties(); + BufferedReader bufferedReader = null; + String rel = ""; + try { + bufferedReader = new BufferedReader(new FileReader(Path)); + properties.load(bufferedReader); + rel = StringKit.toString(properties.getProperty(key)); + bufferedReader.close(); + } catch (IOException e) { + e.printStackTrace(); + } finally { + if (null != bufferedReader) { + try { + bufferedReader.close(); + } catch (IOException e1) { + e1.printStackTrace(); + } + } + } + return rel; + } + + +} \ No newline at end of file diff --git a/src/main/java/com/ssf/mysqloracletest/utils/StringKit.java b/src/main/java/com/ssf/mysqloracletest/utils/StringKit.java new file mode 100644 index 0000000..289fac1 --- /dev/null +++ b/src/main/java/com/ssf/mysqloracletest/utils/StringKit.java @@ -0,0 +1,203 @@ +package com.ssf.mysqloracletest.utils; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.regex.Pattern; + +public class StringKit { + + public StringKit() { + } + + public static Boolean isEmpty(Object argObject) { + Boolean tbool = false; + String tString = toString(argObject); + if (tString.equals("")) { + tbool = true; + } + + return tbool; + } + + public static String toString(Object argObject) { + String tmpstr = ""; + try { + if (argObject != null) { + tmpstr = argObject.toString(); + tmpstr = tmpstr.trim(); + if( "null".equals(tmpstr) || "underfind".equals(tmpstr) || "undefined".equals(tmpstr) ){ + tmpstr=""; + } + } + } catch (Exception var3) { + } + + return tmpstr; + } + + @Deprecated + public static String toDefaultString(Object argObject) { + String tmpstr = "无"; + try { + if (argObject != null) { + tmpstr = argObject.toString(); + if( "null".equals(tmpstr) || "underfind".equals(tmpstr) || "undefined".equals(tmpstr) ){ + tmpstr="无"; + } + } + } catch (Exception var3) { + } + + return tmpstr; + } + + @Deprecated + public static String toDefaultInt(Object argObject) { + String tmpstr = "0"; + try { + if (argObject != null) { + tmpstr = argObject.toString(); + if( "null".equals(tmpstr) || "underfind".equals(tmpstr) || "undefined".equals(tmpstr) ){ + tmpstr="0"; + } + } + } catch (Exception var3) { + } + + return tmpstr; + } + + + public static boolean isNumeric(String str){ + Pattern pattern = Pattern.compile("[0-9]*"); + return pattern.matcher(str).matches(); + } + + public static boolean isEng(String str){ + Pattern pattern = Pattern.compile("[a-zA-Z]"); + return pattern.matcher(str).matches(); + } + + + public static String getTrace(Throwable t){ + + StringWriter stringWriter = new StringWriter(); + PrintWriter writer = new PrintWriter(stringWriter); + t.printStackTrace(writer); + StringBuffer buffer = stringWriter.getBuffer(); + return buffer.toString(); + } + + /** + * 检查某个字符串出现几次 + * @return + */ + public static Integer getStrCount(String str,String indexStr){ + + //java中判断一个字符出现的次数 + //在下面字符串中查找有几个啊 +// String str = "啊!我爱你中国!啊,我爱你故乡"; + //存放每个字符的数组 + String [] strs = new String[str.length()]; + //计数该字符出现了多少次 + int count = 0; + //先把字符串转换成数组 + for(int i = 0;i + + + + + + + + + + ${log.pattern} + + + + + + ${log.path}/sys-info.log + + + + ${log.path}/sys-info.%d{yyyy-MM-dd}.log + + 7 + + + ${log.pattern} + + + + INFO + + ACCEPT + + DENY + + + + + ${log.path}/sys-error.log + + + + ${log.path}/sys-error.%d{yyyy-MM-dd}.log + + 7 + + + ${log.pattern} + + + + ERROR + + ACCEPT + + DENY + + + + + + ${log.path}/sys-user.log + + + ${log.path}/sys-user.%d{yyyy-MM-dd}.log + + 7 + + + ${log.pattern} + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/VSySydzMysqlMapper.xml b/src/main/resources/mapper/VSySydzMysqlMapper.xml new file mode 100644 index 0000000..e5b960a --- /dev/null +++ b/src/main/resources/mapper/VSySydzMysqlMapper.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + insert into v_sy_sydz + + DZDXMC, + CJSJ, + ZRQDM, + JDZB, + WDZB, + + DZDXTYMC, + SJDZYSID, + DZYSID, + + + + #{DZDXMC}, + #{CJSJ}, + #{ZRQDM}, + #{JDZB}, + #{WDZB}, + + #{DZDXTYMC}, + #{SJDZYSID}, + #{DZYSID}, + + + + + update v_sy_sydz + + DZDXMC = #{DZDXMC}, + CJSJ = #{CJSJ}, + ZRQDM = #{ZRQDM}, + JDZB = #{JDZB}, + WDZB = #{WDZB}, + + DZDXTYMC = #{DZDXTYMC}, + DZYSID = #{DZYSID}, + SJDZYSID = #{SJDZYSID}, + + where DZDXMC = #{DZDXMC} + + + \ No newline at end of file diff --git a/src/main/resources/mapper/VSySydzOracleMapper.xml b/src/main/resources/mapper/VSySydzOracleMapper.xml new file mode 100644 index 0000000..67b1aea --- /dev/null +++ b/src/main/resources/mapper/VSySydzOracleMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/VillageSendRecordStaticMapper.xml b/src/main/resources/mapper/VillageSendRecordStaticMapper.xml new file mode 100644 index 0000000..fd72d36 --- /dev/null +++ b/src/main/resources/mapper/VillageSendRecordStaticMapper.xml @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into village_send_static_record + ( + `village_code`, + `village_name`, + `device_code`, + `table_name`, + `table_id`, + `send_time`, + `receive_time`, + `manufactor_no`, + `receipt_id`, + `result_status`, + `result_remark`, + `c1` + ) + values + ( + #{villageCode}, + #{villageName}, + #{deviceCode}, + #{tableName}, + #{tableId}, + #{sendTime}, + #{receiveTime}, + #{manufactorNo}, + #{receiptId}, + #{resultStatus}, + #{resultRemark}, + #{c1} + ) + + + + insert into village_send_static_record + ( + `village_code`, + `village_name`, + `device_code`, + `table_name`, + `table_id`, + `send_time`, + `receive_time`, + `manufactor_no`, + `receipt_id`, + `result_status`, + `result_remark`, + `c1` + ) + values + + (#{item.villageCode}, + #{item.villageName}, + #{item.deviceCode}, + #{item.tableName}, + #{item.tableId}, + #{item.sendTime}, + #{item.receiveTime}, + #{item.manufactorNo}, + #{item.receiptId}, + #{item.resultStatus}, + #{item.resultRemark}, + #{item.c1}) + + + + + + update village_send_static_record + + `receive_time` = #{receiveTime}, + `receipt_id` = #{receiptId}, + `result_status` = #{resultStatus}, + `result_remark` = #{resultRemark}, + `c1` = #{c1}, + `c2` = #{c2}, + `isactive` = #{isactive}, + + where 1=1 + and id = #{id} + and village_code = #{villageCode} + and `table_name` = #{tableName} + and `result_remark` = #{resultRemark} + and manufactor_no = #{manufactorNo} + + + + update village_send_static_record + + `receive_time` = #{receiveTime}, + `receipt_id` = #{receiptId}, + `result_status` = #{resultStatus}, + `result_remark` = #{resultRemark}, + `c1` = #{c1}, + `c2` = #{c2}, + `isactive` = #{isactive}, + + where 1=1 + and table_id = #{tableId} + and village_code = #{villageCode} + and `table_name` = #{tableName} + and `result_status` = #{resultStatus} + and `result_remark` = #{resultRemark} + and manufactor_no = #{manufactorNo} + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/VillageUserInfoMapper.xml b/src/main/resources/mapper/VillageUserInfoMapper.xml new file mode 100644 index 0000000..a0ea715 --- /dev/null +++ b/src/main/resources/mapper/VillageUserInfoMapper.xml @@ -0,0 +1,537 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select + id, + village_code, + village_name, + grid_code, + grid_name, + building_code, + building_name, + unit_code, + unit_name, + home_code, + home_name, + user_name, + user_pic, + user_standard_pic, + identity_type, + idcard, + sex, + nation, + birthday, + company, + phone, + nationality, + nativeplace, + education, + house_hold_register, + house_hold_address, + area_code, + area_name, + habitation, + religious, + political_outlook, + entry_time, + marriage, + person_type, + person_category, + caring_label, + is_householder, + householder_relation, + is_vaccinate, + is_first_vaccinate, + is_second_vaccinate, + is_third_vaccinate, + isactive, + c1, + c2, + c3, + c4, + c5 + from village_user_info + + + + + + + + + + + + + insert into village_user_info + + village_code, + village_name, + grid_code, + grid_name, + building_code, + building_name, + unit_code, + unit_name, + home_code, + home_name, + user_name, + user_pic, + user_standard_pic, + identity_type, + idcard, + sex, + nation, + birthday, + company, + phone, + nationality, + nativeplace, + education, + house_hold_register, + house_hold_address, + area_code, + area_name, + habitation, + religious, + political_outlook, + entry_time, + marriage, + person_type, + person_category, + caring_label, + is_householder, + householder_relation, + is_vaccinate, + is_first_vaccinate, + is_second_vaccinate, + is_third_vaccinate, + c1, + c2, + c3, + c4, + c5, + + + #{villageCode}, + #{villageName}, + #{gridCode}, + #{gridName}, + #{buildingCode}, + #{buildingName}, + #{unitCode}, + #{unitName}, + #{homeCode}, + #{homeName}, + #{userName}, + #{userPic}, + #{userStandardPic}, + #{identityType}, + #{idcard}, + #{sex}, + #{nation}, + #{birthday}, + #{company}, + #{phone}, + #{nationality}, + #{nativeplace}, + #{education}, + #{houseHoldRegister}, + #{houseHoldAddress}, + #{areaCode}, + #{areaName}, + #{habitation}, + #{religious}, + #{politicalOutlook}, + #{entryTime}, + #{marriage}, + #{personType}, + #{personCategory}, + #{caringLabel}, + #{isHouseholder}, + #{householderRelation}, + #{isVaccinate}, + #{isFirstVaccinate}, + #{isSecondVaccinate}, + #{isThirdVaccinate}, + #{c1}, + #{c2}, + #{c3}, + #{c4}, + #{c5}, + + + + + + update village_user_info + + village_code = #{villageCode}, + village_name = #{villageName}, + grid_code = #{gridCode}, + grid_name = #{gridName}, + building_code = #{buildingCode}, + building_name = #{buildingName}, + unit_code = #{unitCode}, + unit_name = #{unitName}, + home_code = #{homeCode}, + home_name = #{homeName}, + user_name = #{userName}, + user_pic = #{userPic}, + user_standard_pic = #{userStandardPic}, + identity_type = #{identityType}, + idcard = #{idcard}, + sex = #{sex}, + nation = #{nation}, + + company = #{company}, + phone = #{phone}, + nationality = #{nationality}, + nativeplace = #{nativeplace}, + education = #{education}, + house_hold_register = #{houseHoldRegister}, + house_hold_address = #{houseHoldAddress}, + area_code = #{areaCode}, + area_name = #{areaName}, + habitation = #{habitation}, + religious = #{religious}, + political_outlook = #{politicalOutlook}, + + marriage = #{marriage}, + person_type = #{personType}, + person_category = #{personCategory}, + caring_label = #{caringLabel}, + is_householder = #{isHouseholder}, + householder_relation = #{householderRelation}, + is_vaccinate = #{isVaccinate}, + is_first_vaccinate = #{isFirstVaccinate}, + is_second_vaccinate = #{isSecondVaccinate}, + is_third_vaccinate = #{isThirdVaccinate}, + isactive = #{isactive}, + c1 = #{c1}, + c2 = #{c2}, + c3 = #{c3}, + c4 = #{c4}, + c5 = #{c5}, + + where id = #{id} + + + + + update village_user_info + + village_code = #{villageCode}, + village_name = #{villageName}, + grid_code = #{gridCode}, + grid_name = #{gridName}, + building_code = #{buildingCode}, + building_name = #{buildingName}, + unit_code = #{unitCode}, + unit_name = #{unitName}, + home_code = #{homeCode}, + home_name = #{homeName}, + user_name = #{userName}, + user_pic = #{userPic}, + user_standard_pic = #{userStandardPic}, + identity_type = #{identityType}, + idcard = #{idcard}, + sex = #{sex}, + nation = #{nation}, + birthday = #{birthday}, + company = #{company}, + phone = #{phone}, + nationality = #{nationality}, + nativeplace = #{nativeplace}, + education = #{education}, + house_hold_register = #{houseHoldRegister}, + house_hold_address = #{houseHoldAddress}, + area_code = #{areaCode}, + area_name = #{areaName}, + habitation = #{habitation}, + religious = #{religious}, + political_outlook = #{politicalOutlook}, + entry_time = #{entryTime}, + marriage = #{marriage}, + person_type = #{personType}, + person_category = #{personCategory}, + caring_label = #{caringLabel}, + is_householder = #{isHouseholder}, + householder_relation = #{householderRelation}, + is_vaccinate = #{isVaccinate}, + is_first_vaccinate = #{isFirstVaccinate}, + is_second_vaccinate = #{isSecondVaccinate}, + is_third_vaccinate = #{isThirdVaccinate}, + isactive = #{isactive}, + c1 = #{c1}, + c3 = #{c3}, + c4 = #{c4}, + c5 = #{c5}, + c2 = #{c2New}, + + where idcard = #{idcard} and c2 = #{c2} + + + + + delete from village_user_info where id = #{id} + + + + + delete from village_user_info where DATE_FORMAT(updatetime, '%Y-%m-%d') != '${updatetimeV}' + + + + delete from village_user_info where id in + + #{id} + + + + + update village_user_info + set isactive='0' + where id in (${idsIn}) + + + + update village_user_info + set isactive='0' + where village_code= #{villageCode} and idcard = #{idcard} + + + + + + + + +