commit
a5bfbf3624
@ -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/
|
@ -0,0 +1,4 @@
|
||||
#实有地址接入处理开关
|
||||
sydzSwitch=false
|
||||
#单次查询数据量
|
||||
oncesCounts=10000
|
@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="/home/project/mysql-oracle/log" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>7</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>7</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 用户访问日志输出 -->
|
||||
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-user.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 按天回滚 daily -->
|
||||
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>7</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.ruoyi" level="info" />
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn" />
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
|
||||
<!--系统用户操作日志-->
|
||||
<logger name="sys-user" level="info">
|
||||
<appender-ref ref="sys-user"/>
|
||||
</logger>
|
||||
</configuration>
|
@ -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 "$@"
|
@ -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%
|
@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.1.4.RELEASE</version>
|
||||
<relativePath /> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.ssf</groupId>
|
||||
<artifactId>dataCompareSy</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<!-- <name>mysql-oracle-test</name>-->
|
||||
<description>Demo project for Spring Boot</description>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- <dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
</dependency> -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.1.1</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.baomidou/dynamic-datasource-spring-boot-starter -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId>
|
||||
<version>2.5.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.oracle/ojdbc6 -->
|
||||
<dependency>
|
||||
<groupId>com.oracle</groupId>
|
||||
<artifactId>ojdbc6</artifactId>
|
||||
<version>11.2.0.3</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.boot</groupId>-->
|
||||
<!-- <artifactId>spring-boot-starter-test</artifactId>-->
|
||||
<!-- <scope>test</scope>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!--lombok-->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<!--json-->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.4</version>
|
||||
</dependency>
|
||||
|
||||
<!-- hutool工具包 -->
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.16</version>
|
||||
</dependency>
|
||||
|
||||
<!--commons -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.6</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<testFailureIgnore>true</testFailureIgnore>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
|
||||
</project>
|
@ -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;
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
@ -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<VSySydzOracle> getSydzList(Map map);
|
||||
|
||||
}
|
@ -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));
|
||||
}
|
||||
}
|
@ -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);
|
||||
|
||||
|
||||
}
|
@ -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<VSySydzOracle> getSydzList(Map map);
|
||||
|
||||
}
|
@ -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<VillageUserInfo> 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);
|
||||
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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<VSySydzOracle> getSydzList(Map map) {
|
||||
return oracleMapper.getSydzList(map);
|
||||
}
|
||||
|
||||
}
|
@ -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<VillageUserInfo> selectVillageUserInfoList(VillageUserInfo villageUserInfo) {
|
||||
//查询之前加密
|
||||
List<VillageUserInfo> 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);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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<VSySydzOracle> 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));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -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"));
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -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<Object> keys = new LinkedHashSet<Object>();
|
||||
|
||||
@Override
|
||||
public Enumeration<Object> keys() {
|
||||
return Collections.<Object>enumeration(keys);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object put(Object key, Object value) {
|
||||
keys.add(key);
|
||||
return super.put(key, value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Object> keySet() {
|
||||
return keys;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> stringPropertyNames() {
|
||||
Set<String> set = new LinkedHashSet<String>();
|
||||
|
||||
for (Object key : this.keys) {
|
||||
set.add((String) key);
|
||||
}
|
||||
|
||||
return set;
|
||||
}
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
package com.ssf.mysqloracletest.utils.safe;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
/**
|
||||
* @author daifei
|
||||
* @Description: AES对称加密工具类
|
||||
* @date 2021年4月14日
|
||||
*/
|
||||
|
||||
public class AESTools {
|
||||
private static final Logger log = LoggerFactory.getLogger(AESTools.class);
|
||||
private static final String KEY_ALGORITHM = "AES";
|
||||
private static final String DEFAULT_CIPHER_ALGORITHM = "AES/ECB/PKCS5Padding";// 默认的加密算法
|
||||
|
||||
/**
|
||||
* AES 加密操作
|
||||
*
|
||||
* @param content 待加密内容
|
||||
* @param password 加密密码
|
||||
* @return 返回Base64转码后的加密数据
|
||||
*/
|
||||
public static String encrypt(String content, String password) {
|
||||
if (StringUtils.isBlank(content)) {
|
||||
return "";
|
||||
}
|
||||
try {
|
||||
Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);// 创建密码器
|
||||
|
||||
byte[] byteContent = content.getBytes("utf-8");
|
||||
|
||||
cipher.init(Cipher.ENCRYPT_MODE, getSecretKey(password));// 初始化为加密模式的密码器
|
||||
|
||||
byte[] result = cipher.doFinal(byteContent);// 加密
|
||||
|
||||
return Base64Tools.encodeToString(result);// 通过Base64转码返回
|
||||
} catch (Exception ex) {
|
||||
log.error("AES加密失败:" + content);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* AES 解密操作
|
||||
*
|
||||
* @param content
|
||||
* @param password
|
||||
* @return
|
||||
*/
|
||||
public static String decrypt(String content, String password) {
|
||||
try {
|
||||
if (StringUtils.isBlank(content)) {
|
||||
return "";
|
||||
}
|
||||
// 实例化
|
||||
Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM);
|
||||
|
||||
// 使用密钥初始化,设置为解密模式
|
||||
cipher.init(Cipher.DECRYPT_MODE, getSecretKey(password));
|
||||
|
||||
// 执行操作
|
||||
byte[] result = cipher.doFinal(Base64Tools.decodeFromString(content));
|
||||
return new String(result, "utf-8");
|
||||
} catch (Exception ex) {
|
||||
log.error("AES解密失败:" + content);
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成加密秘钥
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private static SecretKeySpec getSecretKey(final String password) {
|
||||
try {
|
||||
return new SecretKeySpec(password.getBytes("UTF-8"), KEY_ALGORITHM);// 转换为AES专用密钥
|
||||
} catch (Exception ex) {
|
||||
LoggerFactory.getLogger(AESTools.class).error("", ex);
|
||||
throw new RuntimeException("生成加密秘钥");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
package com.ssf.mysqloracletest.utils.safe;
|
||||
|
||||
public class AesConstant {
|
||||
public static final String AES_COMMON = "watu2022G409watu";
|
||||
public static final String AES_PHONE = "phoneG409WaTuNj1";
|
||||
public static final String AES_ID_CARD = "idCardG409WaTuNj";
|
||||
}
|
@ -0,0 +1,116 @@
|
||||
package com.ssf.mysqloracletest.utils.safe;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
|
||||
public abstract class Base64Tools {
|
||||
|
||||
private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;
|
||||
|
||||
|
||||
/**
|
||||
* Base64-encode the given byte array.
|
||||
*
|
||||
* @param src the original byte array
|
||||
* @return the encoded byte array
|
||||
*/
|
||||
public static byte[] encode(byte[] src) {
|
||||
if (src.length == 0) {
|
||||
return src;
|
||||
}
|
||||
return Base64.getEncoder().encode(src);
|
||||
}
|
||||
|
||||
/**
|
||||
* Base64-decode the given byte array.
|
||||
*
|
||||
* @param src the encoded byte array
|
||||
* @return the original byte array
|
||||
*/
|
||||
public static byte[] decode(byte[] src) {
|
||||
if (src.length == 0) {
|
||||
return src;
|
||||
}
|
||||
return Base64.getDecoder().decode(src);
|
||||
}
|
||||
|
||||
/**
|
||||
* Base64-encode the given byte array using the RFC 4648
|
||||
* "URL and Filename Safe Alphabet".
|
||||
*
|
||||
* @param src the original byte array
|
||||
* @return the encoded byte array
|
||||
* @since 4.2.4
|
||||
*/
|
||||
public static byte[] encodeUrlSafe(byte[] src) {
|
||||
if (src.length == 0) {
|
||||
return src;
|
||||
}
|
||||
return Base64.getUrlEncoder().encode(src);
|
||||
}
|
||||
|
||||
/**
|
||||
* Base64-decode the given byte array using the RFC 4648
|
||||
* "URL and Filename Safe Alphabet".
|
||||
*
|
||||
* @param src the encoded byte array
|
||||
* @return the original byte array
|
||||
* @since 4.2.4
|
||||
*/
|
||||
public static byte[] decodeUrlSafe(byte[] src) {
|
||||
if (src.length == 0) {
|
||||
return src;
|
||||
}
|
||||
return Base64.getUrlDecoder().decode(src);
|
||||
}
|
||||
|
||||
/**
|
||||
* Base64-encode the given byte array to a String.
|
||||
*
|
||||
* @param src the original byte array (may be {@code null})
|
||||
* @return the encoded byte array as a UTF-8 String
|
||||
*/
|
||||
public static String encodeToString(byte[] src) {
|
||||
if (src.length == 0) {
|
||||
return "";
|
||||
}
|
||||
return new String(encode(src), DEFAULT_CHARSET);
|
||||
}
|
||||
|
||||
/**
|
||||
* Base64-decode the given byte array from an UTF-8 String.
|
||||
*
|
||||
* @param src the encoded UTF-8 String
|
||||
* @return the original byte array
|
||||
*/
|
||||
public static byte[] decodeFromString(String src) {
|
||||
if (src.isEmpty()) {
|
||||
return new byte[0];
|
||||
}
|
||||
return decode(src.getBytes(DEFAULT_CHARSET));
|
||||
}
|
||||
|
||||
/**
|
||||
* Base64-encode the given byte array to a String using the RFC 4648
|
||||
* "URL and Filename Safe Alphabet".
|
||||
*
|
||||
* @param src the original byte array
|
||||
* @return the encoded byte array as a UTF-8 String
|
||||
*/
|
||||
public static String encodeToUrlSafeString(byte[] src) {
|
||||
return new String(encodeUrlSafe(src), DEFAULT_CHARSET);
|
||||
}
|
||||
|
||||
/**
|
||||
* Base64-decode the given byte array from an UTF-8 String using the RFC 4648
|
||||
* "URL and Filename Safe Alphabet".
|
||||
*
|
||||
* @param src the encoded UTF-8 String
|
||||
* @return the original byte array
|
||||
*/
|
||||
public static byte[] decodeFromUrlSafeString(String src) {
|
||||
return decodeUrlSafe(src.getBytes(DEFAULT_CHARSET));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package com.ssf.mysqloracletest.utils.safe;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.KeyFactory;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.PublicKey;
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
import java.security.spec.KeySpec;
|
||||
import java.security.spec.PKCS8EncodedKeySpec;
|
||||
import java.security.spec.X509EncodedKeySpec;
|
||||
|
||||
public class SignatureTools {
|
||||
|
||||
private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8;
|
||||
|
||||
/**
|
||||
* sha256WithRsa 加签
|
||||
*
|
||||
* @param content 待签名的字符串
|
||||
* @param priKeyBase64 base64编码的私钥
|
||||
* @return base64编码的签名
|
||||
*/
|
||||
public static String rsa256Sign(String content, String priKeyBase64) {
|
||||
byte[] signed = sign(SignAlgorithm.SHA256withRSA, content.getBytes(DEFAULT_CHARSET), Base64Tools.decodeFromString(priKeyBase64));
|
||||
return Base64Tools.encodeToString(signed);
|
||||
}
|
||||
|
||||
/**
|
||||
* sha256WithRsa 验签
|
||||
*
|
||||
* @param content 待验签的字符串
|
||||
* @param pubKeyBase64 base64编码的公钥
|
||||
* @param signBase64 base64编码签名
|
||||
* @return 签名是否正确
|
||||
*/
|
||||
public static boolean rsa256Verify(String content, String pubKeyBase64, String signBase64) {
|
||||
return verify(SignAlgorithm.SHA256withRSA, content.getBytes(DEFAULT_CHARSET), Base64Tools.decodeFromString(signBase64),
|
||||
Base64Tools.decodeFromString(pubKeyBase64));
|
||||
}
|
||||
|
||||
public static byte[] sign(SignAlgorithm algorithm, byte[] content, byte[] key) {
|
||||
try {
|
||||
PrivateKey priKey = generatePrivateKey(algorithm, key);
|
||||
java.security.Signature signature = java.security.Signature.getInstance(algorithm.getValue());
|
||||
signature.initSign(priKey);
|
||||
signature.update(content);
|
||||
byte[] signed = signature.sign();
|
||||
return signed;
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean verify(SignAlgorithm algorithm, byte[] content, byte[] sign, byte[] key) {
|
||||
try {
|
||||
java.security.Signature signature = java.security.Signature.getInstance(algorithm.getValue());
|
||||
PublicKey publicKey = generatePublicKey(algorithm, key);
|
||||
signature.initVerify(publicKey);
|
||||
signature.update(content);
|
||||
return signature.verify(sign);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static PrivateKey generatePrivateKey(SignAlgorithm algorithmType, byte[] key)
|
||||
throws InvalidKeySpecException, NoSuchAlgorithmException {
|
||||
return generatePrivateKey(algorithmType, new PKCS8EncodedKeySpec(key));
|
||||
}
|
||||
|
||||
public static PrivateKey generatePrivateKey(SignAlgorithm algorithmType, KeySpec keySpec)
|
||||
throws InvalidKeySpecException, NoSuchAlgorithmException {
|
||||
return KeyFactory.getInstance(algorithmType.getType()).generatePrivate(keySpec);
|
||||
}
|
||||
|
||||
public static PublicKey generatePublicKey(SignAlgorithm algorithm, byte[] key)
|
||||
throws InvalidKeySpecException, NoSuchAlgorithmException {
|
||||
return generatePublicKey(algorithm, new X509EncodedKeySpec(key));
|
||||
}
|
||||
|
||||
public static PublicKey generatePublicKey(SignAlgorithm algorithm, KeySpec keySpec)
|
||||
throws InvalidKeySpecException, NoSuchAlgorithmException {
|
||||
return KeyFactory.getInstance(algorithm.getType()).generatePublic(keySpec);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1 @@
|
||||
server:
port: 5678
spring:
datasource:
dynamic:
primary: mysql #设置默认的数据源或者数据源组,默认值即为master
strict: false #设置严格模式,默认false不启动. 启动后再为匹配到指定数据源时候回抛出异常,不启动会使用默认数据源.
datasource:
oracleSydz:
url: jdbc:oracle:thin:@50.146.63.219:1588/sygadsj
driver-class-name: oracle.jdbc.driver.OracleDriver
username: za_sjdj
password: 'za_sjdj0324'
mysql:
url: jdbc:mysql://localhost:55306/watu3?useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&serverTimezone=GMT
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: '!QAZ1qaz'
mybatis-plus:
mapper-locations:
- classpath:mapper/*.xml
|
@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="/home/project/dataCompare/log" />
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统日志输出 -->
|
||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-info.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>7</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>INFO</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-error.log</file>
|
||||
<!-- 循环政策:基于时间创建日志文件 -->
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 日志文件名格式 -->
|
||||
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>7</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||
<!-- 过滤的级别 -->
|
||||
<level>ERROR</level>
|
||||
<!-- 匹配时的操作:接收(记录) -->
|
||||
<onMatch>ACCEPT</onMatch>
|
||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||
<onMismatch>DENY</onMismatch>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- 用户访问日志输出 -->
|
||||
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${log.path}/sys-user.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- 按天回滚 daily -->
|
||||
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- 日志最大的历史 60天 -->
|
||||
<maxHistory>7</maxHistory>
|
||||
</rollingPolicy>
|
||||
<encoder>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 系统模块日志级别控制 -->
|
||||
<logger name="com.ruoyi" level="info" />
|
||||
<!-- Spring日志级别控制 -->
|
||||
<logger name="org.springframework" level="warn" />
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="console" />
|
||||
</root>
|
||||
|
||||
<!--系统操作日志-->
|
||||
<root level="info">
|
||||
<appender-ref ref="file_info" />
|
||||
<appender-ref ref="file_error" />
|
||||
</root>
|
||||
|
||||
<!--系统用户操作日志-->
|
||||
<logger name="sys-user" level="info">
|
||||
<appender-ref ref="sys-user"/>
|
||||
</logger>
|
||||
</configuration>
|
@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.ssf.mysqloracletest.mapper.VSySydzMysqlMapper">
|
||||
|
||||
|
||||
<resultMap type="com.ssf.mysqloracletest.domain.VSySydzMysql" id="VSySydzResult">
|
||||
<result property="DZDXMC" column="DZDXMC"/>
|
||||
<result property="CJSJ" column="CJSJ"/>
|
||||
<result property="ZRQDM" column="ZRQDM"/>
|
||||
<result property="JDZB" column="JDZB"/>
|
||||
<result property="WDZB" column="WDZB"/>
|
||||
|
||||
<result property="DZDXTYMC" column="DZDXTYMC"/>
|
||||
<result property="SJDZYSID" column="SJDZYSID"/>
|
||||
<result property="DZYSID" column="DZYSID"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
<select id="selectVSySydzById" parameterType="java.lang.String" resultMap="VSySydzResult">
|
||||
select * from v_sy_sydz
|
||||
where DZDXMC = #{DZDXMC} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertVSySydz" parameterType="com.ssf.mysqloracletest.domain.VSySydzMysql" useGeneratedKeys="true"
|
||||
keyProperty="id">
|
||||
insert into v_sy_sydz
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="DZDXMC != null and DZDXMC != '' ">DZDXMC,</if>
|
||||
<if test="CJSJ != null and CJSJ != ''">CJSJ,</if>
|
||||
<if test="ZRQDM != null and ZRQDM != ''">ZRQDM,</if>
|
||||
<if test="JDZB != null and JDZB != ''">JDZB,</if>
|
||||
<if test="WDZB != null and WDZB != ''">WDZB,</if>
|
||||
|
||||
<if test="DZDXTYMC != null and DZDXTYMC != ''">DZDXTYMC,</if>
|
||||
<if test="SJDZYSID != null and SJDZYSID != ''">SJDZYSID,</if>
|
||||
<if test="DZYSID != null and DZYSID != ''">DZYSID,</if>
|
||||
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="DZDXMC != null and DZDXMC != '' ">#{DZDXMC},</if>
|
||||
<if test="CJSJ != null and CJSJ != ''">#{CJSJ},</if>
|
||||
<if test="ZRQDM != null and ZRQDM != ''">#{ZRQDM},</if>
|
||||
<if test="JDZB != null and JDZB != ''">#{JDZB},</if>
|
||||
<if test="WDZB != null and WDZB != ''">#{WDZB},</if>
|
||||
|
||||
<if test="DZDXTYMC != null and DZDXTYMC != ''">#{DZDXTYMC},</if>
|
||||
<if test="SJDZYSID != null and SJDZYSID != ''">#{SJDZYSID},</if>
|
||||
<if test="DZYSID != null and DZYSID != ''">#{DZYSID},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateVSySydzById" parameterType="com.ssf.mysqloracletest.domain.VSySydzMysql">
|
||||
update v_sy_sydz
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="DZDXMC != null and DZDXMC != '' ">DZDXMC = #{DZDXMC},</if>
|
||||
<if test="CJSJ != null and CJSJ != ''">CJSJ = #{CJSJ},</if>
|
||||
<if test="ZRQDM != null and ZRQDM != ''">ZRQDM = #{ZRQDM},</if>
|
||||
<if test="JDZB != null and JDZB != ''">JDZB = #{JDZB},</if>
|
||||
<if test="WDZB != null and WDZB != ''">WDZB = #{WDZB},</if>
|
||||
|
||||
<if test="DZDXTYMC != null and DZDXTYMC != ''">DZDXTYMC = #{DZDXTYMC},</if>
|
||||
<if test="DZYSID != null and DZYSID != ''">DZYSID = #{DZYSID},</if>
|
||||
<if test="SJDZYSID != null and SJDZYSID != ''">SJDZYSID = #{SJDZYSID},</if>
|
||||
</trim>
|
||||
where DZDXMC = #{DZDXMC}
|
||||
</update>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.ssf.mysqloracletest.mapper.VSySydzOracleMapper">
|
||||
<select id="countSydz" resultType="int">
|
||||
select count(*) from SYX_JWYSJ.V_SY_SYDZ
|
||||
</select>
|
||||
|
||||
<resultMap type="com.ssf.mysqloracletest.domain.VSySydzOracle" id="SydzResult">
|
||||
<result property="DZDXMC" column="DZDXMC"/>
|
||||
<result property="CJSJ" column="CJSJ"/>
|
||||
<result property="ZRQDM" column="ZRQDM"/>
|
||||
<result property="JDZB" column="JDZB"/>
|
||||
<result property="WDZB" column="WDZB"/>
|
||||
|
||||
<result property="DZDXTYMC" column="DZDXTYMC"/>
|
||||
<result property="SJDZYSID" column="SJDZYSID"/>
|
||||
<result property="DZYSID" column="DZYSID"/>
|
||||
|
||||
</resultMap>
|
||||
<select id="getSydzList" parameterType="java.util.Map" resultMap="SydzResult">
|
||||
SELECT t2.* FROM (SELECT ROWNUM rn,t1.* FROM (SELECT * FROM SYX_JWYSJ.V_SY_SYDZ) t1 WHERE ROWNUM<![CDATA[ <= ]]> ${rowEnd}) t2 WHERE t2.rn <![CDATA[ >= ]]> ${rowStart}
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,173 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.ssf.mysqloracletest.mapper.VillageSendRecordStaticMapper">
|
||||
|
||||
|
||||
|
||||
<resultMap type="com.ssf.mysqloracletest.domain.VillageSendRecordStatic" id="VillageSendStaticRecordResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="villageCode" column="village_code"/>
|
||||
<result property="villageName" column="village_name"/>
|
||||
<result property="tableName" column="table_name"/>
|
||||
<result property="tableId" column="table_id"/>
|
||||
<result property="sendTime" column="send_time"/>
|
||||
<result property="receiveTime" column="receive_time"/>
|
||||
<result property="manufactor" column="manufactor"/>
|
||||
<result property="receiptId" column="receipt_id"/>
|
||||
<result property="isactive" column="isactive"/>
|
||||
<result property="resultStatus" column="result_status"/>
|
||||
<result property="deviceCode" column="device_code"/>
|
||||
<result property="c1" column="c1"/>
|
||||
<result property="c2" column="c2"/>
|
||||
<result property="c3" column="c3"/>
|
||||
<result property="c4" column="c4"/>
|
||||
<result property="c5" column="c5"/>
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
<insert id="insertRecord" parameterType="com.ssf.mysqloracletest.domain.VillageSendRecordStatic"
|
||||
useGeneratedKeys="true" keyProperty="id">
|
||||
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>
|
||||
|
||||
<insert id="insertRecords" parameterType="java.util.List"
|
||||
useGeneratedKeys="true" keyProperty="id">
|
||||
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
|
||||
<foreach item="item" index="index" collection="list" open="" separator="," close="">
|
||||
(#{item.villageCode},
|
||||
#{item.villageName},
|
||||
#{item.deviceCode},
|
||||
#{item.tableName},
|
||||
#{item.tableId},
|
||||
#{item.sendTime},
|
||||
#{item.receiveTime},
|
||||
#{item.manufactorNo},
|
||||
#{item.receiptId},
|
||||
#{item.resultStatus},
|
||||
#{item.resultRemark},
|
||||
#{item.c1})
|
||||
</foreach>
|
||||
|
||||
</insert>
|
||||
|
||||
<update id="updateRecord" parameterType="com.ssf.mysqloracletest.domain.VillageSendRecordStatic">
|
||||
update village_send_static_record
|
||||
<set>
|
||||
<if test="receiveTime != null and receiveTime != ''">`receive_time` = #{receiveTime},</if>
|
||||
<if test="receiptId != null and receiptId != ''">`receipt_id` = #{receiptId},</if>
|
||||
<if test="resultStatus != null and resultStatus != ''">`result_status` = #{resultStatus},</if>
|
||||
<if test="resultRemark != null and resultRemark != ''">`result_remark` = #{resultRemark},</if>
|
||||
<if test="c1 != null and c1 != ''">`c1` = #{c1},</if>
|
||||
<if test="c2 != null and c2 != ''">`c2` = #{c2},</if>
|
||||
<if test="isactive != null and isactive != ''">`isactive` = #{isactive},</if>
|
||||
</set>
|
||||
where 1=1
|
||||
<if test="id != null and id != ''"> and id = #{id}</if>
|
||||
<if test="villageCode != null and villageCode != ''"> and village_code = #{villageCode}</if>
|
||||
<if test="tableName != null and tableName != ''"> and `table_name` = #{tableName}</if>
|
||||
<if test="resultRemark != null and resultRemark != ''"> and `result_remark` = #{resultRemark}</if>
|
||||
<if test="manufactorNo != null and manufactorNo != ''"> and manufactor_no = #{manufactorNo}</if>
|
||||
</update>
|
||||
|
||||
<update id="updateRecordByTableId" parameterType="com.ssf.mysqloracletest.domain.VillageSendRecordStatic">
|
||||
update village_send_static_record
|
||||
<set>
|
||||
<if test="receiveTime != null and receiveTime != ''">`receive_time` = #{receiveTime},</if>
|
||||
<if test="receiptId != null and receiptId != ''">`receipt_id` = #{receiptId},</if>
|
||||
<if test="resultStatus != null and resultStatus != ''">`result_status` = #{resultStatus},</if>
|
||||
<if test="resultRemark != null and resultRemark != ''">`result_remark` = #{resultRemark},</if>
|
||||
<if test="c1 != null and c1 != ''">`c1` = #{c1},</if>
|
||||
<if test="c2 != null and c2 != ''">`c2` = #{c2},</if>
|
||||
<if test="isactive != null and isactive != ''">`isactive` = #{isactive},</if>
|
||||
</set>
|
||||
where 1=1
|
||||
<if test="tableId != null and tableId != ''"> and table_id = #{tableId}</if>
|
||||
<if test="villageCode != null and villageCode != ''"> and village_code = #{villageCode}</if>
|
||||
<if test="tableName != null and tableName != ''"> and `table_name` = #{tableName}</if>
|
||||
<if test="resultStatus != null and resultStatus != ''"> and `result_status` = #{resultStatus}</if>
|
||||
<if test="resultRemark != null and resultRemark != ''"> and `result_remark` = #{resultRemark}</if>
|
||||
<if test="manufactorNo != null and manufactorNo != ''"> and manufactor_no = #{manufactorNo}</if>
|
||||
</update>
|
||||
|
||||
<select id="getMaxTableIdFromVillageSendRecordStatic" resultType="java.lang.Long">
|
||||
select table_id as tableId from village_send_static_record where isactive=1
|
||||
and manufactor_no = #{manufactorNo}
|
||||
and village_code = #{villageCode}
|
||||
and `table_name` = #{tableName}
|
||||
and device_code = #{deviceCode}
|
||||
order by table_id desc limit 1
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="getstart" resultMap="VillageSendStaticRecordResult">
|
||||
select table_id from village_send_static_record ${partitionStr}
|
||||
where
|
||||
table_name = #{tableName} and manufactor_no = #{manufactor} and village_code = #{villageCode}
|
||||
order by table_id desc limit 1;
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getList" resultMap="VillageSendStaticRecordResult">
|
||||
select * from village_send_static_record
|
||||
<where>
|
||||
<if test="isactive != null and isactive != ''">and isactive = #{isactive}</if>
|
||||
<if test="villageCode != null and villageCode != ''">and village_code = #{villageCode}</if>
|
||||
<if test="manufactorNo != null and manufactorNo != ''">and manufactor_no = #{manufactorNo}</if>
|
||||
<if test="resultStatus != null and resultStatus != ''">and result_status = #{resultStatus}</if>
|
||||
<if test="tableName != null and tableName != ''">and table_name = #{tableName}</if>
|
||||
<if test="resultRemark != null and resultRemark != ''"> and result_remark like concat('%', #{resultRemark}, '%')</if>
|
||||
</where>
|
||||
order by id desc
|
||||
limit 200;
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,537 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ssf.mysqloracletest.mapper.VillageUserInfoMapper">
|
||||
|
||||
<resultMap type="com.ssf.mysqloracletest.domain.VillageUserInfo" id="VillageUserInfoResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="villageCode" column="village_code"/>
|
||||
<result property="villageName" column="village_name"/>
|
||||
<result property="gridCode" column="grid_code"/>
|
||||
<result property="gridName" column="grid_name"/>
|
||||
<result property="buildingCode" column="building_code"/>
|
||||
<result property="buildingName" column="building_name"/>
|
||||
<result property="unitCode" column="unit_code"/>
|
||||
<result property="unitName" column="unit_name"/>
|
||||
<result property="homeCode" column="home_code"/>
|
||||
<result property="homeName" column="home_name"/>
|
||||
<result property="userName" column="user_name"/>
|
||||
<result property="userPic" column="user_pic"/>
|
||||
<result property="userStandardPic" column="user_standard_pic"/>
|
||||
<result property="userStandardPicIsNull" column="user_standard_pic_is_null"/>
|
||||
<result property="identityType" column="identity_type"/>
|
||||
<result property="idcard" column="idcard"/>
|
||||
<result property="sex" column="sex"/>
|
||||
<result property="nation" column="nation"/>
|
||||
<result property="birthday" column="birthday"/>
|
||||
<result property="company" column="company"/>
|
||||
<result property="phone" column="phone"/>
|
||||
<result property="nationality" column="nationality"/>
|
||||
<result property="nativeplace" column="nativeplace"/>
|
||||
<result property="education" column="education"/>
|
||||
<result property="houseHoldRegister" column="house_hold_register"/>
|
||||
<result property="houseHoldAddress" column="house_hold_address"/>
|
||||
<result property="areaCode" column="area_code"/>
|
||||
<result property="areaName" column="area_name"/>
|
||||
<result property="habitation" column="habitation"/>
|
||||
<result property="religious" column="religious"/>
|
||||
<result property="politicalOutlook" column="political_outlook"/>
|
||||
<result property="entryTime" column="entry_time"/>
|
||||
<result property="marriage" column="marriage"/>
|
||||
<result property="personType" column="person_type"/>
|
||||
<result property="personCategory" column="person_category"/>
|
||||
<result property="caringLabel" column="caring_label"/>
|
||||
<result property="isHouseholder" column="is_householder"/>
|
||||
<result property="householderRelation" column="householder_relation"/>
|
||||
<result property="isVaccinate" column="is_vaccinate"/>
|
||||
<result property="isFirstVaccinate" column="is_first_vaccinate"/>
|
||||
<result property="isSecondVaccinate" column="is_second_vaccinate"/>
|
||||
<result property="isThirdVaccinate" column="is_third_vaccinate"/>
|
||||
<result property="isactive" column="isactive"/>
|
||||
<result property="c1" column="c1"/>
|
||||
<result property="c2" column="c2"/>
|
||||
<result property="c3" column="c3"/>
|
||||
<result property="c4" column="c4"/>
|
||||
<result property="c5" column="c5"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectVillageUserInfoVo">
|
||||
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
|
||||
</sql>
|
||||
|
||||
<select id="selectVillageUserInfoList" parameterType="com.ssf.mysqloracletest.domain.VillageUserInfo" resultMap="VillageUserInfoResult">
|
||||
<include refid="selectVillageUserInfoVo"/>
|
||||
<where>
|
||||
<if test="id != null and id != ''">and id = #{id}</if>
|
||||
<if test="villageCode != null and villageCode != ''">and village_code = #{villageCode}</if>
|
||||
<if test="villageName != null and villageName != ''">and village_name like concat('%', #{villageName},
|
||||
'%')
|
||||
</if>
|
||||
<if test="gridCode != null and gridCode != ''">and grid_code = #{gridCode}</if>
|
||||
<if test="gridName != null and gridName != ''">and grid_name like concat('%', #{gridName}, '%')</if>
|
||||
<if test="buildingCode != null and buildingCode != ''">and building_code = #{buildingCode}</if>
|
||||
<if test="buildingName != null and buildingName != ''"> and building_name = #{buildingName}</if>
|
||||
<if test="unitName != null and unitName != ''"> and unit_name = #{unitName}</if>
|
||||
<if test="homeName != null and homeName != ''"> and home_name = #{homeName}</if>
|
||||
<if test="unitCode != null and unitCode != ''">and unit_code = #{unitCode}</if>
|
||||
<if test="homeCode != null and homeCode != ''">and home_code = #{homeCode}</if>
|
||||
<if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="userPic != null and userPic != ''">and user_pic = #{userPic}</if>
|
||||
<if test="userStandardPic != null and userStandardPic != ''">and user_standard_pic = #{userStandardPic}
|
||||
</if>
|
||||
<if test="userStandardPicIsNull != null and userStandardPicIsNull != ''">and (user_standard_pic is null or user_standard_pic ='') and c3 is null
|
||||
</if>
|
||||
<if test="identityType != null ">and identity_type = #{identityType}</if>
|
||||
<if test="idcard != null and idcard != ''">and idcard = #{idcard}</if>
|
||||
<if test="sex != null ">and sex = #{sex}</if>
|
||||
<if test="nation != null ">and nation = #{nation}</if>
|
||||
<if test="birthday != null ">and birthday = #{birthday}</if>
|
||||
<if test="company != null and company != ''">and company = #{company}</if>
|
||||
<if test="phone != null and phone != ''">and phone = #{phone}</if>
|
||||
<if test="nationality != null ">and nationality = #{nationality}</if>
|
||||
<if test="nativeplace != null and nativeplace != ''">and nativeplace = #{nativeplace}</if>
|
||||
<if test="education != null ">and education = #{education}</if>
|
||||
<if test="houseHoldRegister != null and houseHoldRegister != ''">and house_hold_register =
|
||||
#{houseHoldRegister}
|
||||
</if>
|
||||
<if test="houseHoldAddress != null and houseHoldAddress != ''">and house_hold_address =
|
||||
#{houseHoldAddress}
|
||||
</if>
|
||||
<if test="areaCode != null and areaCode != ''">and area_code = #{areaCode}</if>
|
||||
<if test="areaName != null and areaName != ''">and area_name like concat('%', #{areaName}, '%')</if>
|
||||
<if test="habitation != null and habitation != ''">and habitation = #{habitation}</if>
|
||||
<if test="religious != null and religious != ''">and religious = #{religious}</if>
|
||||
<if test="politicalOutlook != null ">and political_outlook = #{politicalOutlook}</if>
|
||||
<if test="entryTime != null ">and entry_time = #{entryTime}</if>
|
||||
<if test="marriage != null ">and marriage = #{marriage}</if>
|
||||
<if test="personType != null ">and person_type = #{personType}</if>
|
||||
<if test="personCategory != null ">and person_category = #{personCategory}</if>
|
||||
<if test="caringLabel != null ">and caring_label = #{caringLabel}</if>
|
||||
<if test="isHouseholder != null ">and is_householder = #{isHouseholder}</if>
|
||||
<if test="householderRelation != null ">and householder_relation = #{householderRelation}</if>
|
||||
<if test="isVaccinate != null ">and is_vaccinate = #{isVaccinate}</if>
|
||||
<if test="isFirstVaccinate != null ">and is_first_vaccinate = #{isFirstVaccinate}</if>
|
||||
<if test="isSecondVaccinate != null ">and is_second_vaccinate = #{isSecondVaccinate}</if>
|
||||
<if test="isThirdVaccinate != null ">and is_third_vaccinate = #{isThirdVaccinate}</if>
|
||||
<if test="c1 != null and c1 != ''">and c1 = #{c1}</if>
|
||||
<if test="c2 != null and c2 != ''">and c2 = #{c2}</if>
|
||||
<if test="c3 != null and c3 != ''">and c3 = #{c3}</if>
|
||||
<if test="c4 != null and c4 != ''">and c4 = #{c4}</if>
|
||||
<if test="c5 != null and c5 != ''">and c5 = #{c5}</if>
|
||||
</where>
|
||||
<if test="orderByTomany == 'true'">
|
||||
ORDER BY
|
||||
CASE WHEN c1 ='1' AND user_pic IS NOT NULL THEN 0
|
||||
WHEN c1 ='2' AND user_pic IS NOT NULL THEN 1
|
||||
when user_pic is not null then 2
|
||||
when c1 is not null then 3
|
||||
WHEN c1 IS NULL OR user_pic IS NULL THEN 4 END,
|
||||
c1,
|
||||
user_Pic
|
||||
</if>
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="archivesList" parameterType="com.ssf.mysqloracletest.domain.VillageUserInfo" resultMap="VillageUserInfoResult">
|
||||
select * from (
|
||||
select
|
||||
a.*,
|
||||
(select b.imp_user_type from village_imp_user_info b where a.idcard = b.idcard order by id desc limit 1) imp_user_type
|
||||
from village_user_info a
|
||||
where a.isactive = 1
|
||||
) a
|
||||
<where>
|
||||
<if test="id != null and id != ''">and a.id = #{id}</if>
|
||||
<if test="villageCode != null and villageCode != ''">and a.village_code = #{villageCode}</if>
|
||||
<if test="villageName != null and villageName != ''">and a.village_name like concat('%', #{villageName},
|
||||
'%')
|
||||
</if>
|
||||
<if test="gridCode != null and gridCode != ''">and a.grid_code = #{gridCode}</if>
|
||||
<if test="gridName != null and gridName != ''">and a.grid_name like concat('%', #{gridName}, '%')</if>
|
||||
<if test="buildingCode != null and buildingCode != ''">and a.building_code = #{buildingCode}</if>
|
||||
<if test="buildingName != null and buildingName != ''"> and a.building_name = #{buildingName}</if>
|
||||
<if test="unitName != null and unitName != ''"> and a.unit_name = #{unitName}</if>
|
||||
<if test="homeName != null and homeName != ''"> and a.home_name = #{homeName}</if>
|
||||
<if test="unitCode != null and unitCode != ''">and a.unit_code = #{unitCode}</if>
|
||||
<if test="homeCode != null and homeCode != ''">and a.home_code = #{homeCode}</if>
|
||||
<if test="userName != null and userName != ''">and a.user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="userPic != null and userPic != ''">and a.user_pic = #{userPic}</if>
|
||||
<if test="userStandardPic != null and userStandardPic != ''">and a.user_standard_pic = #{userStandardPic}
|
||||
</if>
|
||||
<if test="identityType != null ">and a.identity_type = #{identityType}</if>
|
||||
<if test="idcard != null and idcard != ''">and a.idcard = #{idcard}</if>
|
||||
<if test="sex != null ">and a.sex = #{sex}</if>
|
||||
<if test="nation != null ">and a.nation = #{nation}</if>
|
||||
<if test="birthday != null ">and a.birthday = #{birthday}</if>
|
||||
<if test="company != null and company != ''">and a.company = #{company}</if>
|
||||
<if test="phone != null and phone != ''">and a.phone = #{phone}</if>
|
||||
<if test="nationality != null ">and a.nationality = #{nationality}</if>
|
||||
<if test="nativeplace != null and nativeplace != ''">and a.nativeplace = #{nativeplace}</if>
|
||||
<if test="education != null ">and a.education = #{education}</if>
|
||||
<if test="houseHoldRegister != null and houseHoldRegister != ''">and a.house_hold_register =
|
||||
#{houseHoldRegister}
|
||||
</if>
|
||||
<if test="houseHoldAddress != null and houseHoldAddress != ''">and a.house_hold_address =
|
||||
#{houseHoldAddress}
|
||||
</if>
|
||||
<if test="areaCode != null and areaCode != ''">and a.area_code = #{areaCode}</if>
|
||||
<if test="areaName != null and areaName != ''">and a.area_name like concat('%', #{areaName}, '%')</if>
|
||||
<if test="habitation != null and habitation != ''">and a.habitation = #{habitation}</if>
|
||||
<if test="religious != null and religious != ''">and a.religious = #{religious}</if>
|
||||
<if test="politicalOutlook != null ">and a.political_outlook = #{politicalOutlook}</if>
|
||||
<if test="entryTime != null ">and a.entry_time = #{entryTime}</if>
|
||||
<if test="marriage != null ">and a.marriage = #{marriage}</if>
|
||||
<if test="personType != null ">and a.person_type = #{personType}</if>
|
||||
<if test="personCategory != null ">and a.person_category = #{personCategory}</if>
|
||||
<if test="caringLabel != null ">and a.caring_label = #{caringLabel}</if>
|
||||
<if test="isHouseholder != null ">and a.is_householder = #{isHouseholder}</if>
|
||||
<if test="householderRelation != null ">and a.householder_relation = #{householderRelation}</if>
|
||||
<if test="isVaccinate != null ">and a.is_vaccinate = #{isVaccinate}</if>
|
||||
<if test="isFirstVaccinate != null ">and a.is_first_vaccinate = #{isFirstVaccinate}</if>
|
||||
<if test="isSecondVaccinate != null ">and a.is_second_vaccinate = #{isSecondVaccinate}</if>
|
||||
<if test="isThirdVaccinate != null ">and a.is_third_vaccinate = #{isThirdVaccinate}</if>
|
||||
<if test="c1 != null and c1 != ''">and a.c1 = #{c1}</if>
|
||||
<if test="c2 != null and c2 != ''">and a.c2 = #{c2}</if>
|
||||
<if test="c3 != null and c3 != ''">and a.c3 = #{c3}</if>
|
||||
<if test="c4 != null and c4 != ''">and a.c4 = #{c4}</if>
|
||||
<if test="c5 != null and c5 != ''">and a.c5 = #{c5}</if>
|
||||
<if test="isImpUser != null and isImpUser == 'false'">and (a.imp_user_type is null or a.imp_user_type = '')</if>
|
||||
<if test="isImpUser != null and isImpUser == 'true'">and (a.imp_user_type is not null or a.imp_user_type!='')</if>
|
||||
</where>
|
||||
<if test="orderByTomany == 'true'">
|
||||
ORDER BY
|
||||
CASE WHEN a.c1 ='1' AND a.user_pic IS NOT NULL THEN 0
|
||||
WHEN a.c1 ='2' AND a.user_pic IS NOT NULL THEN 1
|
||||
when a.user_pic is not null then 2
|
||||
when a.c1 is not null then 3
|
||||
WHEN a.c1 IS NULL OR a.user_pic IS NULL THEN 4 END,
|
||||
a.c1,
|
||||
a.user_Pic
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectVillageUserInfoById" parameterType="Long" resultMap="VillageUserInfoResult">
|
||||
<include refid="selectVillageUserInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectVillageUserInfoByIdcard" parameterType="String" resultMap="VillageUserInfoResult">
|
||||
<include refid="selectVillageUserInfoVo"/>
|
||||
where idcard = #{idcard} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertVillageUserInfo" parameterType="com.ssf.mysqloracletest.domain.VillageUserInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into village_user_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="villageCode != null">village_code,</if>
|
||||
<if test="villageName != null">village_name,</if>
|
||||
<if test="gridCode != null">grid_code,</if>
|
||||
<if test="gridName != null">grid_name,</if>
|
||||
<if test="buildingCode != null">building_code,</if>
|
||||
<if test="buildingName != null">building_name,</if>
|
||||
<if test="unitCode != null">unit_code,</if>
|
||||
<if test="unitName != null">unit_name,</if>
|
||||
<if test="homeCode != null">home_code,</if>
|
||||
<if test="homeName != null">home_name,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="userPic != null">user_pic,</if>
|
||||
<if test="userStandardPic != null">user_standard_pic,</if>
|
||||
<if test="identityType != null">identity_type,</if>
|
||||
<if test="idcard != null and idcard != ''">idcard,</if>
|
||||
<if test="sex != null">sex,</if>
|
||||
<if test="nation != null">nation,</if>
|
||||
<if test="birthday != null">birthday,</if>
|
||||
<if test="company != null">company,</if>
|
||||
<if test="phone != null and phone != ''">phone,</if>
|
||||
<if test="nationality != null">nationality,</if>
|
||||
<if test="nativeplace != null">nativeplace,</if>
|
||||
<if test="education != null">education,</if>
|
||||
<if test="houseHoldRegister != null">house_hold_register,</if>
|
||||
<if test="houseHoldAddress != null">house_hold_address,</if>
|
||||
<if test="areaCode != null">area_code,</if>
|
||||
<if test="areaName != null">area_name,</if>
|
||||
<if test="habitation != null">habitation,</if>
|
||||
<if test="religious != null">religious,</if>
|
||||
<if test="politicalOutlook != null">political_outlook,</if>
|
||||
<if test="entryTime != null">entry_time,</if>
|
||||
<if test="marriage != null">marriage,</if>
|
||||
<if test="personType != null">person_type,</if>
|
||||
<if test="personCategory != null">person_category,</if>
|
||||
<if test="caringLabel != null">caring_label,</if>
|
||||
<if test="isHouseholder != null">is_householder,</if>
|
||||
<if test="householderRelation != null">householder_relation,</if>
|
||||
<if test="isVaccinate != null">is_vaccinate,</if>
|
||||
<if test="isFirstVaccinate != null">is_first_vaccinate,</if>
|
||||
<if test="isSecondVaccinate != null">is_second_vaccinate,</if>
|
||||
<if test="isThirdVaccinate != null">is_third_vaccinate,</if>
|
||||
<if test="c1 != null">c1,</if>
|
||||
<if test="c2 != null">c2,</if>
|
||||
<if test="c3 != null">c3,</if>
|
||||
<if test="c4 != null">c4,</if>
|
||||
<if test="c5 != null">c5,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="villageCode != null">#{villageCode},</if>
|
||||
<if test="villageName != null">#{villageName},</if>
|
||||
<if test="gridCode != null">#{gridCode},</if>
|
||||
<if test="gridName != null">#{gridName},</if>
|
||||
<if test="buildingCode != null">#{buildingCode},</if>
|
||||
<if test="buildingName != null">#{buildingName},</if>
|
||||
<if test="unitCode != null">#{unitCode},</if>
|
||||
<if test="unitName != null">#{unitName},</if>
|
||||
<if test="homeCode != null">#{homeCode},</if>
|
||||
<if test="homeName != null">#{homeName},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="userPic != null">#{userPic},</if>
|
||||
<if test="userStandardPic != null">#{userStandardPic},</if>
|
||||
<if test="identityType != null">#{identityType},</if>
|
||||
<if test="idcard != null and idcard != ''">#{idcard},</if>
|
||||
<if test="sex != null">#{sex},</if>
|
||||
<if test="nation != null">#{nation},</if>
|
||||
<if test="birthday != null">#{birthday},</if>
|
||||
<if test="company != null">#{company},</if>
|
||||
<if test="phone != null and phone != ''">#{phone},</if>
|
||||
<if test="nationality != null">#{nationality},</if>
|
||||
<if test="nativeplace != null">#{nativeplace},</if>
|
||||
<if test="education != null">#{education},</if>
|
||||
<if test="houseHoldRegister != null">#{houseHoldRegister},</if>
|
||||
<if test="houseHoldAddress != null">#{houseHoldAddress},</if>
|
||||
<if test="areaCode != null">#{areaCode},</if>
|
||||
<if test="areaName != null">#{areaName},</if>
|
||||
<if test="habitation != null">#{habitation},</if>
|
||||
<if test="religious != null">#{religious},</if>
|
||||
<if test="politicalOutlook != null">#{politicalOutlook},</if>
|
||||
<if test="entryTime != null">#{entryTime},</if>
|
||||
<if test="marriage != null">#{marriage},</if>
|
||||
<if test="personType != null">#{personType},</if>
|
||||
<if test="personCategory != null">#{personCategory},</if>
|
||||
<if test="caringLabel != null">#{caringLabel},</if>
|
||||
<if test="isHouseholder != null">#{isHouseholder},</if>
|
||||
<if test="householderRelation != null">#{householderRelation},</if>
|
||||
<if test="isVaccinate != null">#{isVaccinate},</if>
|
||||
<if test="isFirstVaccinate != null">#{isFirstVaccinate},</if>
|
||||
<if test="isSecondVaccinate != null">#{isSecondVaccinate},</if>
|
||||
<if test="isThirdVaccinate != null">#{isThirdVaccinate},</if>
|
||||
<if test="c1 != null">#{c1},</if>
|
||||
<if test="c2 != null">#{c2},</if>
|
||||
<if test="c3 != null">#{c3},</if>
|
||||
<if test="c4 != null">#{c4},</if>
|
||||
<if test="c5 != null">#{c5},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<update id="updateVillageUserInfo" parameterType="com.ssf.mysqloracletest.domain.VillageUserInfo">
|
||||
update village_user_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="villageCode != null and villageCode != ''">village_code = #{villageCode},</if>
|
||||
<if test="villageName != null and villageName != ''">village_name = #{villageName},</if>
|
||||
<if test="gridCode != null and gridCode != ''">grid_code = #{gridCode},</if>
|
||||
<if test="gridName != null and gridName != ''">grid_name = #{gridName},</if>
|
||||
<if test="buildingCode != null and buildingCode != ''">building_code = #{buildingCode},</if>
|
||||
<if test="buildingName != null and buildingName != ''">building_name = #{buildingName},</if>
|
||||
<if test="unitCode != null and unitCode != ''">unit_code = #{unitCode},</if>
|
||||
<if test="unitName != null and unitName != ''">unit_name = #{unitName},</if>
|
||||
<if test="homeCode != null and homeCode != ''">home_code = #{homeCode},</if>
|
||||
<if test="homeName != null and homeName != ''">home_name = #{homeName},</if>
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="userPic != null and userPic != ''">user_pic = #{userPic},</if>
|
||||
<if test="userStandardPic != null and userStandardPic != ''">user_standard_pic = #{userStandardPic},</if>
|
||||
<if test="identityType != null and identityType != ''">identity_type = #{identityType},</if>
|
||||
<if test="idcard != null and idcard != '' and idcard != ''">idcard = #{idcard},</if>
|
||||
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
||||
<if test="nation != null and nation != ''">nation = #{nation},</if>
|
||||
<!-- <if test="birthday != null and birthday != ''">birthday = #{birthday},</if>-->
|
||||
<if test="company != null and company != ''">company = #{company},</if>
|
||||
<if test="phone != null and phone != '' and phone!='' ">phone = #{phone},</if>
|
||||
<if test="nationality != null and nationality != ''">nationality = #{nationality},</if>
|
||||
<if test="nativeplace != null and nativeplace != ''">nativeplace = #{nativeplace},</if>
|
||||
<if test="education != null and education != ''">education = #{education},</if>
|
||||
<if test="houseHoldRegister != null and houseHoldRegister != ''">house_hold_register = #{houseHoldRegister},</if>
|
||||
<if test="houseHoldAddress != null and houseHoldAddress != ''">house_hold_address = #{houseHoldAddress},</if>
|
||||
<if test="areaCode != null and areaCode != ''">area_code = #{areaCode},</if>
|
||||
<if test="areaName != null and areaName != ''">area_name = #{areaName},</if>
|
||||
<if test="habitation != null and habitation != ''">habitation = #{habitation},</if>
|
||||
<if test="religious != null and religious != ''">religious = #{religious},</if>
|
||||
<if test="politicalOutlook != null and politicalOutlook != ''">political_outlook = #{politicalOutlook},</if>
|
||||
<!-- <if test="entryTime != null and entryTime != ''">entry_time = #{entryTime},</if>-->
|
||||
<if test="marriage != null and marriage != ''">marriage = #{marriage},</if>
|
||||
<if test="personType != null and personType != ''">person_type = #{personType},</if>
|
||||
<if test="personCategory != null and personCategory != ''">person_category = #{personCategory},</if>
|
||||
<if test="caringLabel != null and caringLabel != ''">caring_label = #{caringLabel},</if>
|
||||
<if test="isHouseholder != null and isHouseholder != ''">is_householder = #{isHouseholder},</if>
|
||||
<if test="householderRelation != null and householderRelation != ''">householder_relation = #{householderRelation},</if>
|
||||
<if test="isVaccinate != null and isVaccinate != ''">is_vaccinate = #{isVaccinate},</if>
|
||||
<if test="isFirstVaccinate != null and isFirstVaccinate != ''">is_first_vaccinate = #{isFirstVaccinate},</if>
|
||||
<if test="isSecondVaccinate != null and isSecondVaccinate != ''">is_second_vaccinate = #{isSecondVaccinate},</if>
|
||||
<if test="isThirdVaccinate != null and isThirdVaccinate != ''">is_third_vaccinate = #{isThirdVaccinate},</if>
|
||||
<if test="isactive != null and c1 != ''">isactive = #{isactive},</if>
|
||||
<if test="c1 != null and c1 != ''">c1 = #{c1},</if>
|
||||
<if test="c2 != null and c2 != ''">c2 = #{c2},</if>
|
||||
<if test="c3 != null and c3 != ''">c3 = #{c3},</if>
|
||||
<if test="c4 != null and c4 != ''">c4 = #{c4},</if>
|
||||
<if test="c5 != null and c5 != ''">c5 = #{c5},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateVillageUserInfoByIdcard" parameterType="com.ssf.mysqloracletest.domain.VillageUserInfo">
|
||||
update village_user_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="villageCode != null and villageCode != ''">village_code = #{villageCode},</if>
|
||||
<if test="villageName != null and villageName != ''">village_name = #{villageName},</if>
|
||||
<if test="gridCode != null and gridCode != ''">grid_code = #{gridCode},</if>
|
||||
<if test="gridName != null and gridName != ''">grid_name = #{gridName},</if>
|
||||
<if test="buildingCode != null and buildingCode != ''">building_code = #{buildingCode},</if>
|
||||
<if test="buildingName != null and buildingName != ''">building_name = #{buildingName},</if>
|
||||
<if test="unitCode != null and unitCode != ''">unit_code = #{unitCode},</if>
|
||||
<if test="unitName != null and unitName != ''">unit_name = #{unitName},</if>
|
||||
<if test="homeCode != null and homeCode != ''">home_code = #{homeCode},</if>
|
||||
<if test="homeName != null and homeName != ''">home_name = #{homeName},</if>
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="userPic != null and userPic != ''">user_pic = #{userPic},</if>
|
||||
<if test="userStandardPic != null and userStandardPic != ''">user_standard_pic = #{userStandardPic},</if>
|
||||
<if test="identityType != null and identityType != ''">identity_type = #{identityType},</if>
|
||||
<if test="idcard != null and idcard != ''">idcard = #{idcard},</if>
|
||||
<if test="sex != null and sex != ''">sex = #{sex},</if>
|
||||
<if test="nation != null and nation != ''">nation = #{nation},</if>
|
||||
<if test="birthday != null and birthday != ''">birthday = #{birthday},</if>
|
||||
<if test="company != null and company != ''">company = #{company},</if>
|
||||
<if test="phone != null and phone!='' ">phone = #{phone},</if>
|
||||
<if test="nationality != null and nationality != ''">nationality = #{nationality},</if>
|
||||
<if test="nativeplace != null and nativeplace != ''">nativeplace = #{nativeplace},</if>
|
||||
<if test="education != null and education != ''">education = #{education},</if>
|
||||
<if test="houseHoldRegister != null and houseHoldRegister != ''">house_hold_register = #{houseHoldRegister},</if>
|
||||
<if test="houseHoldAddress != null and houseHoldAddress != ''">house_hold_address = #{houseHoldAddress},</if>
|
||||
<if test="areaCode != null and areaCode != ''">area_code = #{areaCode},</if>
|
||||
<if test="areaName != null and areaName != ''">area_name = #{areaName},</if>
|
||||
<if test="habitation != null and habitation != ''">habitation = #{habitation},</if>
|
||||
<if test="religious != null and religious != ''">religious = #{religious},</if>
|
||||
<if test="politicalOutlook != null and politicalOutlook != ''">political_outlook = #{politicalOutlook},</if>
|
||||
<if test="entryTime != null and entryTime != ''">entry_time = #{entryTime},</if>
|
||||
<if test="marriage != null and marriage != ''">marriage = #{marriage},</if>
|
||||
<if test="personType != null and personType != ''">person_type = #{personType},</if>
|
||||
<if test="personCategory != null and personCategory != ''">person_category = #{personCategory},</if>
|
||||
<if test="caringLabel != null and caringLabel != ''">caring_label = #{caringLabel},</if>
|
||||
<if test="isHouseholder != null and isHouseholder != ''">is_householder = #{isHouseholder},</if>
|
||||
<if test="householderRelation != null and householderRelation != ''">householder_relation = #{householderRelation},</if>
|
||||
<if test="isVaccinate != null and isVaccinate != ''">is_vaccinate = #{isVaccinate},</if>
|
||||
<if test="isFirstVaccinate != null and isFirstVaccinate != ''">is_first_vaccinate = #{isFirstVaccinate},</if>
|
||||
<if test="isSecondVaccinate != null and isSecondVaccinate != ''">is_second_vaccinate = #{isSecondVaccinate},</if>
|
||||
<if test="isThirdVaccinate != null and isThirdVaccinate != ''">is_third_vaccinate = #{isThirdVaccinate},</if>
|
||||
<if test="isactive != null and isactive != ''">isactive = #{isactive},</if>
|
||||
<if test="c1 != null and c1 != ''">c1 = #{c1},</if>
|
||||
<if test="c3 != null and c3 != ''">c3 = #{c3},</if>
|
||||
<if test="c4 != null and c4 != ''">c4 = #{c4},</if>
|
||||
<if test="c5 != null and c5 != ''">c5 = #{c5},</if>
|
||||
<if test="c2 != null and c2 != ''">c2 = #{c2New},</if>
|
||||
</trim>
|
||||
where idcard = #{idcard} and c2 = #{c2}
|
||||
</update>
|
||||
|
||||
|
||||
<delete id="deleteVillageUserInfoById" parameterType="Long">
|
||||
delete from village_user_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
|
||||
<delete id="deleteVillageUserInfoByUpdatetime" parameterType="com.ssf.mysqloracletest.domain.VillageUserInfo">
|
||||
delete from village_user_info where DATE_FORMAT(updatetime, '%Y-%m-%d') != '${updatetimeV}'
|
||||
</delete>
|
||||
|
||||
<delete id="deleteVillageUserInfoByIds" parameterType="String">
|
||||
delete from village_user_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="logicDelete">
|
||||
update village_user_info
|
||||
set isactive='0'
|
||||
where id in (${idsIn})
|
||||
</update>
|
||||
|
||||
<update id="deleteVillageUserInfo">
|
||||
update village_user_info
|
||||
set isactive='0'
|
||||
where village_code= #{villageCode} and idcard = #{idcard}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
<select id="userArchivesTask" parameterType="com.ssf.mysqloracletest.domain.VillageUserInfo"
|
||||
resultMap="VillageUserInfoResult">
|
||||
select a.* from village_user_info a
|
||||
left join model_suspected_user_info b on a.idcard = b.idcard
|
||||
where b.idcard is not null and b.is_entity='1'
|
||||
</select>
|
||||
|
||||
<select id="userArchivesTaskNotIn" parameterType="com.ssf.mysqloracletest.domain.VillageUserInfo"
|
||||
resultMap="VillageUserInfoResult">
|
||||
select * from (
|
||||
select * from village_user_info a
|
||||
where id not in (
|
||||
select a.id from village_user_info a
|
||||
left join model_suspected_user_info b on a.idcard = b.idcard
|
||||
where b.idcard is not null and b.is_entity='1'
|
||||
)
|
||||
) a
|
||||
left join model_notfound_user_info b on a.idcard = b.idcard
|
||||
where b.idcard is not null
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in new issue