first commit

master
cyFeng 12 months ago
commit a5bfbf3624

29
.gitignore vendored

@ -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,3 @@
# mysql-oracle-dynamic-datasource
SpringBoot集成MyBatis-Plus动态数据源测试同时集成Mysql和Oracle
射阳源数据表接入

@ -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>

286
mvnw vendored

@ -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 "$@"

161
mvnw.cmd vendored

@ -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,24 @@
package com.ssf.mysqloracletest;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
@MapperScan("com.ssf.mysqloracletest.mapper")
@EnableScheduling
@EnableAsync(proxyTargetClass = true)
public class MysqlOracleTestApplication {
private static final Logger logger = LoggerFactory.getLogger(MysqlOracleTestApplication.class);
public static void main(String[] args) {
SpringApplication.run(MysqlOracleTestApplication.class, args);
logger.info("---历史版本号--1.0.0,版本描述初始化项目");
logger.info("---当前版本号--1.0.1,实有人口接入,标准地址接入处理,居住证图片接入处理,实有人口补充图片处理,根据 住户信息表里面没有图片的记录,去查户籍表的原始orcl表,有记录则回填到实有人口表里面");
}
}

@ -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,48 @@
package com.ssf.mysqloracletest.mapper;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.ssf.mysqloracletest.domain.VillageSendRecordStatic;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
@Mapper
@DS("mysql")
public interface VillageSendRecordStaticMapper {
/**
*
*
* @return
*/
int insertRecord(VillageSendRecordStatic villageSendRecordStatic);
/**
*
*
* @return
*/
int insertRecords(List<VillageSendRecordStatic> villageSendRecordStatic);
/**
*
*
* @return
*/
int updateRecord(VillageSendRecordStatic villageSendRecordStatic);
int updateRecordByTableId(VillageSendRecordStatic villageSendRecordStatic);
/**
*
*
* @param map
* @return
*/
Long getMaxTableIdFromVillageSendRecordStatic(Map<String, Object> map);
/**
*
*/
public List<VillageSendRecordStatic> getList(Map<String, Object> map);
}

@ -0,0 +1,93 @@
package com.ssf.mysqloracletest.mapper;
import com.ssf.mysqloracletest.domain.VillageUserInfo;
import java.util.List;
import java.util.Map;
/**
* Mapper
*
* @author ruoyi
* @date 2022-05-17
*/
public interface VillageUserInfoMapper {
/**
*
*
* @param id
* @return
*/
public VillageUserInfo selectVillageUserInfoById(Long id);
public VillageUserInfo selectVillageUserInfoByIdcard(String id);
/**
*
*
* @param villageUserInfo
* @return
*/
public List<VillageUserInfo> selectVillageUserInfoList(VillageUserInfo villageUserInfo);
/**
*
*
* @param villageUserInfo
* @return
*/
public List<VillageUserInfo> archivesList(VillageUserInfo villageUserInfo);
/**
*
*
* @param villageUserInfo
* @return
*/
public int insertVillageUserInfo(VillageUserInfo villageUserInfo);
public int saveOrUpdate(VillageUserInfo villageUserInfo);
/**
*
*
* @param villageUserInfo
* @return
*/
public int updateVillageUserInfo(VillageUserInfo villageUserInfo);
public int updateVillageUserInfoByIdcard(VillageUserInfo bean);
/**
*
*
* @param id
* @return
*/
public int deleteVillageUserInfoById(Long id);
public int deleteVillageUserInfoByUpdatetime(VillageUserInfo bean);
/**
*
*
* @param ids
* @return
*/
public int deleteVillageUserInfoByIds(String[] ids);
/**
*
*/
public int logicDelete(Map<String, Object> map);
/**
* 使
*/
public int deleteVillageUserInfo(Map<String, Object> map);
public List<VillageUserInfo> userArchivesTask(VillageUserInfo userInfo);
public List<VillageUserInfo> userArchivesTaskNotIn(VillageUserInfo userInfo);
}

@ -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,189 @@
package com.ssf.mysqloracletest.utils;
import java.io.*;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
/**
* Properties,classpathconfig.properties
*
* @author QQ:695520848
*/
public class PropertiesUtil {
//配置文件的路径
private String configPath = "config" + File.separator + "application.properties";
public static final String Path = "config" + File.separator + "application.properties";
/**
*
*/
private Properties props = null;
/**
* shclasspathconfig.properties
*/
public PropertiesUtil() throws IOException {
InputStream in = PropertiesUtil.class.getClassLoader().getResourceAsStream("application.properties");
props = new Properties();
props.load(in);
//关闭资源
in.close();
}
/**
* key
* Jun 26, 2010 9:15:43 PM
*
* @param key key
* @return key
* @throws IOException
* @author
*/
public String readValue(String key) throws IOException {
return props.getProperty(key);
}
/**
* properties
* Jun 26, 2010 9:21:01 PM
*
* @throws FileNotFoundException
* @throws IOException
* @author
*/
public Map<String, String> readAllProperties() throws FileNotFoundException, IOException {
//保存所有的键值
Map<String, String> map = new HashMap<String, String>();
Enumeration en = props.propertyNames();
while (en.hasMoreElements()) {
String key = (String) en.nextElement();
String Property = props.getProperty(key);
map.put(key, Property);
}
return map;
}
/**
* key,
* Jun 26, 2010 9:15:43 PM
*
* @param key key
* @return key
* @throws IOException
* @author
*/
public void setValue(String key, String value) throws IOException {
Properties prop = new Properties();
InputStream fis = new FileInputStream(this.configPath);
// 从输入流中读取属性列表(键和元素对)
prop.load(fis);
// 调用 Hashtable 的方法 put。使用 getProperty 方法提供并行性。
// 强制要求为属性的键和值使用字符串。返回值是 Hashtable 调用 put 的结果。
OutputStream fos = new FileOutputStream(this.configPath);
prop.setProperty(key, value);
// 以适合使用 load 方法加载到 Properties 表中的格式,
// 将此 Properties 表中的属性列表(键和元素对)写入输出流
prop.store(fos, "last update");
//关闭文件
fis.close();
fos.close();
}
/**
* key
*
* @param key
* @return
*/
public static String queryPropertiesByKey(String key) {
if ("".equals(StringKit.toString(key))) {
return "";
}
Properties properties = new Properties();
// 使用InPutStream流读取properties文件
BufferedReader bufferedReader = null;
try {
bufferedReader = new BufferedReader(new FileReader(Path));
properties.load(bufferedReader);
String rel = properties.getProperty(key);
bufferedReader.close();
// 获取key对应的value值
return rel;
} catch (IOException e) {
if (null != bufferedReader) {
try {
bufferedReader.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
e.printStackTrace();
}
if (null != bufferedReader) {
try {
bufferedReader.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
return "";
}
/**
* keyvalue
*
* @param key
* @param value
*/
public static void setPropertiesByKey(String key, String value) {
File file = new File(Path);
OrderedProperties properties = new OrderedProperties();
try {
properties.load(new FileInputStream(file));
properties.setProperty(key, value);
//true表示追加打开
FileOutputStream oFile = new FileOutputStream(Path);
properties.store(oFile, "The New properties file");
oFile.close();
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* key
*
* @param key
* @return
*/
public static String queryValue(String key) {
if ("".equals(StringKit.toString(key))) {
return "";
}
Properties properties = new Properties();
BufferedReader bufferedReader = null;
String rel = "";
try {
bufferedReader = new BufferedReader(new FileReader(Path));
properties.load(bufferedReader);
rel = StringKit.toString(properties.getProperty(key));
bufferedReader.close();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (null != bufferedReader) {
try {
bufferedReader.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
return rel;
}
}

@ -0,0 +1,203 @@
package com.ssf.mysqloracletest.utils;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.regex.Pattern;
public class StringKit {
public StringKit() {
}
public static Boolean isEmpty(Object argObject) {
Boolean tbool = false;
String tString = toString(argObject);
if (tString.equals("")) {
tbool = true;
}
return tbool;
}
public static String toString(Object argObject) {
String tmpstr = "";
try {
if (argObject != null) {
tmpstr = argObject.toString();
tmpstr = tmpstr.trim();
if( "null".equals(tmpstr) || "underfind".equals(tmpstr) || "undefined".equals(tmpstr) ){
tmpstr="";
}
}
} catch (Exception var3) {
}
return tmpstr;
}
@Deprecated
public static String toDefaultString(Object argObject) {
String tmpstr = "无";
try {
if (argObject != null) {
tmpstr = argObject.toString();
if( "null".equals(tmpstr) || "underfind".equals(tmpstr) || "undefined".equals(tmpstr) ){
tmpstr="无";
}
}
} catch (Exception var3) {
}
return tmpstr;
}
@Deprecated
public static String toDefaultInt(Object argObject) {
String tmpstr = "0";
try {
if (argObject != null) {
tmpstr = argObject.toString();
if( "null".equals(tmpstr) || "underfind".equals(tmpstr) || "undefined".equals(tmpstr) ){
tmpstr="0";
}
}
} catch (Exception var3) {
}
return tmpstr;
}
public static boolean isNumeric(String str){
Pattern pattern = Pattern.compile("[0-9]*");
return pattern.matcher(str).matches();
}
public static boolean isEng(String str){
Pattern pattern = Pattern.compile("[a-zA-Z]");
return pattern.matcher(str).matches();
}
public static String getTrace(Throwable t){
StringWriter stringWriter = new StringWriter();
PrintWriter writer = new PrintWriter(stringWriter);
t.printStackTrace(writer);
StringBuffer buffer = stringWriter.getBuffer();
return buffer.toString();
}
/**
*
* @return
*/
public static Integer getStrCount(String str,String indexStr){
//java中判断一个字符出现的次数
//在下面字符串中查找有几个啊
// String str = "啊!我爱你中国!啊,我爱你故乡";
//存放每个字符的数组
String [] strs = new String[str.length()];
//计数该字符出现了多少次
int count = 0;
//先把字符串转换成数组
for(int i = 0;i<strs.length;i++){
strs[i] = str.substring(i,i+1);
}
//挨个字符进行查找查找到之后count++
for(int i = 0;i<strs.length;i++){
if(strs[i].equals(indexStr)){
count++;
}
}
// System.out.println("一共有"+count+"个啊");
return count;
}
public static String checkInt(String para){
// if(){
// }
String res = "";
try {
Integer paraInt = Integer.parseInt(para);
res = StringKit.toString(paraInt);
}catch (Exception e){
// logger
}
return res;
}
public static String checkLong(String para){
// if(){
// }
String res = "";
try {
Long paraInt = Long.parseLong(para);
res = StringKit.toString(paraInt);
}catch (Exception e){
// logger
}
return res;
}
public static String checkDouble(String para){
// if(){
// }
String res = "";
try {
Double paraInt = Double.parseDouble(para);
res = StringKit.toString(paraInt);
}catch (Exception e){
// logger
}
return res;
}
/**
*
* @param str
* @return
*/
public static String extractDigits(String str) {
try {
if (str.length() == 0) {
return "";
}
char lastChar = str.charAt(str.length() - 1);
if (Character.isDigit(lastChar)) {
return extractDigits(str.substring(0, str.length() - 1)) + lastChar;
} else {
return "";
}
}catch (Exception e){
return "";
}
}
/**
*
* @param input
* @return
*/
public static String convertChineseUnitToDigit(String input) {
input = input.replaceAll("一单元", "1单元")
.replaceAll("二单元", "2单元")
.replaceAll("三单元", "3单元")
.replaceAll("四单元", "4单元")
.replaceAll("五单元", "5单元")
.replaceAll("六单元", "6单元")
.replaceAll("七单元", "7单元")
.replaceAll("八单元", "8单元")
.replaceAll("九单元", "9单元");
return input;
}
}

@ -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 2021414
*/
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,64 @@
package com.ssf.mysqloracletest.utils.safe;
/**
*
*/
public enum SignAlgorithm {
// The RSA signature algorithm
NONEwithRSA("NONEwithRSA", "RSA"),
// The MD2/MD5 with RSA Encryption signature algorithm
MD2withRSA("MD2withRSA", "RSA"),
MD5withRSA("MD5withRSA", "RSA"),
// The signature algorithm with SHA-* and the RSA
SHA1withRSA("SHA1withRSA", "RSA"),
SHA256withRSA("SHA256withRSA", "RSA"),
SHA384withRSA("SHA384withRSA", "RSA"),
SHA512withRSA("SHA512withRSA", "RSA"),
// The Digital Signature Algorithm
NONEwithDSA("NONEwithDSA", "DSA"),
// The DSA with SHA-1 signature algorithm
SHA1withDSA("SHA1withDSA", "DSA"),
// The ECDSA signature algorithms
NONEwithECDSA("NONEwithECDSA", "EC"),
SHA1withECDSA("SHA1withECDSA", "EC"),
SHA256withECDSA("SHA256withECDSA", "EC"),
SHA384withECDSA("SHA384withECDSA", "EC"),
SHA512withECDSA("SHA512withECDSA", "EC");//
private String value;
private String type;
/**
*
*
* @param value
* @param type XXXwithXXXECDSAEC
*/
private SignAlgorithm(String value, String type) {
this.value = value;
this.type = type;
}
/**
*
*
* @return
*/
public String getValue() {
return this.value;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}

@ -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,18 @@
package com.ssf.mysqloracletest.utils.safe;
import java.io.IOException;
public class TestAes {
public static void main(String[] args) throws IOException {
String jsonStr = "a00108150154581.json";
//AES 加密
String miwen = AESTools.encrypt(jsonStr, "watu2022G409watu");
System.out.println("AES加密结果" + miwen);
//AES 解密
String mingwen = AESTools.decrypt(miwen, "watu2022G409watu");
System.out.println("AES解密结果" + mingwen);
}
}

@ -0,0 +1,35 @@
package com.ssf.mysqloracletest.utils.safe;
import java.io.IOException;
public class TestSign {
public static void main(String[] args) throws IOException {
String jsonStr = "bizContent=4EjlSobzEJU1n42yDUxPSbFuoGiUan4gTbts+uF+eU/qLZ8HwOOLzQsd6+WUwhK4&encryptType=AES&signType=RSA256&timestamp=2020-01-08T15:01:54&version=2.0&filename=SSO_MSG_MOBILECODE_REQ_12010101_20200108150154581.json";
String privateKey = "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAIL9jprY3gGAr2R5/zJMNZ+eQa3CTCik3K960fELEX7A9W9bMYdJYBF84j561vA/0e4GHk3a2+Ti8jQF6ywCk99T2VoLUAWF88kFIlt+6ZjaN9iWjfcU14Lfo9CDbqP+SoLB1mwWtwM5mkn+tYcwHkntpUK3mwny/h323QUy8H9DAgMBAAECgYAG2wpppEwKPBfx5Eis8zwjPH8nfvHJdsduD7mJKhEiVysBRv6SnA6BG84jgv5Y2J4+HOfdH0U+93nBq0WhqgjfJfJzT6E4O6Wzug39oTpQBFbiryNFhvVe3VI6z2Ls8oGFc2G0WqJBRWUw7XddcHVizcSRfDJOVbLE3cdE35biEQJBANdi8Xd4T9NKswTTGnWRaT6ej7M85L9Yq6EWqkjF3WP4ILcEF4xINo+CDhPw/IsY03J4pAPw2Q6zdR0XIHIzlccCQQCbsK37i+PoQPEACDl7ZFVTIomrfhoUMm1cBn85L7Emc9Kssc8RLd+l4W1tD0JC43vrBnZXbkspxQUPM7Ver1qlAkAboSamk7lxulhimw3+3OtqS/7VGE+juCU0IeswMKmoxFC2CYFXzn+pQx65MiXDVijxu0YW91NwzlaMp8XSwIlLAkBtR8GHbDSnxFWlUSCP5OgjN33smtHRVWf/jSvlxv0QYYIB57jRdSKje6zkPS6kZqqHWHzed7NYeUtI1WG8OVdlAkAPwQBVW0y7ekcAhTWrYxws6WtLAXJMWr0vQJiQlTBtoj9kUmMVL135i/fJOqPJH+w8Hw949F2bPT7tWtOU3uyL";
String publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCC/Y6a2N4BgK9kef8yTDWfnkGtwkwopNyvetHxCxF+wPVvWzGHSWARfOI+etbwP9HuBh5N2tvk4vI0BessApPfU9laC1AFhfPJBSJbfumY2jfYlo33FNeC36PQg26j/kqCwdZsFrcDOZpJ/rWHMB5J7aVCt5sJ8v4d9t0FMvB/QwIDAQAB";
//AES 加密
String miwen = AESTools.encrypt(jsonStr, "9767d61ab8f340aa");
System.out.println("AES加密结果" + miwen);
//AES 解密
String mingwen = AESTools.decrypt("", "9767d61ab8f340aa");
System.out.println("AES解密结果" + mingwen);
//SHA256加签
byte[] bs = SignatureTools.sign(SignAlgorithm.SHA256withRSA, jsonStr.getBytes(),
Base64Tools.decodeFromString(privateKey));
String sign = Base64Tools.encodeToString(bs);
System.out.println("SHA256签名结果" + sign);
//SHA256验签
// verify(SignAlgorithm algorithm, byte[] content, byte[] sign, byte[] key)
boolean validSignSuccess = SignatureTools.verify(SignAlgorithm.SHA256withRSA, jsonStr.getBytes(),
Base64Tools.decodeFromString(sign), Base64Tools.decodeFromString(publicKey));
System.out.println("SHA256验签结果" + validSignSuccess);
}
}

@ -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…
Cancel
Save